1 .\" Copyright (c) 2016 The FreeBSD Foundation. All rights reserved.
3 .\" This documentation was created by Ed Maste under sponsorship of
4 .\" The FreeBSD Foundation.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
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.
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
34 .Nd Architecture-specific details
36 Differences between CPU architectures and platforms supported by
40 On all supported architectures,
41 .Bl -column -offset -indent "long long" "Size"
42 .It Sy Type Ta Sy Size
45 .It long Ta sizeof(void*)
50 .Bl -column -offset indent "Sy Architecture" "Sy sizeof(void *)" "Sy sizeof(long double)"
51 .It Sy Architecture Ta Sy sizeof(void *) Ta Sy sizeof(long double)
60 .It mipselhf Ta 4 Ta 8
64 .It mips64el Ta 8 Ta 8
65 .It mips64elhf Ta 8 Ta 8
66 .It mips64hf Ta 8 Ta 8
68 .It powerpc64 Ta 8 Ta 8
70 .It sparc64 Ta 8 Ta 16
72 .Ss Endianness and Char Signedness
73 .Bl -column -offset indent "Sy Architecture" "Sy Endianness" "Sy char Signedness"
74 .It Sy Architecture Ta Sy Endianness Ta Sy char Signedness
75 .It amd64 Ta little Ta signed
76 .It arm Ta little Ta unsigned
77 .It armeb Ta big Ta unsigned
78 .It armv6 Ta little Ta unsigned
79 .It arm64 Ta little Ta unsigned
80 .It i386 Ta little Ta signed
81 .It mips Ta big Ta signed
82 .It mipsel Ta little Ta signed
83 .It mipselhf Ta little Ta signed
84 .It mipshf Ta big Ta signed
85 .It mipsn32 Ta big Ta signed
86 .It mips64 Ta big Ta signed
87 .It mips64el Ta little Ta signed
88 .It mips64elhf Ta little Ta signed
89 .It mips64hf Ta big Ta signed
90 .It powerpc Ta big Ta unsigned
91 .It powerpc64 Ta big Ta unsigned
92 .It riscv Ta little Ta signed
93 .It sparc64 Ta big Ta signed
96 .Bl -column -offset indent "Sy Architecture" "Sy Page Sizes"
97 .It Sy Architecture Ta Sy Page Sizes
98 .It amd64 Ta 4K, 2M, 1G
102 .It arm64 Ta 4K, 2M, 1G
103 .It i386 Ta 4K, 2M (PAE), 4M
119 .Bl -column -offset indent "Sy Architecture" "Sy float, double" "Sy long double"
120 .It Sy Architecture Ta Sy float, double Ta Sy long double
121 .It amd64 Ta hard Ta hard, 80 bit
122 .It arm Ta soft Ta soft, double precision
123 .It armeb Ta soft Ta soft, double precision
124 .It armv6 Ta hard Ta hard, double precision
125 .It arm64 Ta hard Ta soft, quad precision
126 .It i386 Ta hard Ta hard, 80 bit
127 .It mips Ta soft Ta identical to double
128 .It mipsel Ta soft Ta identical to double
129 .It mipselhf Ta hard Ta identical to double
130 .It mipshf Ta hard Ta identical to double
131 .It mipsn32 Ta soft Ta identical to double
132 .It mips64 Ta soft Ta identical to double
133 .It mips64el Ta soft Ta identical to double
134 .It mips64elhf Ta hard Ta identical to double
135 .It mips64hf Ta hard Ta identical to double
136 .It powerpc Ta hard Ta hard, double precision
137 .It powerpc64 Ta hard Ta hard, double precision
138 .It riscv64 Ta hard Ta hard, double precision
139 .It riscv64sf Ta soft Ta soft, double precision
140 .It sparc64 Ta hard Ta hard, quad precision
142 .Ss Predefined Macros
143 The compiler provides a number of predefined macros.
144 Some of these provide architecture-specific details and are explained below.
145 Other macros, including those required by the language standard, are not
148 The full set of predefined macros can be obtained with this command:
149 .Bd -literal -offset indent
150 cc -x c -dM -E /dev/null
153 Common type size and endianness macros:
154 .Bl -column -offset indent "BYTE_ORDER" "Sy Meaning"
155 .It Sy Macro Ta Sy Meaning
156 .It Dv __LP64__ Ta 64-bit (8-byte) long and pointer, 32-bit (4-byte) int
157 .It Dv __ILP32__ Ta 32-bit (4-byte) int, long and pointer
158 .It Dv BYTE_ORDER Ta Either Dv BIG_ENDIAN or Dv LITTLE_ENDIAN .
164 Architecture-specific macros:
165 .Bl -column -offset indent "Sy Architecture" "Sy Predefined macros"
166 .It Sy Architecture Ta Sy Predefined macros
167 .It amd64 Ta Dv __amd64__, Dv __x86_64__
168 .It arm Ta Dv __arm__
169 .It armeb Ta Dv __arm__
170 .It armv6 Ta Dv __arm__, Dv __ARM_ARCH >= 6
171 .It arm64 Ta Dv __aarch64__
172 .It i386 Ta Dv __i386__
173 .It mips Ta Dv __mips__, Dv __MIPSEB__, Dv __mips_o32
174 .It mipsel Ta Dv __mips__, Dv __mips_o32
175 .It mipselhf Ta Dv __mips__, Dv __mips_o32
176 .It mipshf Ta Dv __mips__, Dv __MIPSEB__, Dv __mips_o32
177 .It mipsn32 Ta Dv __mips__, Dv __MIPSEB__, Dv __mips_n32
178 .It mips64 Ta Dv __mips__, Dv __MIPSEB__, Dv __mips_n64
179 .It mips64el Ta Dv __mips__, Dv __mips_n64
180 .It mips64elhf Ta Dv __mips__, Dv __mips_n64
181 .It mips64hf Ta Dv __mips__, Dv __MIPSEB__, Dv __mips_n64
182 .It powerpc Ta Dv __powerpc__
183 .It powerpc64 Ta Dv __powerpc__, Dv __powerpc64__
184 .It riscv Ta Dv __riscv__, Dv __riscv64
185 .It sparc64 Ta Dv __sparc64__
193 manual page appeared in