xref: /freebsd/share/man/man7/arch.7 (revision e3514747256465c52c3b2aedc9795f52c0d3efe9)
1.\" Copyright (c) 2016 The FreeBSD Foundation. All rights reserved.
2.\"
3.\" This documentation was created by Ed Maste under sponsorship of
4.\" The FreeBSD Foundation.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND
16.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE
19.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25.\" SUCH DAMAGE.
26.\"
27.\" $FreeBSD$
28.\"
29.Dd May 2, 2017
30.Dt ARCH 7
31.Os
32.Sh NAME
33.Nm arch
34.Nd Architecture-specific details
35.Sh DESCRIPTION
36Differences between CPU architectures and platforms supported by
37.Fx .
38.Pp
39.Ss Type sizes
40On all supported architectures,
41.Bl -column -offset -indent "long long" "Size"
42.It Sy Type Ta Sy Size
43.It short Ta 2
44.It int Ta 4
45.It long Ta sizeof(void*)
46.It long long Ta 8
47.It float Ta 4
48.It double Ta 8
49.El
50.Bl -column -offset indent "Sy Architecture" "Sy sizeof(void *)" "Sy sizeof(long double)" "Sy sizeof(time_t)"
51.It Sy Architecture Ta Sy sizeof(void *) Ta Sy sizeof(long double) Ta Sy sizeof(time_t)
52.It amd64       Ta 8 Ta 16 Ta 8
53.It arm         Ta 4 Ta  8 Ta 8
54.It armeb       Ta 4 Ta  8 Ta 8
55.It armv6       Ta 4 Ta  8 Ta 8
56.It arm64       Ta 8 Ta 16 Ta 8
57.It i386        Ta 4 Ta 12 Ta 4
58.It mips        Ta 4 Ta  8 Ta 8
59.It mipsel      Ta 4 Ta  8 Ta 8
60.It mipselhf    Ta 4 Ta  8 Ta 8
61.It mipshf      Ta 4 Ta  8 Ta 8
62.It mipsn32     Ta 4 Ta  8 Ta 8
63.It mips64      Ta 8 Ta  8 Ta 8
64.It mips64el    Ta 8 Ta  8 Ta 8
65.It mips64elhf  Ta 8 Ta  8 Ta 8
66.It mips64hf    Ta 8 Ta  8 Ta 8
67.It powerpc     Ta 4 Ta  8 Ta 4
68.It powerpcspe  Ta 4 Ta  8 Ta 4
69.It powerpc64   Ta 8 Ta  8 Ta 8
70.It riscv       Ta 8 Ta 16 Ta 8
71.It sparc64     Ta 8 Ta 16 Ta 8
72.El
73.Ss Endianness and Char Signedness
74.Bl -column -offset indent "Sy Architecture" "Sy Endianness" "Sy char Signedness"
75.It Sy Architecture Ta Sy Endianness Ta Sy char Signedness
76.It amd64       Ta little Ta   signed
77.It arm         Ta little Ta unsigned
78.It armeb       Ta big    Ta unsigned
79.It armv6       Ta little Ta unsigned
80.It arm64       Ta little Ta unsigned
81.It i386        Ta little Ta   signed
82.It mips        Ta big    Ta   signed
83.It mipsel      Ta little Ta   signed
84.It mipselhf    Ta little Ta   signed
85.It mipshf      Ta big    Ta   signed
86.It mipsn32     Ta big    Ta   signed
87.It mips64      Ta big    Ta   signed
88.It mips64el    Ta little Ta   signed
89.It mips64elhf  Ta little Ta   signed
90.It mips64hf    Ta big    Ta   signed
91.It powerpc     Ta big    Ta unsigned
92.It powerpcspe  Ta big    Ta unsigned
93.It powerpc64   Ta big    Ta unsigned
94.It riscv       Ta little Ta   signed
95.It sparc64     Ta big    Ta   signed
96.El
97.Ss Page Size
98.Bl -column -offset indent "Sy Architecture" "Sy Page Sizes"
99.It Sy Architecture Ta Sy Page Sizes
100.It amd64       Ta 4K, 2M, 1G
101.It arm         Ta 4K
102.It armeb       Ta 4K
103.It armv6       Ta 4K, 1M
104.It arm64       Ta 4K, 2M, 1G
105.It i386        Ta 4K, 2M (PAE), 4M
106.It mips        Ta 4K
107.It mipsel      Ta 4K
108.It mipselhf    Ta 4K
109.It mipshf      Ta 4K
110.It mipsn32     Ta 4K
111.It mips64      Ta 4K
112.It mips64el    Ta 4K
113.It mips64elhf  Ta 4K
114.It mips64hf    Ta 4K
115.It powerpc     Ta 4K
116.It powerpcspe  Ta 4K
117.It powerpc64   Ta 4K
118.It riscv       Ta 4K
119.It sparc64     Ta 8K
120.El
121.Ss Floating Point
122.Bl -column -offset indent "Sy Architecture" "Sy float, double" "Sy long double"
123.It Sy Architecture Ta Sy float, double Ta Sy long double
124.It amd64       Ta hard Ta hard, 80 bit
125.It arm         Ta soft Ta soft, double precision
126.It armeb       Ta soft Ta soft, double precision
127.It armv6       Ta hard Ta hard, double precision
128.It arm64       Ta hard Ta soft, quad precision
129.It i386        Ta hard Ta hard, 80 bit
130.It mips        Ta soft Ta identical to double
131.It mipsel      Ta soft Ta identical to double
132.It mipselhf    Ta hard Ta identical to double
133.It mipshf      Ta hard Ta identical to double
134.It mipsn32     Ta soft Ta identical to double
135.It mips64      Ta soft Ta identical to double
136.It mips64el    Ta soft Ta identical to double
137.It mips64elhf  Ta hard Ta identical to double
138.It mips64hf    Ta hard Ta identical to double
139.It powerpc     Ta hard Ta hard, double precision
140.It powerpcspe  Ta hard Ta hard, double precision
141.It powerpc64   Ta hard Ta hard, double precision
142.It riscv64     Ta hard Ta hard, double precision
143.It riscv64sf   Ta soft Ta soft, double precision
144.It sparc64     Ta hard Ta hard, quad precision
145.El
146.Ss Predefined Macros
147The compiler provides a number of predefined macros.
148Some of these provide architecture-specific details and are explained below.
149Other macros, including those required by the language standard, are not
150included here.
151.Pp
152The full set of predefined macros can be obtained with this command:
153.Bd -literal -offset indent
154cc -x c -dM -E /dev/null
155.Ed
156.Pp
157Common type size and endianness macros:
158.Bl -column -offset indent "BYTE_ORDER" "Sy Meaning"
159.It Sy Macro Ta Sy Meaning
160.It Dv __LP64__ Ta 64-bit (8-byte) long and pointer, 32-bit (4-byte) int
161.It Dv __ILP32__ Ta 32-bit (4-byte) int, long and pointer
162.It Dv BYTE_ORDER Ta Either Dv BIG_ENDIAN or Dv LITTLE_ENDIAN .
163.Dv PDP11_ENDIAN
164is not used on
165.Fx .
166.El
167.Pp
168Architecture-specific macros:
169.Bl -column -offset indent "Sy Architecture" "Sy Predefined macros"
170.It Sy Architecture Ta Sy Predefined macros
171.It amd64       Ta Dv __amd64__, Dv __x86_64__
172.It arm         Ta Dv __arm__
173.It armeb       Ta Dv __arm__
174.It armv6       Ta Dv __arm__, Dv __ARM_ARCH >= 6
175.It arm64       Ta Dv __aarch64__
176.It i386        Ta Dv __i386__
177.It mips        Ta Dv __mips__, Dv __MIPSEB__, Dv __mips_o32
178.It mipsel      Ta Dv __mips__, Dv __mips_o32
179.It mipselhf    Ta Dv __mips__, Dv __mips_o32
180.It mipshf      Ta Dv __mips__, Dv __MIPSEB__, Dv __mips_o32
181.It mipsn32     Ta Dv __mips__, Dv __MIPSEB__, Dv __mips_n32
182.It mips64      Ta Dv __mips__, Dv __MIPSEB__, Dv __mips_n64
183.It mips64el    Ta Dv __mips__, Dv __mips_n64
184.It mips64elhf  Ta Dv __mips__, Dv __mips_n64
185.It mips64hf    Ta Dv __mips__, Dv __MIPSEB__, Dv __mips_n64
186.It powerpc     Ta Dv __powerpc__
187.It powerpcspe  Ta Dv __powerpc__, Dv __SPE__
188.It powerpc64   Ta Dv __powerpc__, Dv __powerpc64__
189.It riscv       Ta Dv __riscv__, Dv __riscv64
190.It sparc64     Ta Dv __sparc64__
191.El
192.Sh SEE ALSO
193.Xr src.conf 5 ,
194.Xr build 7
195.Sh HISTORY
196An
197.Nm
198manual page appeared in
199.Fx 12 .
200