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(__hppa__)
563 #undef IS_LITTLE_ENDIAN
564 #define IS_BIG_ENDIAN 1
566 #define PR_BYTES_PER_BYTE 1
567 #define PR_BYTES_PER_SHORT 2
568 #define PR_BYTES_PER_INT 4
569 #define PR_BYTES_PER_INT64 8
570 #define PR_BYTES_PER_LONG 4
571 #define PR_BYTES_PER_FLOAT 4
572 #define PR_BYTES_PER_DOUBLE 8
573 #define PR_BYTES_PER_WORD 4
574 #define PR_BYTES_PER_DWORD 8
576 #define PR_BITS_PER_BYTE 8
577 #define PR_BITS_PER_SHORT 16
578 #define PR_BITS_PER_INT 32
579 #define PR_BITS_PER_INT64 64
580 #define PR_BITS_PER_LONG 32
581 #define PR_BITS_PER_FLOAT 32
582 #define PR_BITS_PER_DOUBLE 64
583 #define PR_BITS_PER_WORD 32
585 #define PR_BITS_PER_BYTE_LOG2 3
586 #define PR_BITS_PER_SHORT_LOG2 4
587 #define PR_BITS_PER_INT_LOG2 5
588 #define PR_BITS_PER_INT64_LOG2 6
589 #define PR_BITS_PER_LONG_LOG2 5
590 #define PR_BITS_PER_FLOAT_LOG2 5
591 #define PR_BITS_PER_DOUBLE_LOG2 6
592 #define PR_BITS_PER_WORD_LOG2 5
594 #define PR_ALIGN_OF_SHORT 2
595 #define PR_ALIGN_OF_INT 4
596 #define PR_ALIGN_OF_LONG 4
597 #define PR_ALIGN_OF_INT64 8
598 #define PR_ALIGN_OF_FLOAT 4
599 #define PR_ALIGN_OF_DOUBLE 8
600 #define PR_ALIGN_OF_POINTER 4
601 #define PR_ALIGN_OF_WORD 4
603 #define PR_BYTES_PER_WORD_LOG2 2
604 #define PR_BYTES_PER_DWORD_LOG2 3
606 #elif defined(__s390x__)
608 #define IS_BIG_ENDIAN 1
609 #undef IS_LITTLE_ENDIAN
612 #define PR_BYTES_PER_BYTE 1
613 #define PR_BYTES_PER_SHORT 2
614 #define PR_BYTES_PER_INT 4
615 #define PR_BYTES_PER_INT64 8
616 #define PR_BYTES_PER_LONG 8
617 #define PR_BYTES_PER_FLOAT 4
618 #define PR_BYTES_PER_DOUBLE 8
619 #define PR_BYTES_PER_WORD 8
620 #define PR_BYTES_PER_DWORD 8
622 #define PR_BITS_PER_BYTE 8
623 #define PR_BITS_PER_SHORT 16
624 #define PR_BITS_PER_INT 32
625 #define PR_BITS_PER_INT64 64
626 #define PR_BITS_PER_LONG 64
627 #define PR_BITS_PER_FLOAT 32
628 #define PR_BITS_PER_DOUBLE 64
629 #define PR_BITS_PER_WORD 64
631 #define PR_BITS_PER_BYTE_LOG2 3
632 #define PR_BITS_PER_SHORT_LOG2 4
633 #define PR_BITS_PER_INT_LOG2 5
634 #define PR_BITS_PER_INT64_LOG2 6
635 #define PR_BITS_PER_LONG_LOG2 6
636 #define PR_BITS_PER_FLOAT_LOG2 5
637 #define PR_BITS_PER_DOUBLE_LOG2 6
638 #define PR_BITS_PER_WORD_LOG2 6
640 #define PR_ALIGN_OF_SHORT 2
641 #define PR_ALIGN_OF_INT 4
642 #define PR_ALIGN_OF_LONG 8
643 #define PR_ALIGN_OF_INT64 8
644 #define PR_ALIGN_OF_FLOAT 4
645 #define PR_ALIGN_OF_DOUBLE 8
646 #define PR_ALIGN_OF_POINTER 8
647 #define PR_ALIGN_OF_WORD 8
649 #define PR_BYTES_PER_WORD_LOG2 3
650 #define PR_BYTES_PER_DWORD_LOG2 3
652 #elif defined(__s390__)
654 #define IS_BIG_ENDIAN 1
655 #undef IS_LITTLE_ENDIAN
657 #define PR_BYTES_PER_BYTE 1
658 #define PR_BYTES_PER_SHORT 2
659 #define PR_BYTES_PER_INT 4
660 #define PR_BYTES_PER_INT64 8
661 #define PR_BYTES_PER_LONG 4
662 #define PR_BYTES_PER_FLOAT 4
663 #define PR_BYTES_PER_DOUBLE 8
664 #define PR_BYTES_PER_WORD 4
665 #define PR_BYTES_PER_DWORD 8
667 #define PR_BITS_PER_BYTE 8
668 #define PR_BITS_PER_SHORT 16
669 #define PR_BITS_PER_INT 32
670 #define PR_BITS_PER_INT64 64
671 #define PR_BITS_PER_LONG 32
672 #define PR_BITS_PER_FLOAT 32
673 #define PR_BITS_PER_DOUBLE 64
674 #define PR_BITS_PER_WORD 32
676 #define PR_BITS_PER_BYTE_LOG2 3
677 #define PR_BITS_PER_SHORT_LOG2 4
678 #define PR_BITS_PER_INT_LOG2 5
679 #define PR_BITS_PER_INT64_LOG2 6
680 #define PR_BITS_PER_LONG_LOG2 5
681 #define PR_BITS_PER_FLOAT_LOG2 5
682 #define PR_BITS_PER_DOUBLE_LOG2 6
683 #define PR_BITS_PER_WORD_LOG2 5
685 #define PR_ALIGN_OF_SHORT 2
686 #define PR_ALIGN_OF_INT 4
687 #define PR_ALIGN_OF_LONG 4
688 #define PR_ALIGN_OF_INT64 4
689 #define PR_ALIGN_OF_FLOAT 4
690 #define PR_ALIGN_OF_DOUBLE 4
691 #define PR_ALIGN_OF_POINTER 4
692 #define PR_ALIGN_OF_WORD 4
694 #define PR_BYTES_PER_WORD_LOG2 2
695 #define PR_BYTES_PER_DWORD_LOG2 3
699 #error "Unknown CPU architecture"
703 #define HAVE_LONG_LONG
704 #if PR_ALIGN_OF_DOUBLE == 8
705 #define HAVE_ALIGNED_DOUBLES
707 #if PR_ALIGN_OF_INT64 == 8
708 #define HAVE_ALIGNED_LONGLONGS
711 #ifndef NO_NSPR_10_SUPPORT
713 #define BYTES_PER_BYTE PR_BYTES_PER_BYTE
714 #define BYTES_PER_SHORT PR_BYTES_PER_SHORT
715 #define BYTES_PER_INT PR_BYTES_PER_INT
716 #define BYTES_PER_INT64 PR_BYTES_PER_INT64
717 #define BYTES_PER_LONG PR_BYTES_PER_LONG
718 #define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT
719 #define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE
720 #define BYTES_PER_WORD PR_BYTES_PER_WORD
721 #define BYTES_PER_DWORD PR_BYTES_PER_DWORD
723 #define BITS_PER_BYTE PR_BITS_PER_BYTE
724 #define BITS_PER_SHORT PR_BITS_PER_SHORT
725 #define BITS_PER_INT PR_BITS_PER_INT
726 #define BITS_PER_INT64 PR_BITS_PER_INT64
727 #define BITS_PER_LONG PR_BITS_PER_LONG
728 #define BITS_PER_FLOAT PR_BITS_PER_FLOAT
729 #define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE
730 #define BITS_PER_WORD PR_BITS_PER_WORD
732 #define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2
733 #define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2
734 #define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2
735 #define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2
736 #define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2
737 #define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2
738 #define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2
739 #define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2
741 #define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT
742 #define ALIGN_OF_INT PR_ALIGN_OF_INT
743 #define ALIGN_OF_LONG PR_ALIGN_OF_LONG
744 #define ALIGN_OF_INT64 PR_ALIGN_OF_INT64
745 #define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT
746 #define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE
747 #define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER
748 #define ALIGN_OF_WORD PR_ALIGN_OF_WORD
750 #define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2
751 #define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2
752 #define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2
754 #endif /* NO_NSPR_10_SUPPORT */
756 #endif /* nspr_cpucfg___ */