1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
15 * The Original Code is the Netscape Portable Runtime (NSPR).
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998-2000
20 * the Initial Developer. All Rights Reserved.
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
38 #ifndef nspr_cpucfg___
39 #define nspr_cpucfg___
49 #define PR_AF_INET6 10 /* same as AF_INET6 */
53 #undef IS_LITTLE_ENDIAN
54 #define IS_BIG_ENDIAN 1
57 #define PR_BYTES_PER_BYTE 1
58 #define PR_BYTES_PER_SHORT 2
59 #define PR_BYTES_PER_INT 4
60 #define PR_BYTES_PER_INT64 8
61 #define PR_BYTES_PER_LONG 8
62 #define PR_BYTES_PER_FLOAT 4
63 #define PR_BYTES_PER_DOUBLE 8
64 #define PR_BYTES_PER_WORD 8
65 #define PR_BYTES_PER_DWORD 8
67 #define PR_BITS_PER_BYTE 8
68 #define PR_BITS_PER_SHORT 16
69 #define PR_BITS_PER_INT 32
70 #define PR_BITS_PER_INT64 64
71 #define PR_BITS_PER_LONG 64
72 #define PR_BITS_PER_FLOAT 32
73 #define PR_BITS_PER_DOUBLE 64
74 #define PR_BITS_PER_WORD 64
76 #define PR_BITS_PER_BYTE_LOG2 3
77 #define PR_BITS_PER_SHORT_LOG2 4
78 #define PR_BITS_PER_INT_LOG2 5
79 #define PR_BITS_PER_INT64_LOG2 6
80 #define PR_BITS_PER_LONG_LOG2 6
81 #define PR_BITS_PER_FLOAT_LOG2 5
82 #define PR_BITS_PER_DOUBLE_LOG2 6
83 #define PR_BITS_PER_WORD_LOG2 6
85 #define PR_ALIGN_OF_SHORT 2
86 #define PR_ALIGN_OF_INT 4
87 #define PR_ALIGN_OF_LONG 8
88 #define PR_ALIGN_OF_INT64 8
89 #define PR_ALIGN_OF_FLOAT 4
90 #define PR_ALIGN_OF_DOUBLE 8
91 #define PR_ALIGN_OF_POINTER 8
92 #define PR_ALIGN_OF_WORD 8
94 #define PR_BYTES_PER_WORD_LOG2 3
95 #define PR_BYTES_PER_DWORD_LOG2 3
97 #elif defined(__powerpc__)
99 #undef IS_LITTLE_ENDIAN
100 #define IS_BIG_ENDIAN 1
102 #define PR_BYTES_PER_BYTE 1
103 #define PR_BYTES_PER_SHORT 2
104 #define PR_BYTES_PER_INT 4
105 #define PR_BYTES_PER_INT64 8
106 #define PR_BYTES_PER_LONG 4
107 #define PR_BYTES_PER_FLOAT 4
108 #define PR_BYTES_PER_DOUBLE 8
109 #define PR_BYTES_PER_WORD 4
110 #define PR_BYTES_PER_DWORD 8
112 #define PR_BITS_PER_BYTE 8
113 #define PR_BITS_PER_SHORT 16
114 #define PR_BITS_PER_INT 32
115 #define PR_BITS_PER_INT64 64
116 #define PR_BITS_PER_LONG 32
117 #define PR_BITS_PER_FLOAT 32
118 #define PR_BITS_PER_DOUBLE 64
119 #define PR_BITS_PER_WORD 32
121 #define PR_BITS_PER_BYTE_LOG2 3
122 #define PR_BITS_PER_SHORT_LOG2 4
123 #define PR_BITS_PER_INT_LOG2 5
124 #define PR_BITS_PER_INT64_LOG2 6
125 #define PR_BITS_PER_LONG_LOG2 5
126 #define PR_BITS_PER_FLOAT_LOG2 5
127 #define PR_BITS_PER_DOUBLE_LOG2 6
128 #define PR_BITS_PER_WORD_LOG2 5
130 #define PR_ALIGN_OF_SHORT 2
131 #define PR_ALIGN_OF_INT 4
132 #define PR_ALIGN_OF_LONG 4
133 #define PR_ALIGN_OF_INT64 8
134 #define PR_ALIGN_OF_FLOAT 4
135 #define PR_ALIGN_OF_DOUBLE 8
136 #define PR_ALIGN_OF_POINTER 4
137 #define PR_ALIGN_OF_WORD 4
139 #define PR_BYTES_PER_WORD_LOG2 2
140 #define PR_BYTES_PER_DWORD_LOG2 3
142 #elif defined(__alpha)
144 #define IS_LITTLE_ENDIAN 1
148 #define PR_BYTES_PER_BYTE 1
149 #define PR_BYTES_PER_SHORT 2
150 #define PR_BYTES_PER_INT 4
151 #define PR_BYTES_PER_INT64 8
152 #define PR_BYTES_PER_LONG 8
153 #define PR_BYTES_PER_FLOAT 4
154 #define PR_BYTES_PER_DOUBLE 8
155 #define PR_BYTES_PER_WORD 8
156 #define PR_BYTES_PER_DWORD 8
158 #define PR_BITS_PER_BYTE 8
159 #define PR_BITS_PER_SHORT 16
160 #define PR_BITS_PER_INT 32
161 #define PR_BITS_PER_INT64 64
162 #define PR_BITS_PER_LONG 64
163 #define PR_BITS_PER_FLOAT 32
164 #define PR_BITS_PER_DOUBLE 64
165 #define PR_BITS_PER_WORD 64
167 #define PR_BITS_PER_BYTE_LOG2 3
168 #define PR_BITS_PER_SHORT_LOG2 4
169 #define PR_BITS_PER_INT_LOG2 5
170 #define PR_BITS_PER_INT64_LOG2 6
171 #define PR_BITS_PER_LONG_LOG2 6
172 #define PR_BITS_PER_FLOAT_LOG2 5
173 #define PR_BITS_PER_DOUBLE_LOG2 6
174 #define PR_BITS_PER_WORD_LOG2 6
176 #define PR_ALIGN_OF_SHORT 2
177 #define PR_ALIGN_OF_INT 4
178 #define PR_ALIGN_OF_LONG 8
179 #define PR_ALIGN_OF_INT64 8
180 #define PR_ALIGN_OF_FLOAT 4
181 #define PR_ALIGN_OF_DOUBLE 8
182 #define PR_ALIGN_OF_POINTER 8
183 #define PR_ALIGN_OF_WORD 8
185 #define PR_BYTES_PER_WORD_LOG2 3
186 #define PR_BYTES_PER_DWORD_LOG2 3
188 #elif defined(__ia64__)
190 #define IS_LITTLE_ENDIAN 1
194 #define PR_BYTES_PER_BYTE 1
195 #define PR_BYTES_PER_SHORT 2
196 #define PR_BYTES_PER_INT 4
197 #define PR_BYTES_PER_INT64 8
198 #define PR_BYTES_PER_LONG 8
199 #define PR_BYTES_PER_FLOAT 4
200 #define PR_BYTES_PER_DOUBLE 8
201 #define PR_BYTES_PER_WORD 8
202 #define PR_BYTES_PER_DWORD 8
204 #define PR_BITS_PER_BYTE 8
205 #define PR_BITS_PER_SHORT 16
206 #define PR_BITS_PER_INT 32
207 #define PR_BITS_PER_INT64 64
208 #define PR_BITS_PER_LONG 64
209 #define PR_BITS_PER_FLOAT 32
210 #define PR_BITS_PER_DOUBLE 64
211 #define PR_BITS_PER_WORD 64
213 #define PR_BITS_PER_BYTE_LOG2 3
214 #define PR_BITS_PER_SHORT_LOG2 4
215 #define PR_BITS_PER_INT_LOG2 5
216 #define PR_BITS_PER_INT64_LOG2 6
217 #define PR_BITS_PER_LONG_LOG2 6
218 #define PR_BITS_PER_FLOAT_LOG2 5
219 #define PR_BITS_PER_DOUBLE_LOG2 6
220 #define PR_BITS_PER_WORD_LOG2 6
222 #define PR_ALIGN_OF_SHORT 2
223 #define PR_ALIGN_OF_INT 4
224 #define PR_ALIGN_OF_LONG 8
225 #define PR_ALIGN_OF_INT64 8
226 #define PR_ALIGN_OF_FLOAT 4
227 #define PR_ALIGN_OF_DOUBLE 8
228 #define PR_ALIGN_OF_POINTER 8
229 #define PR_ALIGN_OF_WORD 8
231 #define PR_BYTES_PER_WORD_LOG2 3
232 #define PR_BYTES_PER_DWORD_LOG2 3
234 #elif defined(__x86_64__)
238 #define IS_LITTLE_ENDIAN 1
241 #define PR_BYTES_PER_BYTE 1
242 #define PR_BYTES_PER_SHORT 2
243 #define PR_BYTES_PER_INT 4
244 #define PR_BYTES_PER_INT64 8
245 #define PR_BYTES_PER_LONG 4
246 #define PR_BYTES_PER_FLOAT 4
247 #define PR_BYTES_PER_DOUBLE 8
248 #define PR_BYTES_PER_WORD 4
249 #define PR_BYTES_PER_DWORD 8
251 #define PR_BITS_PER_BYTE 8
252 #define PR_BITS_PER_SHORT 16
253 #define PR_BITS_PER_INT 32
254 #define PR_BITS_PER_INT64 64
255 #define PR_BITS_PER_LONG 32
256 #define PR_BITS_PER_FLOAT 32
257 #define PR_BITS_PER_DOUBLE 64
258 #define PR_BITS_PER_WORD 32
260 #define PR_BITS_PER_BYTE_LOG2 3
261 #define PR_BITS_PER_SHORT_LOG2 4
262 #define PR_BITS_PER_INT_LOG2 5
263 #define PR_BITS_PER_INT64_LOG2 6
264 #define PR_BITS_PER_LONG_LOG2 5
265 #define PR_BITS_PER_FLOAT_LOG2 5
266 #define PR_BITS_PER_DOUBLE_LOG2 6
267 #define PR_BITS_PER_WORD_LOG2 5
269 #define PR_ALIGN_OF_SHORT 2
270 #define PR_ALIGN_OF_INT 4
271 #define PR_ALIGN_OF_LONG 4
272 #define PR_ALIGN_OF_INT64 4
273 #define PR_ALIGN_OF_FLOAT 4
274 #define PR_ALIGN_OF_DOUBLE 4
275 #define PR_ALIGN_OF_POINTER 4
276 #define PR_ALIGN_OF_WORD 4
278 #define PR_BYTES_PER_WORD_LOG2 2
279 #define PR_BYTES_PER_DWORD_LOG2 3
283 #define IS_LITTLE_ENDIAN 1
287 #define PR_BYTES_PER_BYTE 1
288 #define PR_BYTES_PER_SHORT 2
289 #define PR_BYTES_PER_INT 4
290 #define PR_BYTES_PER_INT64 8
291 #define PR_BYTES_PER_LONG 8
292 #define PR_BYTES_PER_FLOAT 4
293 #define PR_BYTES_PER_DOUBLE 8
294 #define PR_BYTES_PER_WORD 8
295 #define PR_BYTES_PER_DWORD 8
297 #define PR_BITS_PER_BYTE 8
298 #define PR_BITS_PER_SHORT 16
299 #define PR_BITS_PER_INT 32
300 #define PR_BITS_PER_INT64 64
301 #define PR_BITS_PER_LONG 64
302 #define PR_BITS_PER_FLOAT 32
303 #define PR_BITS_PER_DOUBLE 64
304 #define PR_BITS_PER_WORD 64
306 #define PR_BITS_PER_BYTE_LOG2 3
307 #define PR_BITS_PER_SHORT_LOG2 4
308 #define PR_BITS_PER_INT_LOG2 5
309 #define PR_BITS_PER_INT64_LOG2 6
310 #define PR_BITS_PER_LONG_LOG2 6
311 #define PR_BITS_PER_FLOAT_LOG2 5
312 #define PR_BITS_PER_DOUBLE_LOG2 6
313 #define PR_BITS_PER_WORD_LOG2 6
315 #define PR_ALIGN_OF_SHORT 2
316 #define PR_ALIGN_OF_INT 4
317 #define PR_ALIGN_OF_LONG 8
318 #define PR_ALIGN_OF_INT64 8
319 #define PR_ALIGN_OF_FLOAT 4
320 #define PR_ALIGN_OF_DOUBLE 8
321 #define PR_ALIGN_OF_POINTER 8
322 #define PR_ALIGN_OF_WORD 8
324 #define PR_BYTES_PER_WORD_LOG2 3
325 #define PR_BYTES_PER_DWORD_LOG2 3
329 #elif defined(__mc68000__)
331 #undef IS_LITTLE_ENDIAN
332 #define IS_BIG_ENDIAN 1
334 #define PR_BYTES_PER_BYTE 1
335 #define PR_BYTES_PER_SHORT 2
336 #define PR_BYTES_PER_INT 4
337 #define PR_BYTES_PER_INT64 8
338 #define PR_BYTES_PER_LONG 4
339 #define PR_BYTES_PER_FLOAT 4
340 #define PR_BYTES_PER_DOUBLE 8
341 #define PR_BYTES_PER_WORD 4
342 #define PR_BYTES_PER_DWORD 8
344 #define PR_BITS_PER_BYTE 8
345 #define PR_BITS_PER_SHORT 16
346 #define PR_BITS_PER_INT 32
347 #define PR_BITS_PER_INT64 64
348 #define PR_BITS_PER_LONG 32
349 #define PR_BITS_PER_FLOAT 32
350 #define PR_BITS_PER_DOUBLE 64
351 #define PR_BITS_PER_WORD 32
353 #define PR_BITS_PER_BYTE_LOG2 3
354 #define PR_BITS_PER_SHORT_LOG2 4
355 #define PR_BITS_PER_INT_LOG2 5
356 #define PR_BITS_PER_INT64_LOG2 6
357 #define PR_BITS_PER_LONG_LOG2 5
358 #define PR_BITS_PER_FLOAT_LOG2 5
359 #define PR_BITS_PER_DOUBLE_LOG2 6
360 #define PR_BITS_PER_WORD_LOG2 5
362 #define PR_ALIGN_OF_SHORT 2
363 #define PR_ALIGN_OF_INT 2
364 #define PR_ALIGN_OF_LONG 2
365 #define PR_ALIGN_OF_INT64 2
366 #define PR_ALIGN_OF_FLOAT 2
367 #define PR_ALIGN_OF_DOUBLE 2
368 #define PR_ALIGN_OF_POINTER 2
369 #define PR_ALIGN_OF_WORD 2
371 #define PR_BYTES_PER_WORD_LOG2 2
372 #define PR_BYTES_PER_DWORD_LOG2 3
374 #elif defined(__sparc__)
376 #undef IS_LITTLE_ENDIAN
377 #define IS_BIG_ENDIAN 1
379 #define PR_BYTES_PER_BYTE 1
380 #define PR_BYTES_PER_SHORT 2
381 #define PR_BYTES_PER_INT 4
382 #define PR_BYTES_PER_INT64 8
383 #define PR_BYTES_PER_LONG 4
384 #define PR_BYTES_PER_FLOAT 4
385 #define PR_BYTES_PER_DOUBLE 8
386 #define PR_BYTES_PER_WORD 4
387 #define PR_BYTES_PER_DWORD 8
389 #define PR_BITS_PER_BYTE 8
390 #define PR_BITS_PER_SHORT 16
391 #define PR_BITS_PER_INT 32
392 #define PR_BITS_PER_INT64 64
393 #define PR_BITS_PER_LONG 32
394 #define PR_BITS_PER_FLOAT 32
395 #define PR_BITS_PER_DOUBLE 64
396 #define PR_BITS_PER_WORD 32
398 #define PR_BITS_PER_BYTE_LOG2 3
399 #define PR_BITS_PER_SHORT_LOG2 4
400 #define PR_BITS_PER_INT_LOG2 5
401 #define PR_BITS_PER_INT64_LOG2 6
402 #define PR_BITS_PER_LONG_LOG2 5
403 #define PR_BITS_PER_FLOAT_LOG2 5
404 #define PR_BITS_PER_DOUBLE_LOG2 6
405 #define PR_BITS_PER_WORD_LOG2 5
407 #define PR_ALIGN_OF_SHORT 2
408 #define PR_ALIGN_OF_INT 4
409 #define PR_ALIGN_OF_LONG 4
410 #define PR_ALIGN_OF_INT64 8
411 #define PR_ALIGN_OF_FLOAT 4
412 #define PR_ALIGN_OF_DOUBLE 8
413 #define PR_ALIGN_OF_POINTER 4
414 #define PR_ALIGN_OF_WORD 4
416 #define PR_BYTES_PER_WORD_LOG2 2
417 #define PR_BYTES_PER_DWORD_LOG2 3
419 #elif defined(__i386__)
421 #define IS_LITTLE_ENDIAN 1
424 #define PR_BYTES_PER_BYTE 1
425 #define PR_BYTES_PER_SHORT 2
426 #define PR_BYTES_PER_INT 4
427 #define PR_BYTES_PER_INT64 8
428 #define PR_BYTES_PER_LONG 4
429 #define PR_BYTES_PER_FLOAT 4
430 #define PR_BYTES_PER_DOUBLE 8
431 #define PR_BYTES_PER_WORD 4
432 #define PR_BYTES_PER_DWORD 8
434 #define PR_BITS_PER_BYTE 8
435 #define PR_BITS_PER_SHORT 16
436 #define PR_BITS_PER_INT 32
437 #define PR_BITS_PER_INT64 64
438 #define PR_BITS_PER_LONG 32
439 #define PR_BITS_PER_FLOAT 32
440 #define PR_BITS_PER_DOUBLE 64
441 #define PR_BITS_PER_WORD 32
443 #define PR_BITS_PER_BYTE_LOG2 3
444 #define PR_BITS_PER_SHORT_LOG2 4
445 #define PR_BITS_PER_INT_LOG2 5
446 #define PR_BITS_PER_INT64_LOG2 6
447 #define PR_BITS_PER_LONG_LOG2 5
448 #define PR_BITS_PER_FLOAT_LOG2 5
449 #define PR_BITS_PER_DOUBLE_LOG2 6
450 #define PR_BITS_PER_WORD_LOG2 5
452 #define PR_ALIGN_OF_SHORT 2
453 #define PR_ALIGN_OF_INT 4
454 #define PR_ALIGN_OF_LONG 4
455 #define PR_ALIGN_OF_INT64 4
456 #define PR_ALIGN_OF_FLOAT 4
457 #define PR_ALIGN_OF_DOUBLE 4
458 #define PR_ALIGN_OF_POINTER 4
459 #define PR_ALIGN_OF_WORD 4
461 #define PR_BYTES_PER_WORD_LOG2 2
462 #define PR_BYTES_PER_DWORD_LOG2 3
464 #elif defined(__mips__)
467 #define IS_BIG_ENDIAN 1
468 #undef IS_LITTLE_ENDIAN
469 #elif defined(__MIPSEL__)
470 #define IS_LITTLE_ENDIAN 1
473 #error "Unknown MIPS endianness."
476 #define PR_BYTES_PER_BYTE 1
477 #define PR_BYTES_PER_SHORT 2
478 #define PR_BYTES_PER_INT 4
479 #define PR_BYTES_PER_INT64 8
480 #define PR_BYTES_PER_LONG 4
481 #define PR_BYTES_PER_FLOAT 4
482 #define PR_BYTES_PER_DOUBLE 8
483 #define PR_BYTES_PER_WORD 4
484 #define PR_BYTES_PER_DWORD 8
486 #define PR_BITS_PER_BYTE 8
487 #define PR_BITS_PER_SHORT 16
488 #define PR_BITS_PER_INT 32
489 #define PR_BITS_PER_INT64 64
490 #define PR_BITS_PER_LONG 32
491 #define PR_BITS_PER_FLOAT 32
492 #define PR_BITS_PER_DOUBLE 64
493 #define PR_BITS_PER_WORD 32
495 #define PR_BITS_PER_BYTE_LOG2 3
496 #define PR_BITS_PER_SHORT_LOG2 4
497 #define PR_BITS_PER_INT_LOG2 5
498 #define PR_BITS_PER_INT64_LOG2 6
499 #define PR_BITS_PER_LONG_LOG2 5
500 #define PR_BITS_PER_FLOAT_LOG2 5
501 #define PR_BITS_PER_DOUBLE_LOG2 6
502 #define PR_BITS_PER_WORD_LOG2 5
504 #define PR_ALIGN_OF_SHORT 2
505 #define PR_ALIGN_OF_INT 4
506 #define PR_ALIGN_OF_LONG 4
507 #define PR_ALIGN_OF_INT64 8
508 #define PR_ALIGN_OF_FLOAT 4
509 #define PR_ALIGN_OF_DOUBLE 8
510 #define PR_ALIGN_OF_POINTER 4
511 #define PR_ALIGN_OF_WORD 4
513 #define PR_BYTES_PER_WORD_LOG2 2
514 #define PR_BYTES_PER_DWORD_LOG2 3
516 #elif defined(__arm__)
518 #define IS_LITTLE_ENDIAN 1
521 #define PR_BYTES_PER_BYTE 1
522 #define PR_BYTES_PER_SHORT 2
523 #define PR_BYTES_PER_INT 4
524 #define PR_BYTES_PER_INT64 8
525 #define PR_BYTES_PER_LONG 4
526 #define PR_BYTES_PER_FLOAT 4
527 #define PR_BYTES_PER_DOUBLE 8
528 #define PR_BYTES_PER_WORD 4
529 #define PR_BYTES_PER_DWORD 8
531 #define PR_BITS_PER_BYTE 8
532 #define PR_BITS_PER_SHORT 16
533 #define PR_BITS_PER_INT 32
534 #define PR_BITS_PER_INT64 64
535 #define PR_BITS_PER_LONG 32
536 #define PR_BITS_PER_FLOAT 32
537 #define PR_BITS_PER_DOUBLE 64
538 #define PR_BITS_PER_WORD 32
540 #define PR_BITS_PER_BYTE_LOG2 3
541 #define PR_BITS_PER_SHORT_LOG2 4
542 #define PR_BITS_PER_INT_LOG2 5
543 #define PR_BITS_PER_INT64_LOG2 6
544 #define PR_BITS_PER_LONG_LOG2 5
545 #define PR_BITS_PER_FLOAT_LOG2 5
546 #define PR_BITS_PER_DOUBLE_LOG2 6
547 #define PR_BITS_PER_WORD_LOG2 5
549 #define PR_ALIGN_OF_SHORT 2
550 #define PR_ALIGN_OF_INT 4
551 #define PR_ALIGN_OF_LONG 4
552 #define PR_ALIGN_OF_INT64 4
553 #define PR_ALIGN_OF_FLOAT 4
554 #define PR_ALIGN_OF_DOUBLE 4
555 #define PR_ALIGN_OF_POINTER 4
556 #define PR_ALIGN_OF_WORD 4
558 #define PR_BYTES_PER_WORD_LOG2 2
559 #define PR_BYTES_PER_DWORD_LOG2 3
561 #elif defined(__aarch64__)
564 #undef IS_LITTLE_ENDIAN
565 #define IS_BIG_ENDIAN 1
566 #elif defined(__AARCH64EL__)
567 #define IS_LITTLE_ENDIAN 1
570 #error "Unknown Aarch64 endianness."
574 #define PR_BYTES_PER_BYTE 1
575 #define PR_BYTES_PER_SHORT 2
576 #define PR_BYTES_PER_INT 4
577 #define PR_BYTES_PER_INT64 8
578 #define PR_BYTES_PER_LONG 8
579 #define PR_BYTES_PER_FLOAT 4
580 #define PR_BYTES_PER_DOUBLE 8
581 #define PR_BYTES_PER_WORD 8
582 #define PR_BYTES_PER_DWORD 8
584 #define PR_BITS_PER_BYTE 8
585 #define PR_BITS_PER_SHORT 16
586 #define PR_BITS_PER_INT 32
587 #define PR_BITS_PER_INT64 64
588 #define PR_BITS_PER_LONG 64
589 #define PR_BITS_PER_FLOAT 32
590 #define PR_BITS_PER_DOUBLE 64
591 #define PR_BITS_PER_WORD 64
593 #define PR_BITS_PER_BYTE_LOG2 3
594 #define PR_BITS_PER_SHORT_LOG2 4
595 #define PR_BITS_PER_INT_LOG2 5
596 #define PR_BITS_PER_INT64_LOG2 6
597 #define PR_BITS_PER_LONG_LOG2 6
598 #define PR_BITS_PER_FLOAT_LOG2 5
599 #define PR_BITS_PER_DOUBLE_LOG2 6
600 #define PR_BITS_PER_WORD_LOG2 6
602 #define PR_ALIGN_OF_SHORT 2
603 #define PR_ALIGN_OF_INT 4
604 #define PR_ALIGN_OF_LONG 8
605 #define PR_ALIGN_OF_INT64 8
606 #define PR_ALIGN_OF_FLOAT 4
607 #define PR_ALIGN_OF_DOUBLE 8
608 #define PR_ALIGN_OF_POINTER 8
609 #define PR_ALIGN_OF_WORD 8
611 #define PR_BYTES_PER_WORD_LOG2 3
612 #define PR_BYTES_PER_DWORD_LOG2 3
614 #elif defined(__hppa__)
616 #undef IS_LITTLE_ENDIAN
617 #define IS_BIG_ENDIAN 1
619 #define PR_BYTES_PER_BYTE 1
620 #define PR_BYTES_PER_SHORT 2
621 #define PR_BYTES_PER_INT 4
622 #define PR_BYTES_PER_INT64 8
623 #define PR_BYTES_PER_LONG 4
624 #define PR_BYTES_PER_FLOAT 4
625 #define PR_BYTES_PER_DOUBLE 8
626 #define PR_BYTES_PER_WORD 4
627 #define PR_BYTES_PER_DWORD 8
629 #define PR_BITS_PER_BYTE 8
630 #define PR_BITS_PER_SHORT 16
631 #define PR_BITS_PER_INT 32
632 #define PR_BITS_PER_INT64 64
633 #define PR_BITS_PER_LONG 32
634 #define PR_BITS_PER_FLOAT 32
635 #define PR_BITS_PER_DOUBLE 64
636 #define PR_BITS_PER_WORD 32
638 #define PR_BITS_PER_BYTE_LOG2 3
639 #define PR_BITS_PER_SHORT_LOG2 4
640 #define PR_BITS_PER_INT_LOG2 5
641 #define PR_BITS_PER_INT64_LOG2 6
642 #define PR_BITS_PER_LONG_LOG2 5
643 #define PR_BITS_PER_FLOAT_LOG2 5
644 #define PR_BITS_PER_DOUBLE_LOG2 6
645 #define PR_BITS_PER_WORD_LOG2 5
647 #define PR_ALIGN_OF_SHORT 2
648 #define PR_ALIGN_OF_INT 4
649 #define PR_ALIGN_OF_LONG 4
650 #define PR_ALIGN_OF_INT64 8
651 #define PR_ALIGN_OF_FLOAT 4
652 #define PR_ALIGN_OF_DOUBLE 8
653 #define PR_ALIGN_OF_POINTER 4
654 #define PR_ALIGN_OF_WORD 4
656 #define PR_BYTES_PER_WORD_LOG2 2
657 #define PR_BYTES_PER_DWORD_LOG2 3
659 #elif defined(__s390x__)
661 #define IS_BIG_ENDIAN 1
662 #undef IS_LITTLE_ENDIAN
665 #define PR_BYTES_PER_BYTE 1
666 #define PR_BYTES_PER_SHORT 2
667 #define PR_BYTES_PER_INT 4
668 #define PR_BYTES_PER_INT64 8
669 #define PR_BYTES_PER_LONG 8
670 #define PR_BYTES_PER_FLOAT 4
671 #define PR_BYTES_PER_DOUBLE 8
672 #define PR_BYTES_PER_WORD 8
673 #define PR_BYTES_PER_DWORD 8
675 #define PR_BITS_PER_BYTE 8
676 #define PR_BITS_PER_SHORT 16
677 #define PR_BITS_PER_INT 32
678 #define PR_BITS_PER_INT64 64
679 #define PR_BITS_PER_LONG 64
680 #define PR_BITS_PER_FLOAT 32
681 #define PR_BITS_PER_DOUBLE 64
682 #define PR_BITS_PER_WORD 64
684 #define PR_BITS_PER_BYTE_LOG2 3
685 #define PR_BITS_PER_SHORT_LOG2 4
686 #define PR_BITS_PER_INT_LOG2 5
687 #define PR_BITS_PER_INT64_LOG2 6
688 #define PR_BITS_PER_LONG_LOG2 6
689 #define PR_BITS_PER_FLOAT_LOG2 5
690 #define PR_BITS_PER_DOUBLE_LOG2 6
691 #define PR_BITS_PER_WORD_LOG2 6
693 #define PR_ALIGN_OF_SHORT 2
694 #define PR_ALIGN_OF_INT 4
695 #define PR_ALIGN_OF_LONG 8
696 #define PR_ALIGN_OF_INT64 8
697 #define PR_ALIGN_OF_FLOAT 4
698 #define PR_ALIGN_OF_DOUBLE 8
699 #define PR_ALIGN_OF_POINTER 8
700 #define PR_ALIGN_OF_WORD 8
702 #define PR_BYTES_PER_WORD_LOG2 3
703 #define PR_BYTES_PER_DWORD_LOG2 3
705 #elif defined(__s390__)
707 #define IS_BIG_ENDIAN 1
708 #undef IS_LITTLE_ENDIAN
710 #define PR_BYTES_PER_BYTE 1
711 #define PR_BYTES_PER_SHORT 2
712 #define PR_BYTES_PER_INT 4
713 #define PR_BYTES_PER_INT64 8
714 #define PR_BYTES_PER_LONG 4
715 #define PR_BYTES_PER_FLOAT 4
716 #define PR_BYTES_PER_DOUBLE 8
717 #define PR_BYTES_PER_WORD 4
718 #define PR_BYTES_PER_DWORD 8
720 #define PR_BITS_PER_BYTE 8
721 #define PR_BITS_PER_SHORT 16
722 #define PR_BITS_PER_INT 32
723 #define PR_BITS_PER_INT64 64
724 #define PR_BITS_PER_LONG 32
725 #define PR_BITS_PER_FLOAT 32
726 #define PR_BITS_PER_DOUBLE 64
727 #define PR_BITS_PER_WORD 32
729 #define PR_BITS_PER_BYTE_LOG2 3
730 #define PR_BITS_PER_SHORT_LOG2 4
731 #define PR_BITS_PER_INT_LOG2 5
732 #define PR_BITS_PER_INT64_LOG2 6
733 #define PR_BITS_PER_LONG_LOG2 5
734 #define PR_BITS_PER_FLOAT_LOG2 5
735 #define PR_BITS_PER_DOUBLE_LOG2 6
736 #define PR_BITS_PER_WORD_LOG2 5
738 #define PR_ALIGN_OF_SHORT 2
739 #define PR_ALIGN_OF_INT 4
740 #define PR_ALIGN_OF_LONG 4
741 #define PR_ALIGN_OF_INT64 4
742 #define PR_ALIGN_OF_FLOAT 4
743 #define PR_ALIGN_OF_DOUBLE 4
744 #define PR_ALIGN_OF_POINTER 4
745 #define PR_ALIGN_OF_WORD 4
747 #define PR_BYTES_PER_WORD_LOG2 2
748 #define PR_BYTES_PER_DWORD_LOG2 3
752 #error "Unknown CPU architecture"
756 #define HAVE_LONG_LONG
757 #if PR_ALIGN_OF_DOUBLE == 8
758 #define HAVE_ALIGNED_DOUBLES
760 #if PR_ALIGN_OF_INT64 == 8
761 #define HAVE_ALIGNED_LONGLONGS
764 #ifndef NO_NSPR_10_SUPPORT
766 #define BYTES_PER_BYTE PR_BYTES_PER_BYTE
767 #define BYTES_PER_SHORT PR_BYTES_PER_SHORT
768 #define BYTES_PER_INT PR_BYTES_PER_INT
769 #define BYTES_PER_INT64 PR_BYTES_PER_INT64
770 #define BYTES_PER_LONG PR_BYTES_PER_LONG
771 #define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT
772 #define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE
773 #define BYTES_PER_WORD PR_BYTES_PER_WORD
774 #define BYTES_PER_DWORD PR_BYTES_PER_DWORD
776 #define BITS_PER_BYTE PR_BITS_PER_BYTE
777 #define BITS_PER_SHORT PR_BITS_PER_SHORT
778 #define BITS_PER_INT PR_BITS_PER_INT
779 #define BITS_PER_INT64 PR_BITS_PER_INT64
780 #define BITS_PER_LONG PR_BITS_PER_LONG
781 #define BITS_PER_FLOAT PR_BITS_PER_FLOAT
782 #define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE
783 #define BITS_PER_WORD PR_BITS_PER_WORD
785 #define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2
786 #define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2
787 #define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2
788 #define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2
789 #define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2
790 #define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2
791 #define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2
792 #define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2
794 #define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT
795 #define ALIGN_OF_INT PR_ALIGN_OF_INT
796 #define ALIGN_OF_LONG PR_ALIGN_OF_LONG
797 #define ALIGN_OF_INT64 PR_ALIGN_OF_INT64
798 #define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT
799 #define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE
800 #define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER
801 #define ALIGN_OF_WORD PR_ALIGN_OF_WORD
803 #define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2
804 #define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2
805 #define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2
807 #endif /* NO_NSPR_10_SUPPORT */
809 #endif /* nspr_cpucfg___ */