xref: /freebsd/share/man/man7/arch.7 (revision dddb157699b97ca2aa52925b412d35ceaaf7b50d)
1df9330b5SEd Maste.\" Copyright (c) 2016 The FreeBSD Foundation. All rights reserved.
2df9330b5SEd Maste.\"
3df9330b5SEd Maste.\" This documentation was created by Ed Maste under sponsorship of
4df9330b5SEd Maste.\" The FreeBSD Foundation.
5df9330b5SEd Maste.\"
6df9330b5SEd Maste.\" Redistribution and use in source and binary forms, with or without
7df9330b5SEd Maste.\" modification, are permitted provided that the following conditions
8df9330b5SEd Maste.\" are met:
9df9330b5SEd Maste.\" 1. Redistributions of source code must retain the above copyright
10df9330b5SEd Maste.\"    notice, this list of conditions and the following disclaimer.
11df9330b5SEd Maste.\" 2. Redistributions in binary form must reproduce the above copyright
12df9330b5SEd Maste.\"    notice, this list of conditions and the following disclaimer in the
13df9330b5SEd Maste.\"    documentation and/or other materials provided with the distribution.
14df9330b5SEd Maste.\"
15df9330b5SEd Maste.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND
16df9330b5SEd Maste.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17df9330b5SEd Maste.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18df9330b5SEd Maste.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE
19df9330b5SEd Maste.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20df9330b5SEd Maste.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21df9330b5SEd Maste.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22df9330b5SEd Maste.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23df9330b5SEd Maste.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24df9330b5SEd Maste.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25df9330b5SEd Maste.\" SUCH DAMAGE.
26df9330b5SEd Maste.\"
27df9330b5SEd Maste.\" $FreeBSD$
28df9330b5SEd Maste.\"
294dd67957SJohn Baldwin.Dd May 3, 2017
30df9330b5SEd Maste.Dt ARCH 7
31df9330b5SEd Maste.Os
32df9330b5SEd Maste.Sh NAME
33df9330b5SEd Maste.Nm arch
34df9330b5SEd Maste.Nd Architecture-specific details
35df9330b5SEd Maste.Sh DESCRIPTION
36df9330b5SEd MasteDifferences between CPU architectures and platforms supported by
37df9330b5SEd Maste.Fx .
38df9330b5SEd Maste.Pp
39*dddb1576SKonstantin BelousovIf not explicitly mentioned, sizes are in bytes.
40df9330b5SEd Maste.Ss Type sizes
41*dddb1576SKonstantin BelousovOn all supported architectures:
42df9330b5SEd Maste.Bl -column -offset -indent "long long" "Size"
43df9330b5SEd Maste.It Sy Type Ta Sy Size
44df9330b5SEd Maste.It short Ta 2
45df9330b5SEd Maste.It int Ta 4
46df9330b5SEd Maste.It long Ta sizeof(void*)
47df9330b5SEd Maste.It long long Ta 8
48df9330b5SEd Maste.It float Ta 4
49df9330b5SEd Maste.It double Ta 8
50df9330b5SEd Maste.El
51*dddb1576SKonstantin Belousov.Pp
52*dddb1576SKonstantin BelousovMachine-dependent type sizes:
53*dddb1576SKonstantin Belousov.Bl -column -offset indent "Sy Architecture" "Sy void *" "Sy long double" "Sy time_t"
54*dddb1576SKonstantin Belousov.It Sy Architecture Ta Sy void * Ta Sy long double Ta Sy time_t
556554316cSKonstantin Belousov.It amd64       Ta 8 Ta 16 Ta 8
566554316cSKonstantin Belousov.It arm         Ta 4 Ta  8 Ta 8
576554316cSKonstantin Belousov.It armeb       Ta 4 Ta  8 Ta 8
586554316cSKonstantin Belousov.It armv6       Ta 4 Ta  8 Ta 8
596554316cSKonstantin Belousov.It arm64       Ta 8 Ta 16 Ta 8
606554316cSKonstantin Belousov.It i386        Ta 4 Ta 12 Ta 4
616554316cSKonstantin Belousov.It mips        Ta 4 Ta  8 Ta 8
626554316cSKonstantin Belousov.It mipsel      Ta 4 Ta  8 Ta 8
636554316cSKonstantin Belousov.It mipselhf    Ta 4 Ta  8 Ta 8
646554316cSKonstantin Belousov.It mipshf      Ta 4 Ta  8 Ta 8
656554316cSKonstantin Belousov.It mipsn32     Ta 4 Ta  8 Ta 8
666554316cSKonstantin Belousov.It mips64      Ta 8 Ta  8 Ta 8
676554316cSKonstantin Belousov.It mips64el    Ta 8 Ta  8 Ta 8
686554316cSKonstantin Belousov.It mips64elhf  Ta 8 Ta  8 Ta 8
696554316cSKonstantin Belousov.It mips64hf    Ta 8 Ta  8 Ta 8
706554316cSKonstantin Belousov.It powerpc     Ta 4 Ta  8 Ta 4
71002cc1f9SJustin Hibbits.It powerpcspe  Ta 4 Ta  8 Ta 4
726554316cSKonstantin Belousov.It powerpc64   Ta 8 Ta  8 Ta 8
734dd67957SJohn Baldwin.It riscv64     Ta 8 Ta 16 Ta 8
744dd67957SJohn Baldwin.It riscv64sf   Ta 8 Ta 16 Ta 8
756554316cSKonstantin Belousov.It sparc64     Ta 8 Ta 16 Ta 8
76df9330b5SEd Maste.El
77*dddb1576SKonstantin Belousov.Pp
78*dddb1576SKonstantin Belousov.Sy time_t
79*dddb1576SKonstantin Belousovis 8 bytes on all supported architectures except i386 and 32-bit
80*dddb1576SKonstantin Belousovvariants of powerpc.
81df9330b5SEd Maste.Ss Endianness and Char Signedness
8242e83752SKonstantin Belousov.Bl -column -offset indent "Sy Architecture" "Sy Endianness" "Sy char Signedness"
83df9330b5SEd Maste.It Sy Architecture Ta Sy Endianness Ta Sy char Signedness
84df9330b5SEd Maste.It amd64       Ta little Ta   signed
85df9330b5SEd Maste.It arm         Ta little Ta unsigned
86df9330b5SEd Maste.It armeb       Ta big    Ta unsigned
87df9330b5SEd Maste.It armv6       Ta little Ta unsigned
88df9330b5SEd Maste.It arm64       Ta little Ta unsigned
89df9330b5SEd Maste.It i386        Ta little Ta   signed
908395cdc1SEd Maste.It mips        Ta big    Ta   signed
918395cdc1SEd Maste.It mipsel      Ta little Ta   signed
925bca2215SRuslan Bukin.It mipselhf    Ta little Ta   signed
935bca2215SRuslan Bukin.It mipshf      Ta big    Ta   signed
948395cdc1SEd Maste.It mipsn32     Ta big    Ta   signed
958395cdc1SEd Maste.It mips64      Ta big    Ta   signed
96df9330b5SEd Maste.It mips64el    Ta little Ta   signed
975bca2215SRuslan Bukin.It mips64elhf  Ta little Ta   signed
985bca2215SRuslan Bukin.It mips64hf    Ta big    Ta   signed
99df9330b5SEd Maste.It powerpc     Ta big    Ta unsigned
100002cc1f9SJustin Hibbits.It powerpcspe  Ta big    Ta unsigned
101df9330b5SEd Maste.It powerpc64   Ta big    Ta unsigned
1024dd67957SJohn Baldwin.It riscv64     Ta little Ta   signed
1034dd67957SJohn Baldwin.It riscv64sf   Ta little Ta   signed
104df9330b5SEd Maste.It sparc64     Ta big    Ta   signed
105df9330b5SEd Maste.El
106df9330b5SEd Maste.Ss Page Size
1071859c867SKonstantin Belousov.Bl -column -offset indent "Sy Architecture" "Sy Page Sizes"
108df9330b5SEd Maste.It Sy Architecture Ta Sy Page Sizes
109df9330b5SEd Maste.It amd64       Ta 4K, 2M, 1G
110df9330b5SEd Maste.It arm         Ta 4K
111df9330b5SEd Maste.It armeb       Ta 4K
112780586e8SEd Maste.It armv6       Ta 4K, 1M
113df9330b5SEd Maste.It arm64       Ta 4K, 2M, 1G
114df9330b5SEd Maste.It i386        Ta 4K, 2M (PAE), 4M
115df9330b5SEd Maste.It mips        Ta 4K
116df9330b5SEd Maste.It mipsel      Ta 4K
1175bca2215SRuslan Bukin.It mipselhf    Ta 4K
1185bca2215SRuslan Bukin.It mipshf      Ta 4K
119df9330b5SEd Maste.It mipsn32     Ta 4K
120df9330b5SEd Maste.It mips64      Ta 4K
121df9330b5SEd Maste.It mips64el    Ta 4K
1225bca2215SRuslan Bukin.It mips64elhf  Ta 4K
1235bca2215SRuslan Bukin.It mips64hf    Ta 4K
124df9330b5SEd Maste.It powerpc     Ta 4K
125002cc1f9SJustin Hibbits.It powerpcspe  Ta 4K
126df9330b5SEd Maste.It powerpc64   Ta 4K
1274dd67957SJohn Baldwin.It riscv64     Ta 4K
1284dd67957SJohn Baldwin.It riscv64sf   Ta 4K
129df9330b5SEd Maste.It sparc64     Ta 8K
130df9330b5SEd Maste.El
131df9330b5SEd Maste.Ss Floating Point
1321859c867SKonstantin Belousov.Bl -column -offset indent "Sy Architecture" "Sy float, double" "Sy long double"
133df9330b5SEd Maste.It Sy Architecture Ta Sy float, double Ta Sy long double
134df9330b5SEd Maste.It amd64       Ta hard Ta hard, 80 bit
135df9330b5SEd Maste.It arm         Ta soft Ta soft, double precision
136df9330b5SEd Maste.It armeb       Ta soft Ta soft, double precision
137df9330b5SEd Maste.It armv6       Ta hard Ta hard, double precision
138df9330b5SEd Maste.It arm64       Ta hard Ta soft, quad precision
139df9330b5SEd Maste.It i386        Ta hard Ta hard, 80 bit
140df9330b5SEd Maste.It mips        Ta soft Ta identical to double
141df9330b5SEd Maste.It mipsel      Ta soft Ta identical to double
1425bca2215SRuslan Bukin.It mipselhf    Ta hard Ta identical to double
1435bca2215SRuslan Bukin.It mipshf      Ta hard Ta identical to double
144df9330b5SEd Maste.It mipsn32     Ta soft Ta identical to double
145df9330b5SEd Maste.It mips64      Ta soft Ta identical to double
146df9330b5SEd Maste.It mips64el    Ta soft Ta identical to double
1475bca2215SRuslan Bukin.It mips64elhf  Ta hard Ta identical to double
1485bca2215SRuslan Bukin.It mips64hf    Ta hard Ta identical to double
149df9330b5SEd Maste.It powerpc     Ta hard Ta hard, double precision
150002cc1f9SJustin Hibbits.It powerpcspe  Ta hard Ta hard, double precision
151df9330b5SEd Maste.It powerpc64   Ta hard Ta hard, double precision
152cb8c6df4SKevin Lo.It riscv64     Ta hard Ta hard, double precision
153cb8c6df4SKevin Lo.It riscv64sf   Ta soft Ta soft, double precision
154df9330b5SEd Maste.It sparc64     Ta hard Ta hard, quad precision
155df9330b5SEd Maste.El
156df9330b5SEd Maste.Ss Predefined Macros
157df9330b5SEd MasteThe compiler provides a number of predefined macros.
158df9330b5SEd MasteSome of these provide architecture-specific details and are explained below.
159df9330b5SEd MasteOther macros, including those required by the language standard, are not
160df9330b5SEd Masteincluded here.
161df9330b5SEd Maste.Pp
162df9330b5SEd MasteThe full set of predefined macros can be obtained with this command:
163df9330b5SEd Maste.Bd -literal -offset indent
1648e71e112SEd Mastecc -x c -dM -E /dev/null
165df9330b5SEd Maste.Ed
166df9330b5SEd Maste.Pp
167df9330b5SEd MasteCommon type size and endianness macros:
1681859c867SKonstantin Belousov.Bl -column -offset indent "BYTE_ORDER" "Sy Meaning"
169df9330b5SEd Maste.It Sy Macro Ta Sy Meaning
170df9330b5SEd Maste.It Dv __LP64__ Ta 64-bit (8-byte) long and pointer, 32-bit (4-byte) int
171df9330b5SEd Maste.It Dv __ILP32__ Ta 32-bit (4-byte) int, long and pointer
172df9330b5SEd Maste.It Dv BYTE_ORDER Ta Either Dv BIG_ENDIAN or Dv LITTLE_ENDIAN .
1731859c867SKonstantin Belousov.Dv PDP11_ENDIAN
1741859c867SKonstantin Belousovis not used on
1751859c867SKonstantin Belousov.Fx .
176df9330b5SEd Maste.El
177df9330b5SEd Maste.Pp
178df9330b5SEd MasteArchitecture-specific macros:
1791859c867SKonstantin Belousov.Bl -column -offset indent "Sy Architecture" "Sy Predefined macros"
180df9330b5SEd Maste.It Sy Architecture Ta Sy Predefined macros
181df9330b5SEd Maste.It amd64       Ta Dv __amd64__, Dv __x86_64__
182df9330b5SEd Maste.It arm         Ta Dv __arm__
183df9330b5SEd Maste.It armeb       Ta Dv __arm__
184df9330b5SEd Maste.It armv6       Ta Dv __arm__, Dv __ARM_ARCH >= 6
185df9330b5SEd Maste.It arm64       Ta Dv __aarch64__
186df9330b5SEd Maste.It i386        Ta Dv __i386__
187df9330b5SEd Maste.It mips        Ta Dv __mips__, Dv __MIPSEB__, Dv __mips_o32
188df9330b5SEd Maste.It mipsel      Ta Dv __mips__, Dv __mips_o32
1895bca2215SRuslan Bukin.It mipselhf    Ta Dv __mips__, Dv __mips_o32
1905bca2215SRuslan Bukin.It mipshf      Ta Dv __mips__, Dv __MIPSEB__, Dv __mips_o32
191df9330b5SEd Maste.It mipsn32     Ta Dv __mips__, Dv __MIPSEB__, Dv __mips_n32
192df9330b5SEd Maste.It mips64      Ta Dv __mips__, Dv __MIPSEB__, Dv __mips_n64
193df9330b5SEd Maste.It mips64el    Ta Dv __mips__, Dv __mips_n64
1945bca2215SRuslan Bukin.It mips64elhf  Ta Dv __mips__, Dv __mips_n64
1955bca2215SRuslan Bukin.It mips64hf    Ta Dv __mips__, Dv __MIPSEB__, Dv __mips_n64
196df9330b5SEd Maste.It powerpc     Ta Dv __powerpc__
197002cc1f9SJustin Hibbits.It powerpcspe  Ta Dv __powerpc__, Dv __SPE__
198df9330b5SEd Maste.It powerpc64   Ta Dv __powerpc__, Dv __powerpc64__
1994dd67957SJohn Baldwin.It riscv64     Ta Dv __riscv__, Dv __riscv64
2004dd67957SJohn Baldwin.It riscv64sf   Ta Dv __riscv__, Dv __riscv64
201df9330b5SEd Maste.It sparc64     Ta Dv __sparc64__
202df9330b5SEd Maste.El
203df9330b5SEd Maste.Sh SEE ALSO
204df9330b5SEd Maste.Xr src.conf 5 ,
205df9330b5SEd Maste.Xr build 7
206df9330b5SEd Maste.Sh HISTORY
207df9330b5SEd MasteAn
208df9330b5SEd Maste.Nm
209df9330b5SEd Mastemanual page appeared in
210df9330b5SEd Maste.Fx 12 .
211