| OLD | NEW |
| (Empty) |
| 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | |
| 2 /* This Source Code Form is subject to the terms of the Mozilla Public | |
| 3 * License, v. 2.0. If a copy of the MPL was not distributed with this | |
| 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | |
| 5 | |
| 6 /* | |
| 7 * This file is used by not only Linux but also other glibc systems | |
| 8 * such as GNU/Hurd and GNU/k*BSD. | |
| 9 */ | |
| 10 | |
| 11 #ifndef nspr_cpucfg___ | |
| 12 #define nspr_cpucfg___ | |
| 13 | |
| 14 #ifndef XP_UNIX | |
| 15 #define XP_UNIX | |
| 16 #endif | |
| 17 | |
| 18 #if !defined(LINUX) && defined(__linux__) | |
| 19 #define LINUX | |
| 20 #endif | |
| 21 | |
| 22 #ifdef __FreeBSD_kernel__ | |
| 23 #define PR_AF_INET6 28 /* same as AF_INET6 */ | |
| 24 #elif defined(__GNU__) | |
| 25 #define PR_AF_INET6 26 /* same as AF_INET6 */ | |
| 26 #else | |
| 27 #define PR_AF_INET6 10 /* same as AF_INET6 */ | |
| 28 #endif | |
| 29 | |
| 30 #ifdef __powerpc64__ | |
| 31 | |
| 32 #ifdef __LITTLE_ENDIAN__ | |
| 33 #define IS_LITTLE_ENDIAN 1 | |
| 34 #undef IS_BIG_ENDIAN | |
| 35 #else | |
| 36 #undef IS_LITTLE_ENDIAN | |
| 37 #define IS_BIG_ENDIAN 1 | |
| 38 #endif | |
| 39 #define IS_64 | |
| 40 | |
| 41 #define PR_BYTES_PER_BYTE 1 | |
| 42 #define PR_BYTES_PER_SHORT 2 | |
| 43 #define PR_BYTES_PER_INT 4 | |
| 44 #define PR_BYTES_PER_INT64 8 | |
| 45 #define PR_BYTES_PER_LONG 8 | |
| 46 #define PR_BYTES_PER_FLOAT 4 | |
| 47 #define PR_BYTES_PER_DOUBLE 8 | |
| 48 #define PR_BYTES_PER_WORD 8 | |
| 49 #define PR_BYTES_PER_DWORD 8 | |
| 50 | |
| 51 #define PR_BITS_PER_BYTE 8 | |
| 52 #define PR_BITS_PER_SHORT 16 | |
| 53 #define PR_BITS_PER_INT 32 | |
| 54 #define PR_BITS_PER_INT64 64 | |
| 55 #define PR_BITS_PER_LONG 64 | |
| 56 #define PR_BITS_PER_FLOAT 32 | |
| 57 #define PR_BITS_PER_DOUBLE 64 | |
| 58 #define PR_BITS_PER_WORD 64 | |
| 59 | |
| 60 #define PR_BITS_PER_BYTE_LOG2 3 | |
| 61 #define PR_BITS_PER_SHORT_LOG2 4 | |
| 62 #define PR_BITS_PER_INT_LOG2 5 | |
| 63 #define PR_BITS_PER_INT64_LOG2 6 | |
| 64 #define PR_BITS_PER_LONG_LOG2 6 | |
| 65 #define PR_BITS_PER_FLOAT_LOG2 5 | |
| 66 #define PR_BITS_PER_DOUBLE_LOG2 6 | |
| 67 #define PR_BITS_PER_WORD_LOG2 6 | |
| 68 | |
| 69 #define PR_ALIGN_OF_SHORT 2 | |
| 70 #define PR_ALIGN_OF_INT 4 | |
| 71 #define PR_ALIGN_OF_LONG 8 | |
| 72 #define PR_ALIGN_OF_INT64 8 | |
| 73 #define PR_ALIGN_OF_FLOAT 4 | |
| 74 #define PR_ALIGN_OF_DOUBLE 8 | |
| 75 #define PR_ALIGN_OF_POINTER 8 | |
| 76 #define PR_ALIGN_OF_WORD 8 | |
| 77 | |
| 78 #define PR_BYTES_PER_WORD_LOG2 3 | |
| 79 #define PR_BYTES_PER_DWORD_LOG2 3 | |
| 80 | |
| 81 #elif defined(__powerpc__) | |
| 82 | |
| 83 #ifdef __LITTLE_ENDIAN__ | |
| 84 #define IS_LITTLE_ENDIAN 1 | |
| 85 #undef IS_BIG_ENDIAN | |
| 86 #else | |
| 87 #undef IS_LITTLE_ENDIAN | |
| 88 #define IS_BIG_ENDIAN 1 | |
| 89 #endif | |
| 90 | |
| 91 #define PR_BYTES_PER_BYTE 1 | |
| 92 #define PR_BYTES_PER_SHORT 2 | |
| 93 #define PR_BYTES_PER_INT 4 | |
| 94 #define PR_BYTES_PER_INT64 8 | |
| 95 #define PR_BYTES_PER_LONG 4 | |
| 96 #define PR_BYTES_PER_FLOAT 4 | |
| 97 #define PR_BYTES_PER_DOUBLE 8 | |
| 98 #define PR_BYTES_PER_WORD 4 | |
| 99 #define PR_BYTES_PER_DWORD 8 | |
| 100 | |
| 101 #define PR_BITS_PER_BYTE 8 | |
| 102 #define PR_BITS_PER_SHORT 16 | |
| 103 #define PR_BITS_PER_INT 32 | |
| 104 #define PR_BITS_PER_INT64 64 | |
| 105 #define PR_BITS_PER_LONG 32 | |
| 106 #define PR_BITS_PER_FLOAT 32 | |
| 107 #define PR_BITS_PER_DOUBLE 64 | |
| 108 #define PR_BITS_PER_WORD 32 | |
| 109 | |
| 110 #define PR_BITS_PER_BYTE_LOG2 3 | |
| 111 #define PR_BITS_PER_SHORT_LOG2 4 | |
| 112 #define PR_BITS_PER_INT_LOG2 5 | |
| 113 #define PR_BITS_PER_INT64_LOG2 6 | |
| 114 #define PR_BITS_PER_LONG_LOG2 5 | |
| 115 #define PR_BITS_PER_FLOAT_LOG2 5 | |
| 116 #define PR_BITS_PER_DOUBLE_LOG2 6 | |
| 117 #define PR_BITS_PER_WORD_LOG2 5 | |
| 118 | |
| 119 #define PR_ALIGN_OF_SHORT 2 | |
| 120 #define PR_ALIGN_OF_INT 4 | |
| 121 #define PR_ALIGN_OF_LONG 4 | |
| 122 #define PR_ALIGN_OF_INT64 8 | |
| 123 #define PR_ALIGN_OF_FLOAT 4 | |
| 124 #define PR_ALIGN_OF_DOUBLE 8 | |
| 125 #define PR_ALIGN_OF_POINTER 4 | |
| 126 #define PR_ALIGN_OF_WORD 4 | |
| 127 | |
| 128 #define PR_BYTES_PER_WORD_LOG2 2 | |
| 129 #define PR_BYTES_PER_DWORD_LOG2 3 | |
| 130 | |
| 131 #elif defined(__alpha) | |
| 132 | |
| 133 #define IS_LITTLE_ENDIAN 1 | |
| 134 #undef IS_BIG_ENDIAN | |
| 135 #define IS_64 | |
| 136 | |
| 137 #define PR_BYTES_PER_BYTE 1 | |
| 138 #define PR_BYTES_PER_SHORT 2 | |
| 139 #define PR_BYTES_PER_INT 4 | |
| 140 #define PR_BYTES_PER_INT64 8 | |
| 141 #define PR_BYTES_PER_LONG 8 | |
| 142 #define PR_BYTES_PER_FLOAT 4 | |
| 143 #define PR_BYTES_PER_DOUBLE 8 | |
| 144 #define PR_BYTES_PER_WORD 8 | |
| 145 #define PR_BYTES_PER_DWORD 8 | |
| 146 | |
| 147 #define PR_BITS_PER_BYTE 8 | |
| 148 #define PR_BITS_PER_SHORT 16 | |
| 149 #define PR_BITS_PER_INT 32 | |
| 150 #define PR_BITS_PER_INT64 64 | |
| 151 #define PR_BITS_PER_LONG 64 | |
| 152 #define PR_BITS_PER_FLOAT 32 | |
| 153 #define PR_BITS_PER_DOUBLE 64 | |
| 154 #define PR_BITS_PER_WORD 64 | |
| 155 | |
| 156 #define PR_BITS_PER_BYTE_LOG2 3 | |
| 157 #define PR_BITS_PER_SHORT_LOG2 4 | |
| 158 #define PR_BITS_PER_INT_LOG2 5 | |
| 159 #define PR_BITS_PER_INT64_LOG2 6 | |
| 160 #define PR_BITS_PER_LONG_LOG2 6 | |
| 161 #define PR_BITS_PER_FLOAT_LOG2 5 | |
| 162 #define PR_BITS_PER_DOUBLE_LOG2 6 | |
| 163 #define PR_BITS_PER_WORD_LOG2 6 | |
| 164 | |
| 165 #define PR_ALIGN_OF_SHORT 2 | |
| 166 #define PR_ALIGN_OF_INT 4 | |
| 167 #define PR_ALIGN_OF_LONG 8 | |
| 168 #define PR_ALIGN_OF_INT64 8 | |
| 169 #define PR_ALIGN_OF_FLOAT 4 | |
| 170 #define PR_ALIGN_OF_DOUBLE 8 | |
| 171 #define PR_ALIGN_OF_POINTER 8 | |
| 172 #define PR_ALIGN_OF_WORD 8 | |
| 173 | |
| 174 #define PR_BYTES_PER_WORD_LOG2 3 | |
| 175 #define PR_BYTES_PER_DWORD_LOG2 3 | |
| 176 | |
| 177 #elif defined(__ia64__) | |
| 178 | |
| 179 #define IS_LITTLE_ENDIAN 1 | |
| 180 #undef IS_BIG_ENDIAN | |
| 181 #define IS_64 | |
| 182 | |
| 183 #define PR_BYTES_PER_BYTE 1 | |
| 184 #define PR_BYTES_PER_SHORT 2 | |
| 185 #define PR_BYTES_PER_INT 4 | |
| 186 #define PR_BYTES_PER_INT64 8 | |
| 187 #define PR_BYTES_PER_LONG 8 | |
| 188 #define PR_BYTES_PER_FLOAT 4 | |
| 189 #define PR_BYTES_PER_DOUBLE 8 | |
| 190 #define PR_BYTES_PER_WORD 8 | |
| 191 #define PR_BYTES_PER_DWORD 8 | |
| 192 | |
| 193 #define PR_BITS_PER_BYTE 8 | |
| 194 #define PR_BITS_PER_SHORT 16 | |
| 195 #define PR_BITS_PER_INT 32 | |
| 196 #define PR_BITS_PER_INT64 64 | |
| 197 #define PR_BITS_PER_LONG 64 | |
| 198 #define PR_BITS_PER_FLOAT 32 | |
| 199 #define PR_BITS_PER_DOUBLE 64 | |
| 200 #define PR_BITS_PER_WORD 64 | |
| 201 | |
| 202 #define PR_BITS_PER_BYTE_LOG2 3 | |
| 203 #define PR_BITS_PER_SHORT_LOG2 4 | |
| 204 #define PR_BITS_PER_INT_LOG2 5 | |
| 205 #define PR_BITS_PER_INT64_LOG2 6 | |
| 206 #define PR_BITS_PER_LONG_LOG2 6 | |
| 207 #define PR_BITS_PER_FLOAT_LOG2 5 | |
| 208 #define PR_BITS_PER_DOUBLE_LOG2 6 | |
| 209 #define PR_BITS_PER_WORD_LOG2 6 | |
| 210 | |
| 211 #define PR_ALIGN_OF_SHORT 2 | |
| 212 #define PR_ALIGN_OF_INT 4 | |
| 213 #define PR_ALIGN_OF_LONG 8 | |
| 214 #define PR_ALIGN_OF_INT64 8 | |
| 215 #define PR_ALIGN_OF_FLOAT 4 | |
| 216 #define PR_ALIGN_OF_DOUBLE 8 | |
| 217 #define PR_ALIGN_OF_POINTER 8 | |
| 218 #define PR_ALIGN_OF_WORD 8 | |
| 219 | |
| 220 #define PR_BYTES_PER_WORD_LOG2 3 | |
| 221 #define PR_BYTES_PER_DWORD_LOG2 3 | |
| 222 | |
| 223 #elif defined(__x86_64__) | |
| 224 | |
| 225 #ifdef __ILP32__ | |
| 226 | |
| 227 #define IS_LITTLE_ENDIAN 1 | |
| 228 #undef IS_BIG_ENDIAN | |
| 229 | |
| 230 #define PR_BYTES_PER_BYTE 1 | |
| 231 #define PR_BYTES_PER_SHORT 2 | |
| 232 #define PR_BYTES_PER_INT 4 | |
| 233 #define PR_BYTES_PER_INT64 8 | |
| 234 #define PR_BYTES_PER_LONG 4 | |
| 235 #define PR_BYTES_PER_FLOAT 4 | |
| 236 #define PR_BYTES_PER_DOUBLE 8 | |
| 237 #define PR_BYTES_PER_WORD 4 | |
| 238 #define PR_BYTES_PER_DWORD 8 | |
| 239 | |
| 240 #define PR_BITS_PER_BYTE 8 | |
| 241 #define PR_BITS_PER_SHORT 16 | |
| 242 #define PR_BITS_PER_INT 32 | |
| 243 #define PR_BITS_PER_INT64 64 | |
| 244 #define PR_BITS_PER_LONG 32 | |
| 245 #define PR_BITS_PER_FLOAT 32 | |
| 246 #define PR_BITS_PER_DOUBLE 64 | |
| 247 #define PR_BITS_PER_WORD 32 | |
| 248 | |
| 249 #define PR_BITS_PER_BYTE_LOG2 3 | |
| 250 #define PR_BITS_PER_SHORT_LOG2 4 | |
| 251 #define PR_BITS_PER_INT_LOG2 5 | |
| 252 #define PR_BITS_PER_INT64_LOG2 6 | |
| 253 #define PR_BITS_PER_LONG_LOG2 5 | |
| 254 #define PR_BITS_PER_FLOAT_LOG2 5 | |
| 255 #define PR_BITS_PER_DOUBLE_LOG2 6 | |
| 256 #define PR_BITS_PER_WORD_LOG2 5 | |
| 257 | |
| 258 #define PR_ALIGN_OF_SHORT 2 | |
| 259 #define PR_ALIGN_OF_INT 4 | |
| 260 #define PR_ALIGN_OF_LONG 4 | |
| 261 #define PR_ALIGN_OF_INT64 8 | |
| 262 #define PR_ALIGN_OF_FLOAT 4 | |
| 263 #define PR_ALIGN_OF_DOUBLE 8 | |
| 264 #define PR_ALIGN_OF_POINTER 4 | |
| 265 #define PR_ALIGN_OF_WORD 4 | |
| 266 | |
| 267 #define PR_BYTES_PER_WORD_LOG2 2 | |
| 268 #define PR_BYTES_PER_DWORD_LOG2 3 | |
| 269 | |
| 270 #else | |
| 271 | |
| 272 #define IS_LITTLE_ENDIAN 1 | |
| 273 #undef IS_BIG_ENDIAN | |
| 274 #define IS_64 | |
| 275 | |
| 276 #define PR_BYTES_PER_BYTE 1 | |
| 277 #define PR_BYTES_PER_SHORT 2 | |
| 278 #define PR_BYTES_PER_INT 4 | |
| 279 #define PR_BYTES_PER_INT64 8 | |
| 280 #define PR_BYTES_PER_LONG 8 | |
| 281 #define PR_BYTES_PER_FLOAT 4 | |
| 282 #define PR_BYTES_PER_DOUBLE 8 | |
| 283 #define PR_BYTES_PER_WORD 8 | |
| 284 #define PR_BYTES_PER_DWORD 8 | |
| 285 | |
| 286 #define PR_BITS_PER_BYTE 8 | |
| 287 #define PR_BITS_PER_SHORT 16 | |
| 288 #define PR_BITS_PER_INT 32 | |
| 289 #define PR_BITS_PER_INT64 64 | |
| 290 #define PR_BITS_PER_LONG 64 | |
| 291 #define PR_BITS_PER_FLOAT 32 | |
| 292 #define PR_BITS_PER_DOUBLE 64 | |
| 293 #define PR_BITS_PER_WORD 64 | |
| 294 | |
| 295 #define PR_BITS_PER_BYTE_LOG2 3 | |
| 296 #define PR_BITS_PER_SHORT_LOG2 4 | |
| 297 #define PR_BITS_PER_INT_LOG2 5 | |
| 298 #define PR_BITS_PER_INT64_LOG2 6 | |
| 299 #define PR_BITS_PER_LONG_LOG2 6 | |
| 300 #define PR_BITS_PER_FLOAT_LOG2 5 | |
| 301 #define PR_BITS_PER_DOUBLE_LOG2 6 | |
| 302 #define PR_BITS_PER_WORD_LOG2 6 | |
| 303 | |
| 304 #define PR_ALIGN_OF_SHORT 2 | |
| 305 #define PR_ALIGN_OF_INT 4 | |
| 306 #define PR_ALIGN_OF_LONG 8 | |
| 307 #define PR_ALIGN_OF_INT64 8 | |
| 308 #define PR_ALIGN_OF_FLOAT 4 | |
| 309 #define PR_ALIGN_OF_DOUBLE 8 | |
| 310 #define PR_ALIGN_OF_POINTER 8 | |
| 311 #define PR_ALIGN_OF_WORD 8 | |
| 312 | |
| 313 #define PR_BYTES_PER_WORD_LOG2 3 | |
| 314 #define PR_BYTES_PER_DWORD_LOG2 3 | |
| 315 | |
| 316 #endif | |
| 317 | |
| 318 #elif defined(__mc68000__) | |
| 319 | |
| 320 #undef IS_LITTLE_ENDIAN | |
| 321 #define IS_BIG_ENDIAN 1 | |
| 322 | |
| 323 #define PR_BYTES_PER_BYTE 1 | |
| 324 #define PR_BYTES_PER_SHORT 2 | |
| 325 #define PR_BYTES_PER_INT 4 | |
| 326 #define PR_BYTES_PER_INT64 8 | |
| 327 #define PR_BYTES_PER_LONG 4 | |
| 328 #define PR_BYTES_PER_FLOAT 4 | |
| 329 #define PR_BYTES_PER_DOUBLE 8 | |
| 330 #define PR_BYTES_PER_WORD 4 | |
| 331 #define PR_BYTES_PER_DWORD 8 | |
| 332 | |
| 333 #define PR_BITS_PER_BYTE 8 | |
| 334 #define PR_BITS_PER_SHORT 16 | |
| 335 #define PR_BITS_PER_INT 32 | |
| 336 #define PR_BITS_PER_INT64 64 | |
| 337 #define PR_BITS_PER_LONG 32 | |
| 338 #define PR_BITS_PER_FLOAT 32 | |
| 339 #define PR_BITS_PER_DOUBLE 64 | |
| 340 #define PR_BITS_PER_WORD 32 | |
| 341 | |
| 342 #define PR_BITS_PER_BYTE_LOG2 3 | |
| 343 #define PR_BITS_PER_SHORT_LOG2 4 | |
| 344 #define PR_BITS_PER_INT_LOG2 5 | |
| 345 #define PR_BITS_PER_INT64_LOG2 6 | |
| 346 #define PR_BITS_PER_LONG_LOG2 5 | |
| 347 #define PR_BITS_PER_FLOAT_LOG2 5 | |
| 348 #define PR_BITS_PER_DOUBLE_LOG2 6 | |
| 349 #define PR_BITS_PER_WORD_LOG2 5 | |
| 350 | |
| 351 #define PR_ALIGN_OF_SHORT 2 | |
| 352 #define PR_ALIGN_OF_INT 2 | |
| 353 #define PR_ALIGN_OF_LONG 2 | |
| 354 #define PR_ALIGN_OF_INT64 2 | |
| 355 #define PR_ALIGN_OF_FLOAT 2 | |
| 356 #define PR_ALIGN_OF_DOUBLE 2 | |
| 357 #define PR_ALIGN_OF_POINTER 2 | |
| 358 #define PR_ALIGN_OF_WORD 2 | |
| 359 | |
| 360 #define PR_BYTES_PER_WORD_LOG2 2 | |
| 361 #define PR_BYTES_PER_DWORD_LOG2 3 | |
| 362 | |
| 363 #elif defined(__sparc__) && defined (__arch64__) | |
| 364 | |
| 365 #undef IS_LITTLE_ENDIAN | |
| 366 #define IS_BIG_ENDIAN 1 | |
| 367 #define IS_64 | |
| 368 | |
| 369 #define PR_BYTES_PER_BYTE 1 | |
| 370 #define PR_BYTES_PER_SHORT 2 | |
| 371 #define PR_BYTES_PER_INT 4 | |
| 372 #define PR_BYTES_PER_INT64 8 | |
| 373 #define PR_BYTES_PER_LONG 8 | |
| 374 #define PR_BYTES_PER_FLOAT 4 | |
| 375 #define PR_BYTES_PER_DOUBLE 8 | |
| 376 #define PR_BYTES_PER_WORD 8 | |
| 377 #define PR_BYTES_PER_DWORD 8 | |
| 378 | |
| 379 #define PR_BITS_PER_BYTE 8 | |
| 380 #define PR_BITS_PER_SHORT 16 | |
| 381 #define PR_BITS_PER_INT 32 | |
| 382 #define PR_BITS_PER_INT64 64 | |
| 383 #define PR_BITS_PER_LONG 64 | |
| 384 #define PR_BITS_PER_FLOAT 32 | |
| 385 #define PR_BITS_PER_DOUBLE 64 | |
| 386 #define PR_BITS_PER_WORD 64 | |
| 387 | |
| 388 #define PR_BITS_PER_BYTE_LOG2 3 | |
| 389 #define PR_BITS_PER_SHORT_LOG2 4 | |
| 390 #define PR_BITS_PER_INT_LOG2 5 | |
| 391 #define PR_BITS_PER_INT64_LOG2 6 | |
| 392 #define PR_BITS_PER_LONG_LOG2 6 | |
| 393 #define PR_BITS_PER_FLOAT_LOG2 5 | |
| 394 #define PR_BITS_PER_DOUBLE_LOG2 6 | |
| 395 #define PR_BITS_PER_WORD_LOG2 6 | |
| 396 | |
| 397 #define PR_ALIGN_OF_SHORT 2 | |
| 398 #define PR_ALIGN_OF_INT 4 | |
| 399 #define PR_ALIGN_OF_INT64 8 | |
| 400 #define PR_ALIGN_OF_LONG 8 | |
| 401 #define PR_ALIGN_OF_FLOAT 4 | |
| 402 #define PR_ALIGN_OF_DOUBLE 8 | |
| 403 #define PR_ALIGN_OF_POINTER 8 | |
| 404 #define PR_ALIGN_OF_WORD 8 | |
| 405 | |
| 406 #define PR_BYTES_PER_WORD_LOG2 3 | |
| 407 #define PR_BYTES_PER_DWORD_LOG2 3 | |
| 408 | |
| 409 #elif defined(__sparc__) | |
| 410 | |
| 411 #undef IS_LITTLE_ENDIAN | |
| 412 #define IS_BIG_ENDIAN 1 | |
| 413 | |
| 414 #define PR_BYTES_PER_BYTE 1 | |
| 415 #define PR_BYTES_PER_SHORT 2 | |
| 416 #define PR_BYTES_PER_INT 4 | |
| 417 #define PR_BYTES_PER_INT64 8 | |
| 418 #define PR_BYTES_PER_LONG 4 | |
| 419 #define PR_BYTES_PER_FLOAT 4 | |
| 420 #define PR_BYTES_PER_DOUBLE 8 | |
| 421 #define PR_BYTES_PER_WORD 4 | |
| 422 #define PR_BYTES_PER_DWORD 8 | |
| 423 | |
| 424 #define PR_BITS_PER_BYTE 8 | |
| 425 #define PR_BITS_PER_SHORT 16 | |
| 426 #define PR_BITS_PER_INT 32 | |
| 427 #define PR_BITS_PER_INT64 64 | |
| 428 #define PR_BITS_PER_LONG 32 | |
| 429 #define PR_BITS_PER_FLOAT 32 | |
| 430 #define PR_BITS_PER_DOUBLE 64 | |
| 431 #define PR_BITS_PER_WORD 32 | |
| 432 | |
| 433 #define PR_BITS_PER_BYTE_LOG2 3 | |
| 434 #define PR_BITS_PER_SHORT_LOG2 4 | |
| 435 #define PR_BITS_PER_INT_LOG2 5 | |
| 436 #define PR_BITS_PER_INT64_LOG2 6 | |
| 437 #define PR_BITS_PER_LONG_LOG2 5 | |
| 438 #define PR_BITS_PER_FLOAT_LOG2 5 | |
| 439 #define PR_BITS_PER_DOUBLE_LOG2 6 | |
| 440 #define PR_BITS_PER_WORD_LOG2 5 | |
| 441 | |
| 442 #define PR_ALIGN_OF_SHORT 2 | |
| 443 #define PR_ALIGN_OF_INT 4 | |
| 444 #define PR_ALIGN_OF_LONG 4 | |
| 445 #define PR_ALIGN_OF_INT64 8 | |
| 446 #define PR_ALIGN_OF_FLOAT 4 | |
| 447 #define PR_ALIGN_OF_DOUBLE 8 | |
| 448 #define PR_ALIGN_OF_POINTER 4 | |
| 449 #define PR_ALIGN_OF_WORD 4 | |
| 450 | |
| 451 #define PR_BYTES_PER_WORD_LOG2 2 | |
| 452 #define PR_BYTES_PER_DWORD_LOG2 3 | |
| 453 | |
| 454 #elif defined(__i386__) | |
| 455 | |
| 456 #define IS_LITTLE_ENDIAN 1 | |
| 457 #undef IS_BIG_ENDIAN | |
| 458 | |
| 459 #define PR_BYTES_PER_BYTE 1 | |
| 460 #define PR_BYTES_PER_SHORT 2 | |
| 461 #define PR_BYTES_PER_INT 4 | |
| 462 #define PR_BYTES_PER_INT64 8 | |
| 463 #define PR_BYTES_PER_LONG 4 | |
| 464 #define PR_BYTES_PER_FLOAT 4 | |
| 465 #define PR_BYTES_PER_DOUBLE 8 | |
| 466 #define PR_BYTES_PER_WORD 4 | |
| 467 #define PR_BYTES_PER_DWORD 8 | |
| 468 | |
| 469 #define PR_BITS_PER_BYTE 8 | |
| 470 #define PR_BITS_PER_SHORT 16 | |
| 471 #define PR_BITS_PER_INT 32 | |
| 472 #define PR_BITS_PER_INT64 64 | |
| 473 #define PR_BITS_PER_LONG 32 | |
| 474 #define PR_BITS_PER_FLOAT 32 | |
| 475 #define PR_BITS_PER_DOUBLE 64 | |
| 476 #define PR_BITS_PER_WORD 32 | |
| 477 | |
| 478 #define PR_BITS_PER_BYTE_LOG2 3 | |
| 479 #define PR_BITS_PER_SHORT_LOG2 4 | |
| 480 #define PR_BITS_PER_INT_LOG2 5 | |
| 481 #define PR_BITS_PER_INT64_LOG2 6 | |
| 482 #define PR_BITS_PER_LONG_LOG2 5 | |
| 483 #define PR_BITS_PER_FLOAT_LOG2 5 | |
| 484 #define PR_BITS_PER_DOUBLE_LOG2 6 | |
| 485 #define PR_BITS_PER_WORD_LOG2 5 | |
| 486 | |
| 487 #define PR_ALIGN_OF_SHORT 2 | |
| 488 #define PR_ALIGN_OF_INT 4 | |
| 489 #define PR_ALIGN_OF_LONG 4 | |
| 490 #define PR_ALIGN_OF_INT64 4 | |
| 491 #define PR_ALIGN_OF_FLOAT 4 | |
| 492 #define PR_ALIGN_OF_DOUBLE 4 | |
| 493 #define PR_ALIGN_OF_POINTER 4 | |
| 494 #define PR_ALIGN_OF_WORD 4 | |
| 495 | |
| 496 #define PR_BYTES_PER_WORD_LOG2 2 | |
| 497 #define PR_BYTES_PER_DWORD_LOG2 3 | |
| 498 | |
| 499 #elif defined(__mips__) | |
| 500 | |
| 501 #ifdef __MIPSEB__ | |
| 502 #define IS_BIG_ENDIAN 1 | |
| 503 #undef IS_LITTLE_ENDIAN | |
| 504 #elif defined(__MIPSEL__) | |
| 505 #define IS_LITTLE_ENDIAN 1 | |
| 506 #undef IS_BIG_ENDIAN | |
| 507 #else | |
| 508 #error "Unknown MIPS endianness." | |
| 509 #endif | |
| 510 | |
| 511 #if _MIPS_SIM == _ABI64 | |
| 512 | |
| 513 #define IS_64 | |
| 514 | |
| 515 #define PR_BYTES_PER_BYTE 1 | |
| 516 #define PR_BYTES_PER_SHORT 2 | |
| 517 #define PR_BYTES_PER_INT 4 | |
| 518 #define PR_BYTES_PER_INT64 8 | |
| 519 #define PR_BYTES_PER_LONG 8 | |
| 520 #define PR_BYTES_PER_FLOAT 4 | |
| 521 #define PR_BYTES_PER_DOUBLE 8 | |
| 522 #define PR_BYTES_PER_WORD 8 | |
| 523 #define PR_BYTES_PER_DWORD 8 | |
| 524 | |
| 525 #define PR_BITS_PER_BYTE 8 | |
| 526 #define PR_BITS_PER_SHORT 16 | |
| 527 #define PR_BITS_PER_INT 32 | |
| 528 #define PR_BITS_PER_INT64 64 | |
| 529 #define PR_BITS_PER_LONG 64 | |
| 530 #define PR_BITS_PER_FLOAT 32 | |
| 531 #define PR_BITS_PER_DOUBLE 64 | |
| 532 #define PR_BITS_PER_WORD 64 | |
| 533 | |
| 534 #define PR_BITS_PER_BYTE_LOG2 3 | |
| 535 #define PR_BITS_PER_SHORT_LOG2 4 | |
| 536 #define PR_BITS_PER_INT_LOG2 5 | |
| 537 #define PR_BITS_PER_INT64_LOG2 6 | |
| 538 #define PR_BITS_PER_LONG_LOG2 6 | |
| 539 #define PR_BITS_PER_FLOAT_LOG2 5 | |
| 540 #define PR_BITS_PER_DOUBLE_LOG2 6 | |
| 541 #define PR_BITS_PER_WORD_LOG2 6 | |
| 542 | |
| 543 #define PR_ALIGN_OF_SHORT 2 | |
| 544 #define PR_ALIGN_OF_INT 4 | |
| 545 #define PR_ALIGN_OF_LONG 8 | |
| 546 #define PR_ALIGN_OF_INT64 8 | |
| 547 #define PR_ALIGN_OF_FLOAT 4 | |
| 548 #define PR_ALIGN_OF_DOUBLE 8 | |
| 549 #define PR_ALIGN_OF_POINTER 8 | |
| 550 #define PR_ALIGN_OF_WORD 8 | |
| 551 | |
| 552 #define PR_BYTES_PER_WORD_LOG2 3 | |
| 553 #define PR_BYTES_PER_DWORD_LOG2 3 | |
| 554 | |
| 555 #else /* _ABI64 */ | |
| 556 | |
| 557 #define PR_BYTES_PER_BYTE 1 | |
| 558 #define PR_BYTES_PER_SHORT 2 | |
| 559 #define PR_BYTES_PER_INT 4 | |
| 560 #define PR_BYTES_PER_INT64 8 | |
| 561 #define PR_BYTES_PER_LONG 4 | |
| 562 #define PR_BYTES_PER_FLOAT 4 | |
| 563 #define PR_BYTES_PER_DOUBLE 8 | |
| 564 #define PR_BYTES_PER_WORD 4 | |
| 565 #define PR_BYTES_PER_DWORD 8 | |
| 566 | |
| 567 #define PR_BITS_PER_BYTE 8 | |
| 568 #define PR_BITS_PER_SHORT 16 | |
| 569 #define PR_BITS_PER_INT 32 | |
| 570 #define PR_BITS_PER_INT64 64 | |
| 571 #define PR_BITS_PER_LONG 32 | |
| 572 #define PR_BITS_PER_FLOAT 32 | |
| 573 #define PR_BITS_PER_DOUBLE 64 | |
| 574 #define PR_BITS_PER_WORD 32 | |
| 575 | |
| 576 #define PR_BITS_PER_BYTE_LOG2 3 | |
| 577 #define PR_BITS_PER_SHORT_LOG2 4 | |
| 578 #define PR_BITS_PER_INT_LOG2 5 | |
| 579 #define PR_BITS_PER_INT64_LOG2 6 | |
| 580 #define PR_BITS_PER_LONG_LOG2 5 | |
| 581 #define PR_BITS_PER_FLOAT_LOG2 5 | |
| 582 #define PR_BITS_PER_DOUBLE_LOG2 6 | |
| 583 #define PR_BITS_PER_WORD_LOG2 5 | |
| 584 | |
| 585 #define PR_ALIGN_OF_SHORT 2 | |
| 586 #define PR_ALIGN_OF_INT 4 | |
| 587 #define PR_ALIGN_OF_LONG 4 | |
| 588 #define PR_ALIGN_OF_INT64 8 | |
| 589 #define PR_ALIGN_OF_FLOAT 4 | |
| 590 #define PR_ALIGN_OF_DOUBLE 8 | |
| 591 #define PR_ALIGN_OF_POINTER 4 | |
| 592 #define PR_ALIGN_OF_WORD 4 | |
| 593 | |
| 594 #define PR_BYTES_PER_WORD_LOG2 2 | |
| 595 #define PR_BYTES_PER_DWORD_LOG2 3 | |
| 596 | |
| 597 #endif /* _ABI64 */ | |
| 598 | |
| 599 #elif defined(__arm__) | |
| 600 | |
| 601 #ifdef __ARMEB__ | |
| 602 #undef IS_LITTLE_ENDIAN | |
| 603 #define IS_BIG_ENDIAN 1 | |
| 604 #elif defined(__ARMEL__) | |
| 605 #define IS_LITTLE_ENDIAN 1 | |
| 606 #undef IS_BIG_ENDIAN | |
| 607 #else | |
| 608 #error "Unknown ARM endianness." | |
| 609 #endif | |
| 610 | |
| 611 #define PR_BYTES_PER_BYTE 1 | |
| 612 #define PR_BYTES_PER_SHORT 2 | |
| 613 #define PR_BYTES_PER_INT 4 | |
| 614 #define PR_BYTES_PER_INT64 8 | |
| 615 #define PR_BYTES_PER_LONG 4 | |
| 616 #define PR_BYTES_PER_FLOAT 4 | |
| 617 #define PR_BYTES_PER_DOUBLE 8 | |
| 618 #define PR_BYTES_PER_WORD 4 | |
| 619 #define PR_BYTES_PER_DWORD 8 | |
| 620 | |
| 621 #define PR_BITS_PER_BYTE 8 | |
| 622 #define PR_BITS_PER_SHORT 16 | |
| 623 #define PR_BITS_PER_INT 32 | |
| 624 #define PR_BITS_PER_INT64 64 | |
| 625 #define PR_BITS_PER_LONG 32 | |
| 626 #define PR_BITS_PER_FLOAT 32 | |
| 627 #define PR_BITS_PER_DOUBLE 64 | |
| 628 #define PR_BITS_PER_WORD 32 | |
| 629 | |
| 630 #define PR_BITS_PER_BYTE_LOG2 3 | |
| 631 #define PR_BITS_PER_SHORT_LOG2 4 | |
| 632 #define PR_BITS_PER_INT_LOG2 5 | |
| 633 #define PR_BITS_PER_INT64_LOG2 6 | |
| 634 #define PR_BITS_PER_LONG_LOG2 5 | |
| 635 #define PR_BITS_PER_FLOAT_LOG2 5 | |
| 636 #define PR_BITS_PER_DOUBLE_LOG2 6 | |
| 637 #define PR_BITS_PER_WORD_LOG2 5 | |
| 638 | |
| 639 #define PR_ALIGN_OF_SHORT 2 | |
| 640 #define PR_ALIGN_OF_INT 4 | |
| 641 #define PR_ALIGN_OF_LONG 4 | |
| 642 #define PR_ALIGN_OF_INT64 4 | |
| 643 #define PR_ALIGN_OF_FLOAT 4 | |
| 644 #define PR_ALIGN_OF_DOUBLE 4 | |
| 645 #define PR_ALIGN_OF_POINTER 4 | |
| 646 #define PR_ALIGN_OF_WORD 4 | |
| 647 | |
| 648 #define PR_BYTES_PER_WORD_LOG2 2 | |
| 649 #define PR_BYTES_PER_DWORD_LOG2 3 | |
| 650 | |
| 651 #elif defined(__aarch64__) | |
| 652 | |
| 653 #ifdef __AARCH64EB__ | |
| 654 #undef IS_LITTLE_ENDIAN | |
| 655 #define IS_BIG_ENDIAN 1 | |
| 656 #elif defined(__AARCH64EL__) | |
| 657 #define IS_LITTLE_ENDIAN 1 | |
| 658 #undef IS_BIG_ENDIAN | |
| 659 #else | |
| 660 #error "Unknown Aarch64 endianness." | |
| 661 #endif | |
| 662 #define IS_64 | |
| 663 | |
| 664 #define PR_BYTES_PER_BYTE 1 | |
| 665 #define PR_BYTES_PER_SHORT 2 | |
| 666 #define PR_BYTES_PER_INT 4 | |
| 667 #define PR_BYTES_PER_INT64 8 | |
| 668 #define PR_BYTES_PER_LONG 8 | |
| 669 #define PR_BYTES_PER_FLOAT 4 | |
| 670 #define PR_BYTES_PER_DOUBLE 8 | |
| 671 #define PR_BYTES_PER_WORD 8 | |
| 672 #define PR_BYTES_PER_DWORD 8 | |
| 673 | |
| 674 #define PR_BITS_PER_BYTE 8 | |
| 675 #define PR_BITS_PER_SHORT 16 | |
| 676 #define PR_BITS_PER_INT 32 | |
| 677 #define PR_BITS_PER_INT64 64 | |
| 678 #define PR_BITS_PER_LONG 64 | |
| 679 #define PR_BITS_PER_FLOAT 32 | |
| 680 #define PR_BITS_PER_DOUBLE 64 | |
| 681 #define PR_BITS_PER_WORD 64 | |
| 682 | |
| 683 #define PR_BITS_PER_BYTE_LOG2 3 | |
| 684 #define PR_BITS_PER_SHORT_LOG2 4 | |
| 685 #define PR_BITS_PER_INT_LOG2 5 | |
| 686 #define PR_BITS_PER_INT64_LOG2 6 | |
| 687 #define PR_BITS_PER_LONG_LOG2 6 | |
| 688 #define PR_BITS_PER_FLOAT_LOG2 5 | |
| 689 #define PR_BITS_PER_DOUBLE_LOG2 6 | |
| 690 #define PR_BITS_PER_WORD_LOG2 6 | |
| 691 | |
| 692 #define PR_ALIGN_OF_SHORT 2 | |
| 693 #define PR_ALIGN_OF_INT 4 | |
| 694 #define PR_ALIGN_OF_LONG 8 | |
| 695 #define PR_ALIGN_OF_INT64 8 | |
| 696 #define PR_ALIGN_OF_FLOAT 4 | |
| 697 #define PR_ALIGN_OF_DOUBLE 8 | |
| 698 #define PR_ALIGN_OF_POINTER 8 | |
| 699 #define PR_ALIGN_OF_WORD 8 | |
| 700 | |
| 701 #define PR_BYTES_PER_WORD_LOG2 3 | |
| 702 #define PR_BYTES_PER_DWORD_LOG2 3 | |
| 703 | |
| 704 #elif defined(__hppa__) | |
| 705 | |
| 706 #undef IS_LITTLE_ENDIAN | |
| 707 #define IS_BIG_ENDIAN 1 | |
| 708 | |
| 709 #define PR_BYTES_PER_BYTE 1 | |
| 710 #define PR_BYTES_PER_SHORT 2 | |
| 711 #define PR_BYTES_PER_INT 4 | |
| 712 #define PR_BYTES_PER_INT64 8 | |
| 713 #define PR_BYTES_PER_LONG 4 | |
| 714 #define PR_BYTES_PER_FLOAT 4 | |
| 715 #define PR_BYTES_PER_DOUBLE 8 | |
| 716 #define PR_BYTES_PER_WORD 4 | |
| 717 #define PR_BYTES_PER_DWORD 8 | |
| 718 | |
| 719 #define PR_BITS_PER_BYTE 8 | |
| 720 #define PR_BITS_PER_SHORT 16 | |
| 721 #define PR_BITS_PER_INT 32 | |
| 722 #define PR_BITS_PER_INT64 64 | |
| 723 #define PR_BITS_PER_LONG 32 | |
| 724 #define PR_BITS_PER_FLOAT 32 | |
| 725 #define PR_BITS_PER_DOUBLE 64 | |
| 726 #define PR_BITS_PER_WORD 32 | |
| 727 | |
| 728 #define PR_BITS_PER_BYTE_LOG2 3 | |
| 729 #define PR_BITS_PER_SHORT_LOG2 4 | |
| 730 #define PR_BITS_PER_INT_LOG2 5 | |
| 731 #define PR_BITS_PER_INT64_LOG2 6 | |
| 732 #define PR_BITS_PER_LONG_LOG2 5 | |
| 733 #define PR_BITS_PER_FLOAT_LOG2 5 | |
| 734 #define PR_BITS_PER_DOUBLE_LOG2 6 | |
| 735 #define PR_BITS_PER_WORD_LOG2 5 | |
| 736 | |
| 737 #define PR_ALIGN_OF_SHORT 2 | |
| 738 #define PR_ALIGN_OF_INT 4 | |
| 739 #define PR_ALIGN_OF_LONG 4 | |
| 740 #define PR_ALIGN_OF_INT64 8 | |
| 741 #define PR_ALIGN_OF_FLOAT 4 | |
| 742 #define PR_ALIGN_OF_DOUBLE 8 | |
| 743 #define PR_ALIGN_OF_POINTER 4 | |
| 744 #define PR_ALIGN_OF_WORD 4 | |
| 745 | |
| 746 #define PR_BYTES_PER_WORD_LOG2 2 | |
| 747 #define PR_BYTES_PER_DWORD_LOG2 3 | |
| 748 | |
| 749 #elif defined(__s390x__) | |
| 750 | |
| 751 #define IS_BIG_ENDIAN 1 | |
| 752 #undef IS_LITTLE_ENDIAN | |
| 753 #define IS_64 | |
| 754 | |
| 755 #define PR_BYTES_PER_BYTE 1 | |
| 756 #define PR_BYTES_PER_SHORT 2 | |
| 757 #define PR_BYTES_PER_INT 4 | |
| 758 #define PR_BYTES_PER_INT64 8 | |
| 759 #define PR_BYTES_PER_LONG 8 | |
| 760 #define PR_BYTES_PER_FLOAT 4 | |
| 761 #define PR_BYTES_PER_DOUBLE 8 | |
| 762 #define PR_BYTES_PER_WORD 8 | |
| 763 #define PR_BYTES_PER_DWORD 8 | |
| 764 | |
| 765 #define PR_BITS_PER_BYTE 8 | |
| 766 #define PR_BITS_PER_SHORT 16 | |
| 767 #define PR_BITS_PER_INT 32 | |
| 768 #define PR_BITS_PER_INT64 64 | |
| 769 #define PR_BITS_PER_LONG 64 | |
| 770 #define PR_BITS_PER_FLOAT 32 | |
| 771 #define PR_BITS_PER_DOUBLE 64 | |
| 772 #define PR_BITS_PER_WORD 64 | |
| 773 | |
| 774 #define PR_BITS_PER_BYTE_LOG2 3 | |
| 775 #define PR_BITS_PER_SHORT_LOG2 4 | |
| 776 #define PR_BITS_PER_INT_LOG2 5 | |
| 777 #define PR_BITS_PER_INT64_LOG2 6 | |
| 778 #define PR_BITS_PER_LONG_LOG2 6 | |
| 779 #define PR_BITS_PER_FLOAT_LOG2 5 | |
| 780 #define PR_BITS_PER_DOUBLE_LOG2 6 | |
| 781 #define PR_BITS_PER_WORD_LOG2 6 | |
| 782 | |
| 783 #define PR_ALIGN_OF_SHORT 2 | |
| 784 #define PR_ALIGN_OF_INT 4 | |
| 785 #define PR_ALIGN_OF_LONG 8 | |
| 786 #define PR_ALIGN_OF_INT64 8 | |
| 787 #define PR_ALIGN_OF_FLOAT 4 | |
| 788 #define PR_ALIGN_OF_DOUBLE 8 | |
| 789 #define PR_ALIGN_OF_POINTER 8 | |
| 790 #define PR_ALIGN_OF_WORD 8 | |
| 791 | |
| 792 #define PR_BYTES_PER_WORD_LOG2 3 | |
| 793 #define PR_BYTES_PER_DWORD_LOG2 3 | |
| 794 | |
| 795 #elif defined(__s390__) | |
| 796 | |
| 797 #define IS_BIG_ENDIAN 1 | |
| 798 #undef IS_LITTLE_ENDIAN | |
| 799 | |
| 800 #define PR_BYTES_PER_BYTE 1 | |
| 801 #define PR_BYTES_PER_SHORT 2 | |
| 802 #define PR_BYTES_PER_INT 4 | |
| 803 #define PR_BYTES_PER_INT64 8 | |
| 804 #define PR_BYTES_PER_LONG 4 | |
| 805 #define PR_BYTES_PER_FLOAT 4 | |
| 806 #define PR_BYTES_PER_DOUBLE 8 | |
| 807 #define PR_BYTES_PER_WORD 4 | |
| 808 #define PR_BYTES_PER_DWORD 8 | |
| 809 | |
| 810 #define PR_BITS_PER_BYTE 8 | |
| 811 #define PR_BITS_PER_SHORT 16 | |
| 812 #define PR_BITS_PER_INT 32 | |
| 813 #define PR_BITS_PER_INT64 64 | |
| 814 #define PR_BITS_PER_LONG 32 | |
| 815 #define PR_BITS_PER_FLOAT 32 | |
| 816 #define PR_BITS_PER_DOUBLE 64 | |
| 817 #define PR_BITS_PER_WORD 32 | |
| 818 | |
| 819 #define PR_BITS_PER_BYTE_LOG2 3 | |
| 820 #define PR_BITS_PER_SHORT_LOG2 4 | |
| 821 #define PR_BITS_PER_INT_LOG2 5 | |
| 822 #define PR_BITS_PER_INT64_LOG2 6 | |
| 823 #define PR_BITS_PER_LONG_LOG2 5 | |
| 824 #define PR_BITS_PER_FLOAT_LOG2 5 | |
| 825 #define PR_BITS_PER_DOUBLE_LOG2 6 | |
| 826 #define PR_BITS_PER_WORD_LOG2 5 | |
| 827 | |
| 828 #define PR_ALIGN_OF_SHORT 2 | |
| 829 #define PR_ALIGN_OF_INT 4 | |
| 830 #define PR_ALIGN_OF_LONG 4 | |
| 831 #define PR_ALIGN_OF_INT64 4 | |
| 832 #define PR_ALIGN_OF_FLOAT 4 | |
| 833 #define PR_ALIGN_OF_DOUBLE 4 | |
| 834 #define PR_ALIGN_OF_POINTER 4 | |
| 835 #define PR_ALIGN_OF_WORD 4 | |
| 836 | |
| 837 #define PR_BYTES_PER_WORD_LOG2 2 | |
| 838 #define PR_BYTES_PER_DWORD_LOG2 3 | |
| 839 | |
| 840 #elif defined(__sh__) | |
| 841 | |
| 842 #define IS_LITTLE_ENDIAN 1 | |
| 843 #undef IS_BIG_ENDIAN | |
| 844 | |
| 845 #define PR_BYTES_PER_BYTE 1 | |
| 846 #define PR_BYTES_PER_SHORT 2 | |
| 847 #define PR_BYTES_PER_INT 4 | |
| 848 #define PR_BYTES_PER_INT64 8 | |
| 849 #define PR_BYTES_PER_LONG 4 | |
| 850 #define PR_BYTES_PER_FLOAT 4 | |
| 851 #define PR_BYTES_PER_DOUBLE 8 | |
| 852 #define PR_BYTES_PER_WORD 4 | |
| 853 #define PR_BYTES_PER_DWORD 8 | |
| 854 | |
| 855 #define PR_BITS_PER_BYTE 8 | |
| 856 #define PR_BITS_PER_SHORT 16 | |
| 857 #define PR_BITS_PER_INT 32 | |
| 858 #define PR_BITS_PER_INT64 64 | |
| 859 #define PR_BITS_PER_LONG 32 | |
| 860 #define PR_BITS_PER_FLOAT 32 | |
| 861 #define PR_BITS_PER_DOUBLE 64 | |
| 862 #define PR_BITS_PER_WORD 32 | |
| 863 | |
| 864 #define PR_BITS_PER_BYTE_LOG2 3 | |
| 865 #define PR_BITS_PER_SHORT_LOG2 4 | |
| 866 #define PR_BITS_PER_INT_LOG2 5 | |
| 867 #define PR_BITS_PER_INT64_LOG2 6 | |
| 868 #define PR_BITS_PER_LONG_LOG2 5 | |
| 869 #define PR_BITS_PER_FLOAT_LOG2 5 | |
| 870 #define PR_BITS_PER_DOUBLE_LOG2 6 | |
| 871 #define PR_BITS_PER_WORD_LOG2 5 | |
| 872 | |
| 873 #define PR_ALIGN_OF_SHORT 2 | |
| 874 #define PR_ALIGN_OF_INT 4 | |
| 875 #define PR_ALIGN_OF_LONG 4 | |
| 876 #define PR_ALIGN_OF_INT64 4 | |
| 877 #define PR_ALIGN_OF_FLOAT 4 | |
| 878 #define PR_ALIGN_OF_DOUBLE 4 | |
| 879 #define PR_ALIGN_OF_POINTER 4 | |
| 880 #define PR_ALIGN_OF_WORD 4 | |
| 881 | |
| 882 #define PR_BYTES_PER_WORD_LOG2 2 | |
| 883 #define PR_BYTES_PER_DWORD_LOG2 3 | |
| 884 | |
| 885 #elif defined(__avr32__) | |
| 886 | |
| 887 #undef IS_LITTLE_ENDIAN | |
| 888 #define IS_BIG_ENDIAN 1 | |
| 889 | |
| 890 #define PR_BYTES_PER_BYTE 1 | |
| 891 #define PR_BYTES_PER_SHORT 2 | |
| 892 #define PR_BYTES_PER_INT 4 | |
| 893 #define PR_BYTES_PER_INT64 8 | |
| 894 #define PR_BYTES_PER_LONG 4 | |
| 895 #define PR_BYTES_PER_FLOAT 4 | |
| 896 #define PR_BYTES_PER_DOUBLE 8 | |
| 897 #define PR_BYTES_PER_WORD 4 | |
| 898 #define PR_BYTES_PER_DWORD 8 | |
| 899 | |
| 900 #define PR_BITS_PER_BYTE 8 | |
| 901 #define PR_BITS_PER_SHORT 16 | |
| 902 #define PR_BITS_PER_INT 32 | |
| 903 #define PR_BITS_PER_INT64 64 | |
| 904 #define PR_BITS_PER_LONG 32 | |
| 905 #define PR_BITS_PER_FLOAT 32 | |
| 906 #define PR_BITS_PER_DOUBLE 64 | |
| 907 #define PR_BITS_PER_WORD 32 | |
| 908 | |
| 909 #define PR_BITS_PER_BYTE_LOG2 3 | |
| 910 #define PR_BITS_PER_SHORT_LOG2 4 | |
| 911 #define PR_BITS_PER_INT_LOG2 5 | |
| 912 #define PR_BITS_PER_INT64_LOG2 6 | |
| 913 #define PR_BITS_PER_LONG_LOG2 5 | |
| 914 #define PR_BITS_PER_FLOAT_LOG2 5 | |
| 915 #define PR_BITS_PER_DOUBLE_LOG2 6 | |
| 916 #define PR_BITS_PER_WORD_LOG2 5 | |
| 917 | |
| 918 #define PR_ALIGN_OF_SHORT 2 | |
| 919 #define PR_ALIGN_OF_INT 4 | |
| 920 #define PR_ALIGN_OF_LONG 4 | |
| 921 #define PR_ALIGN_OF_INT64 4 | |
| 922 #define PR_ALIGN_OF_FLOAT 4 | |
| 923 #define PR_ALIGN_OF_DOUBLE 4 | |
| 924 #define PR_ALIGN_OF_POINTER 4 | |
| 925 #define PR_ALIGN_OF_WORD 4 | |
| 926 | |
| 927 #define PR_BYTES_PER_WORD_LOG2 2 | |
| 928 #define PR_BYTES_PER_DWORD_LOG2 3 | |
| 929 | |
| 930 #elif defined(__m32r__) | |
| 931 | |
| 932 #undef IS_LITTLE_ENDIAN | |
| 933 #define IS_BIG_ENDIAN 1 | |
| 934 | |
| 935 #define PR_BYTES_PER_BYTE 1 | |
| 936 #define PR_BYTES_PER_SHORT 2 | |
| 937 #define PR_BYTES_PER_INT 4 | |
| 938 #define PR_BYTES_PER_INT64 8 | |
| 939 #define PR_BYTES_PER_LONG 4 | |
| 940 #define PR_BYTES_PER_FLOAT 4 | |
| 941 #define PR_BYTES_PER_DOUBLE 8 | |
| 942 #define PR_BYTES_PER_WORD 4 | |
| 943 #define PR_BYTES_PER_DWORD 8 | |
| 944 | |
| 945 #define PR_BITS_PER_BYTE 8 | |
| 946 #define PR_BITS_PER_SHORT 16 | |
| 947 #define PR_BITS_PER_INT 32 | |
| 948 #define PR_BITS_PER_INT64 64 | |
| 949 #define PR_BITS_PER_LONG 32 | |
| 950 #define PR_BITS_PER_FLOAT 32 | |
| 951 #define PR_BITS_PER_DOUBLE 64 | |
| 952 #define PR_BITS_PER_WORD 32 | |
| 953 | |
| 954 #define PR_BITS_PER_BYTE_LOG2 3 | |
| 955 #define PR_BITS_PER_SHORT_LOG2 4 | |
| 956 #define PR_BITS_PER_INT_LOG2 5 | |
| 957 #define PR_BITS_PER_INT64_LOG2 6 | |
| 958 #define PR_BITS_PER_LONG_LOG2 5 | |
| 959 #define PR_BITS_PER_FLOAT_LOG2 5 | |
| 960 #define PR_BITS_PER_DOUBLE_LOG2 6 | |
| 961 #define PR_BITS_PER_WORD_LOG2 5 | |
| 962 | |
| 963 #define PR_ALIGN_OF_SHORT 2 | |
| 964 #define PR_ALIGN_OF_INT 4 | |
| 965 #define PR_ALIGN_OF_LONG 4 | |
| 966 #define PR_ALIGN_OF_INT64 4 | |
| 967 #define PR_ALIGN_OF_FLOAT 4 | |
| 968 #define PR_ALIGN_OF_DOUBLE 4 | |
| 969 #define PR_ALIGN_OF_POINTER 4 | |
| 970 #define PR_ALIGN_OF_WORD 4 | |
| 971 | |
| 972 #define PR_BYTES_PER_WORD_LOG2 2 | |
| 973 #define PR_BYTES_PER_DWORD_LOG2 3 | |
| 974 | |
| 975 #elif defined(__or1k__) | |
| 976 | |
| 977 #undef IS_LITTLE_ENDIAN | |
| 978 #define IS_BIG_ENDIAN 1 | |
| 979 | |
| 980 #define PR_BYTES_PER_BYTE 1 | |
| 981 #define PR_BYTES_PER_SHORT 2 | |
| 982 #define PR_BYTES_PER_INT 4 | |
| 983 #define PR_BYTES_PER_INT64 8 | |
| 984 #define PR_BYTES_PER_LONG 4 | |
| 985 #define PR_BYTES_PER_FLOAT 4 | |
| 986 #define PR_BYTES_PER_DOUBLE 8 | |
| 987 #define PR_BYTES_PER_WORD 4 | |
| 988 #define PR_BYTES_PER_DWORD 8 | |
| 989 | |
| 990 #define PR_BITS_PER_BYTE 8 | |
| 991 #define PR_BITS_PER_SHORT 16 | |
| 992 #define PR_BITS_PER_INT 32 | |
| 993 #define PR_BITS_PER_INT64 64 | |
| 994 #define PR_BITS_PER_LONG 32 | |
| 995 #define PR_BITS_PER_FLOAT 32 | |
| 996 #define PR_BITS_PER_DOUBLE 64 | |
| 997 #define PR_BITS_PER_WORD 32 | |
| 998 | |
| 999 #define PR_BITS_PER_BYTE_LOG2 3 | |
| 1000 #define PR_BITS_PER_SHORT_LOG2 4 | |
| 1001 #define PR_BITS_PER_INT_LOG2 5 | |
| 1002 #define PR_BITS_PER_INT64_LOG2 6 | |
| 1003 #define PR_BITS_PER_LONG_LOG2 5 | |
| 1004 #define PR_BITS_PER_FLOAT_LOG2 5 | |
| 1005 #define PR_BITS_PER_DOUBLE_LOG2 6 | |
| 1006 #define PR_BITS_PER_WORD_LOG2 5 | |
| 1007 | |
| 1008 #define PR_ALIGN_OF_SHORT 2 | |
| 1009 #define PR_ALIGN_OF_INT 4 | |
| 1010 #define PR_ALIGN_OF_LONG 4 | |
| 1011 #define PR_ALIGN_OF_INT64 4 | |
| 1012 #define PR_ALIGN_OF_FLOAT 4 | |
| 1013 #define PR_ALIGN_OF_DOUBLE 4 | |
| 1014 #define PR_ALIGN_OF_POINTER 4 | |
| 1015 #define PR_ALIGN_OF_WORD 4 | |
| 1016 | |
| 1017 #define PR_BYTES_PER_WORD_LOG2 2 | |
| 1018 #define PR_BYTES_PER_DWORD_LOG2 3 | |
| 1019 | |
| 1020 #else | |
| 1021 | |
| 1022 #error "Unknown CPU architecture" | |
| 1023 | |
| 1024 #endif | |
| 1025 | |
| 1026 #ifndef HAVE_LONG_LONG | |
| 1027 #define HAVE_LONG_LONG | |
| 1028 #endif | |
| 1029 #if PR_ALIGN_OF_DOUBLE == 8 | |
| 1030 #define HAVE_ALIGNED_DOUBLES | |
| 1031 #endif | |
| 1032 #if PR_ALIGN_OF_INT64 == 8 | |
| 1033 #define HAVE_ALIGNED_LONGLONGS | |
| 1034 #endif | |
| 1035 | |
| 1036 #ifndef NO_NSPR_10_SUPPORT | |
| 1037 | |
| 1038 #define BYTES_PER_BYTE PR_BYTES_PER_BYTE | |
| 1039 #define BYTES_PER_SHORT PR_BYTES_PER_SHORT | |
| 1040 #define BYTES_PER_INT PR_BYTES_PER_INT | |
| 1041 #define BYTES_PER_INT64 PR_BYTES_PER_INT64 | |
| 1042 #define BYTES_PER_LONG PR_BYTES_PER_LONG | |
| 1043 #define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT | |
| 1044 #define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE | |
| 1045 #define BYTES_PER_WORD PR_BYTES_PER_WORD | |
| 1046 #define BYTES_PER_DWORD PR_BYTES_PER_DWORD | |
| 1047 | |
| 1048 #define BITS_PER_BYTE PR_BITS_PER_BYTE | |
| 1049 #define BITS_PER_SHORT PR_BITS_PER_SHORT | |
| 1050 #define BITS_PER_INT PR_BITS_PER_INT | |
| 1051 #define BITS_PER_INT64 PR_BITS_PER_INT64 | |
| 1052 #define BITS_PER_LONG PR_BITS_PER_LONG | |
| 1053 #define BITS_PER_FLOAT PR_BITS_PER_FLOAT | |
| 1054 #define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE | |
| 1055 #define BITS_PER_WORD PR_BITS_PER_WORD | |
| 1056 | |
| 1057 #define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2 | |
| 1058 #define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2 | |
| 1059 #define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2 | |
| 1060 #define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2 | |
| 1061 #define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2 | |
| 1062 #define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2 | |
| 1063 #define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2 | |
| 1064 #define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2 | |
| 1065 | |
| 1066 #define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT | |
| 1067 #define ALIGN_OF_INT PR_ALIGN_OF_INT | |
| 1068 #define ALIGN_OF_LONG PR_ALIGN_OF_LONG | |
| 1069 #define ALIGN_OF_INT64 PR_ALIGN_OF_INT64 | |
| 1070 #define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT | |
| 1071 #define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE | |
| 1072 #define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER | |
| 1073 #define ALIGN_OF_WORD PR_ALIGN_OF_WORD | |
| 1074 | |
| 1075 #define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2 | |
| 1076 #define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2 | |
| 1077 #define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2 | |
| 1078 | |
| 1079 #endif /* NO_NSPR_10_SUPPORT */ | |
| 1080 | |
| 1081 #endif /* nspr_cpucfg___ */ | |
| OLD | NEW |