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/* For _ABI64 */
502#include <asm/sgidefs.h>
503
504#ifdef __MIPSEB__
505#define IS_BIG_ENDIAN 1
506#undef IS_LITTLE_ENDIAN
507#elif defined(__MIPSEL__)
508#define IS_LITTLE_ENDIAN 1
509#undef IS_BIG_ENDIAN
510#else
511#error "Unknown MIPS endianness."
512#endif
513
514#if _MIPS_SIM == _ABI64
515
516#define IS_64
517
518#define PR_BYTES_PER_BYTE 1
519#define PR_BYTES_PER_SHORT 2
520#define PR_BYTES_PER_INT 4
521#define PR_BYTES_PER_INT64 8
522#define PR_BYTES_PER_LONG 8
523#define PR_BYTES_PER_FLOAT 4
524#define PR_BYTES_PER_DOUBLE 8
525#define PR_BYTES_PER_WORD 8
526#define PR_BYTES_PER_DWORD 8
527
528#define PR_BITS_PER_BYTE 8
529#define PR_BITS_PER_SHORT 16
530#define PR_BITS_PER_INT 32
531#define PR_BITS_PER_INT64 64
532#define PR_BITS_PER_LONG 64
533#define PR_BITS_PER_FLOAT 32
534#define PR_BITS_PER_DOUBLE 64
535#define PR_BITS_PER_WORD 64
536
537#define PR_BITS_PER_BYTE_LOG2 3
538#define PR_BITS_PER_SHORT_LOG2 4
539#define PR_BITS_PER_INT_LOG2 5
540#define PR_BITS_PER_INT64_LOG2 6
541#define PR_BITS_PER_LONG_LOG2 6
542#define PR_BITS_PER_FLOAT_LOG2 5
543#define PR_BITS_PER_DOUBLE_LOG2 6
544#define PR_BITS_PER_WORD_LOG2 6
545
546#define PR_ALIGN_OF_SHORT 2
547#define PR_ALIGN_OF_INT 4
548#define PR_ALIGN_OF_LONG 8
549#define PR_ALIGN_OF_INT64 8
550#define PR_ALIGN_OF_FLOAT 4
551#define PR_ALIGN_OF_DOUBLE 8
552#define PR_ALIGN_OF_POINTER 8
553#define PR_ALIGN_OF_WORD 8
554
555#define PR_BYTES_PER_WORD_LOG2 3
556#define PR_BYTES_PER_DWORD_LOG2 3
557
558#else /* _ABI64 */
559
560#define PR_BYTES_PER_BYTE 1
561#define PR_BYTES_PER_SHORT 2
562#define PR_BYTES_PER_INT 4
563#define PR_BYTES_PER_INT64 8
564#define PR_BYTES_PER_LONG 4
565#define PR_BYTES_PER_FLOAT 4
566#define PR_BYTES_PER_DOUBLE 8
567#define PR_BYTES_PER_WORD 4
568#define PR_BYTES_PER_DWORD 8
569
570#define PR_BITS_PER_BYTE 8
571#define PR_BITS_PER_SHORT 16
572#define PR_BITS_PER_INT 32
573#define PR_BITS_PER_INT64 64
574#define PR_BITS_PER_LONG 32
575#define PR_BITS_PER_FLOAT 32
576#define PR_BITS_PER_DOUBLE 64
577#define PR_BITS_PER_WORD 32
578
579#define PR_BITS_PER_BYTE_LOG2 3
580#define PR_BITS_PER_SHORT_LOG2 4
581#define PR_BITS_PER_INT_LOG2 5
582#define PR_BITS_PER_INT64_LOG2 6
583#define PR_BITS_PER_LONG_LOG2 5
584#define PR_BITS_PER_FLOAT_LOG2 5
585#define PR_BITS_PER_DOUBLE_LOG2 6
586#define PR_BITS_PER_WORD_LOG2 5
587
588#define PR_ALIGN_OF_SHORT 2
589#define PR_ALIGN_OF_INT 4
590#define PR_ALIGN_OF_LONG 4
591#define PR_ALIGN_OF_INT64 8
592#define PR_ALIGN_OF_FLOAT 4
593#define PR_ALIGN_OF_DOUBLE 8
594#define PR_ALIGN_OF_POINTER 4
595#define PR_ALIGN_OF_WORD 4
596
597#define PR_BYTES_PER_WORD_LOG2 2
598#define PR_BYTES_PER_DWORD_LOG2 3
599
600#endif /* _ABI64 */
601
602#elif defined(__arm__)
603
604#ifdef __ARMEB__
605#undef IS_LITTLE_ENDIAN
606#define IS_BIG_ENDIAN 1
607#elif defined(__ARMEL__)
608#define IS_LITTLE_ENDIAN 1
609#undef IS_BIG_ENDIAN
610#else
611#error "Unknown ARM endianness."
612#endif
613
614#define PR_BYTES_PER_BYTE 1
615#define PR_BYTES_PER_SHORT 2
616#define PR_BYTES_PER_INT 4
617#define PR_BYTES_PER_INT64 8
618#define PR_BYTES_PER_LONG 4
619#define PR_BYTES_PER_FLOAT 4
620#define PR_BYTES_PER_DOUBLE 8
621#define PR_BYTES_PER_WORD 4
622#define PR_BYTES_PER_DWORD 8
623
624#define PR_BITS_PER_BYTE 8
625#define PR_BITS_PER_SHORT 16
626#define PR_BITS_PER_INT 32
627#define PR_BITS_PER_INT64 64
628#define PR_BITS_PER_LONG 32
629#define PR_BITS_PER_FLOAT 32
630#define PR_BITS_PER_DOUBLE 64
631#define PR_BITS_PER_WORD 32
632
633#define PR_BITS_PER_BYTE_LOG2 3
634#define PR_BITS_PER_SHORT_LOG2 4
635#define PR_BITS_PER_INT_LOG2 5
636#define PR_BITS_PER_INT64_LOG2 6
637#define PR_BITS_PER_LONG_LOG2 5
638#define PR_BITS_PER_FLOAT_LOG2 5
639#define PR_BITS_PER_DOUBLE_LOG2 6
640#define PR_BITS_PER_WORD_LOG2 5
641
642#define PR_ALIGN_OF_SHORT 2
643#define PR_ALIGN_OF_INT 4
644#define PR_ALIGN_OF_LONG 4
645#define PR_ALIGN_OF_INT64 4
646#define PR_ALIGN_OF_FLOAT 4
647#define PR_ALIGN_OF_DOUBLE 4
648#define PR_ALIGN_OF_POINTER 4
649#define PR_ALIGN_OF_WORD 4
650
651#define PR_BYTES_PER_WORD_LOG2 2
652#define PR_BYTES_PER_DWORD_LOG2 3
653
654#elif defined(__aarch64__)
655
656#ifdef __AARCH64EB__
657#undef IS_LITTLE_ENDIAN
658#define IS_BIG_ENDIAN 1
659#elif defined(__AARCH64EL__)
660#define IS_LITTLE_ENDIAN 1
661#undef IS_BIG_ENDIAN
662#else
663#error "Unknown Aarch64 endianness."
664#endif
665#define IS_64
666
667#define PR_BYTES_PER_BYTE 1
668#define PR_BYTES_PER_SHORT 2
669#define PR_BYTES_PER_INT 4
670#define PR_BYTES_PER_INT64 8
671#define PR_BYTES_PER_LONG 8
672#define PR_BYTES_PER_FLOAT 4
673#define PR_BYTES_PER_DOUBLE 8
674#define PR_BYTES_PER_WORD 8
675#define PR_BYTES_PER_DWORD 8
676
677#define PR_BITS_PER_BYTE 8
678#define PR_BITS_PER_SHORT 16
679#define PR_BITS_PER_INT 32
680#define PR_BITS_PER_INT64 64
681#define PR_BITS_PER_LONG 64
682#define PR_BITS_PER_FLOAT 32
683#define PR_BITS_PER_DOUBLE 64
684#define PR_BITS_PER_WORD 64
685
686#define PR_BITS_PER_BYTE_LOG2 3
687#define PR_BITS_PER_SHORT_LOG2 4
688#define PR_BITS_PER_INT_LOG2 5
689#define PR_BITS_PER_INT64_LOG2 6
690#define PR_BITS_PER_LONG_LOG2 6
691#define PR_BITS_PER_FLOAT_LOG2 5
692#define PR_BITS_PER_DOUBLE_LOG2 6
693#define PR_BITS_PER_WORD_LOG2 6
694
695#define PR_ALIGN_OF_SHORT 2
696#define PR_ALIGN_OF_INT 4
697#define PR_ALIGN_OF_LONG 8
698#define PR_ALIGN_OF_INT64 8
699#define PR_ALIGN_OF_FLOAT 4
700#define PR_ALIGN_OF_DOUBLE 8
701#define PR_ALIGN_OF_POINTER 8
702#define PR_ALIGN_OF_WORD 8
703
704#define PR_BYTES_PER_WORD_LOG2 3
705#define PR_BYTES_PER_DWORD_LOG2 3
706
707#elif defined(__hppa__)
708
709#undef IS_LITTLE_ENDIAN
710#define IS_BIG_ENDIAN 1
711
712#define PR_BYTES_PER_BYTE 1
713#define PR_BYTES_PER_SHORT 2
714#define PR_BYTES_PER_INT 4
715#define PR_BYTES_PER_INT64 8
716#define PR_BYTES_PER_LONG 4
717#define PR_BYTES_PER_FLOAT 4
718#define PR_BYTES_PER_DOUBLE 8
719#define PR_BYTES_PER_WORD 4
720#define PR_BYTES_PER_DWORD 8
721
722#define PR_BITS_PER_BYTE 8
723#define PR_BITS_PER_SHORT 16
724#define PR_BITS_PER_INT 32
725#define PR_BITS_PER_INT64 64
726#define PR_BITS_PER_LONG 32
727#define PR_BITS_PER_FLOAT 32
728#define PR_BITS_PER_DOUBLE 64
729#define PR_BITS_PER_WORD 32
730
731#define PR_BITS_PER_BYTE_LOG2 3
732#define PR_BITS_PER_SHORT_LOG2 4
733#define PR_BITS_PER_INT_LOG2 5
734#define PR_BITS_PER_INT64_LOG2 6
735#define PR_BITS_PER_LONG_LOG2 5
736#define PR_BITS_PER_FLOAT_LOG2 5
737#define PR_BITS_PER_DOUBLE_LOG2 6
738#define PR_BITS_PER_WORD_LOG2 5
739
740#define PR_ALIGN_OF_SHORT 2
741#define PR_ALIGN_OF_INT 4
742#define PR_ALIGN_OF_LONG 4
743#define PR_ALIGN_OF_INT64 8
744#define PR_ALIGN_OF_FLOAT 4
745#define PR_ALIGN_OF_DOUBLE 8
746#define PR_ALIGN_OF_POINTER 4
747#define PR_ALIGN_OF_WORD 4
748
749#define PR_BYTES_PER_WORD_LOG2 2
750#define PR_BYTES_PER_DWORD_LOG2 3
751
752#elif defined(__s390x__)
753
754#define IS_BIG_ENDIAN 1
755#undef IS_LITTLE_ENDIAN
756#define IS_64
757
758#define PR_BYTES_PER_BYTE 1
759#define PR_BYTES_PER_SHORT 2
760#define PR_BYTES_PER_INT 4
761#define PR_BYTES_PER_INT64 8
762#define PR_BYTES_PER_LONG 8
763#define PR_BYTES_PER_FLOAT 4
764#define PR_BYTES_PER_DOUBLE 8
765#define PR_BYTES_PER_WORD 8
766#define PR_BYTES_PER_DWORD 8
767
768#define PR_BITS_PER_BYTE 8
769#define PR_BITS_PER_SHORT 16
770#define PR_BITS_PER_INT 32
771#define PR_BITS_PER_INT64 64
772#define PR_BITS_PER_LONG 64
773#define PR_BITS_PER_FLOAT 32
774#define PR_BITS_PER_DOUBLE 64
775#define PR_BITS_PER_WORD 64
776
777#define PR_BITS_PER_BYTE_LOG2 3
778#define PR_BITS_PER_SHORT_LOG2 4
779#define PR_BITS_PER_INT_LOG2 5
780#define PR_BITS_PER_INT64_LOG2 6
781#define PR_BITS_PER_LONG_LOG2 6
782#define PR_BITS_PER_FLOAT_LOG2 5
783#define PR_BITS_PER_DOUBLE_LOG2 6
784#define PR_BITS_PER_WORD_LOG2 6
785
786#define PR_ALIGN_OF_SHORT 2
787#define PR_ALIGN_OF_INT 4
788#define PR_ALIGN_OF_LONG 8
789#define PR_ALIGN_OF_INT64 8
790#define PR_ALIGN_OF_FLOAT 4
791#define PR_ALIGN_OF_DOUBLE 8
792#define PR_ALIGN_OF_POINTER 8
793#define PR_ALIGN_OF_WORD 8
794
795#define PR_BYTES_PER_WORD_LOG2 3
796#define PR_BYTES_PER_DWORD_LOG2 3
797
798#elif defined(__s390__)
799
800#define IS_BIG_ENDIAN 1
801#undef IS_LITTLE_ENDIAN
802
803#define PR_BYTES_PER_BYTE 1
804#define PR_BYTES_PER_SHORT 2
805#define PR_BYTES_PER_INT 4
806#define PR_BYTES_PER_INT64 8
807#define PR_BYTES_PER_LONG 4
808#define PR_BYTES_PER_FLOAT 4
809#define PR_BYTES_PER_DOUBLE 8
810#define PR_BYTES_PER_WORD 4
811#define PR_BYTES_PER_DWORD 8
812
813#define PR_BITS_PER_BYTE 8
814#define PR_BITS_PER_SHORT 16
815#define PR_BITS_PER_INT 32
816#define PR_BITS_PER_INT64 64
817#define PR_BITS_PER_LONG 32
818#define PR_BITS_PER_FLOAT 32
819#define PR_BITS_PER_DOUBLE 64
820#define PR_BITS_PER_WORD 32
821
822#define PR_BITS_PER_BYTE_LOG2 3
823#define PR_BITS_PER_SHORT_LOG2 4
824#define PR_BITS_PER_INT_LOG2 5
825#define PR_BITS_PER_INT64_LOG2 6
826#define PR_BITS_PER_LONG_LOG2 5
827#define PR_BITS_PER_FLOAT_LOG2 5
828#define PR_BITS_PER_DOUBLE_LOG2 6
829#define PR_BITS_PER_WORD_LOG2 5
830
831#define PR_ALIGN_OF_SHORT 2
832#define PR_ALIGN_OF_INT 4
833#define PR_ALIGN_OF_LONG 4
834#define PR_ALIGN_OF_INT64 4
835#define PR_ALIGN_OF_FLOAT 4
836#define PR_ALIGN_OF_DOUBLE 4
837#define PR_ALIGN_OF_POINTER 4
838#define PR_ALIGN_OF_WORD 4
839
840#define PR_BYTES_PER_WORD_LOG2 2
841#define PR_BYTES_PER_DWORD_LOG2 3
842
843#elif defined(__sh__)
844
845#define IS_LITTLE_ENDIAN 1
846#undef IS_BIG_ENDIAN
847
848#define PR_BYTES_PER_BYTE 1
849#define PR_BYTES_PER_SHORT 2
850#define PR_BYTES_PER_INT 4
851#define PR_BYTES_PER_INT64 8
852#define PR_BYTES_PER_LONG 4
853#define PR_BYTES_PER_FLOAT 4
854#define PR_BYTES_PER_DOUBLE 8
855#define PR_BYTES_PER_WORD 4
856#define PR_BYTES_PER_DWORD 8
857
858#define PR_BITS_PER_BYTE 8
859#define PR_BITS_PER_SHORT 16
860#define PR_BITS_PER_INT 32
861#define PR_BITS_PER_INT64 64
862#define PR_BITS_PER_LONG 32
863#define PR_BITS_PER_FLOAT 32
864#define PR_BITS_PER_DOUBLE 64
865#define PR_BITS_PER_WORD 32
866
867#define PR_BITS_PER_BYTE_LOG2 3
868#define PR_BITS_PER_SHORT_LOG2 4
869#define PR_BITS_PER_INT_LOG2 5
870#define PR_BITS_PER_INT64_LOG2 6
871#define PR_BITS_PER_LONG_LOG2 5
872#define PR_BITS_PER_FLOAT_LOG2 5
873#define PR_BITS_PER_DOUBLE_LOG2 6
874#define PR_BITS_PER_WORD_LOG2 5
875
876#define PR_ALIGN_OF_SHORT 2
877#define PR_ALIGN_OF_INT 4
878#define PR_ALIGN_OF_LONG 4
879#define PR_ALIGN_OF_INT64 4
880#define PR_ALIGN_OF_FLOAT 4
881#define PR_ALIGN_OF_DOUBLE 4
882#define PR_ALIGN_OF_POINTER 4
883#define PR_ALIGN_OF_WORD 4
884
885#define PR_BYTES_PER_WORD_LOG2 2
886#define PR_BYTES_PER_DWORD_LOG2 3
887
888#elif defined(__avr32__)
889
890#undef IS_LITTLE_ENDIAN
891#define IS_BIG_ENDIAN 1
892
893#define PR_BYTES_PER_BYTE 1
894#define PR_BYTES_PER_SHORT 2
895#define PR_BYTES_PER_INT 4
896#define PR_BYTES_PER_INT64 8
897#define PR_BYTES_PER_LONG 4
898#define PR_BYTES_PER_FLOAT 4
899#define PR_BYTES_PER_DOUBLE 8
900#define PR_BYTES_PER_WORD 4
901#define PR_BYTES_PER_DWORD 8
902
903#define PR_BITS_PER_BYTE 8
904#define PR_BITS_PER_SHORT 16
905#define PR_BITS_PER_INT 32
906#define PR_BITS_PER_INT64 64
907#define PR_BITS_PER_LONG 32
908#define PR_BITS_PER_FLOAT 32
909#define PR_BITS_PER_DOUBLE 64
910#define PR_BITS_PER_WORD 32
911
912#define PR_BITS_PER_BYTE_LOG2 3
913#define PR_BITS_PER_SHORT_LOG2 4
914#define PR_BITS_PER_INT_LOG2 5
915#define PR_BITS_PER_INT64_LOG2 6
916#define PR_BITS_PER_LONG_LOG2 5
917#define PR_BITS_PER_FLOAT_LOG2 5
918#define PR_BITS_PER_DOUBLE_LOG2 6
919#define PR_BITS_PER_WORD_LOG2 5
920
921#define PR_ALIGN_OF_SHORT 2
922#define PR_ALIGN_OF_INT 4
923#define PR_ALIGN_OF_LONG 4
924#define PR_ALIGN_OF_INT64 4
925#define PR_ALIGN_OF_FLOAT 4
926#define PR_ALIGN_OF_DOUBLE 4
927#define PR_ALIGN_OF_POINTER 4
928#define PR_ALIGN_OF_WORD 4
929
930#define PR_BYTES_PER_WORD_LOG2 2
931#define PR_BYTES_PER_DWORD_LOG2 3
932
933#elif defined(__m32r__)
934
935#undef IS_LITTLE_ENDIAN
936#define IS_BIG_ENDIAN 1
937
938#define PR_BYTES_PER_BYTE 1
939#define PR_BYTES_PER_SHORT 2
940#define PR_BYTES_PER_INT 4
941#define PR_BYTES_PER_INT64 8
942#define PR_BYTES_PER_LONG 4
943#define PR_BYTES_PER_FLOAT 4
944#define PR_BYTES_PER_DOUBLE 8
945#define PR_BYTES_PER_WORD 4
946#define PR_BYTES_PER_DWORD 8
947
948#define PR_BITS_PER_BYTE 8
949#define PR_BITS_PER_SHORT 16
950#define PR_BITS_PER_INT 32
951#define PR_BITS_PER_INT64 64
952#define PR_BITS_PER_LONG 32
953#define PR_BITS_PER_FLOAT 32
954#define PR_BITS_PER_DOUBLE 64
955#define PR_BITS_PER_WORD 32
956
957#define PR_BITS_PER_BYTE_LOG2 3
958#define PR_BITS_PER_SHORT_LOG2 4
959#define PR_BITS_PER_INT_LOG2 5
960#define PR_BITS_PER_INT64_LOG2 6
961#define PR_BITS_PER_LONG_LOG2 5
962#define PR_BITS_PER_FLOAT_LOG2 5
963#define PR_BITS_PER_DOUBLE_LOG2 6
964#define PR_BITS_PER_WORD_LOG2 5
965
966#define PR_ALIGN_OF_SHORT 2
967#define PR_ALIGN_OF_INT 4
968#define PR_ALIGN_OF_LONG 4
969#define PR_ALIGN_OF_INT64 4
970#define PR_ALIGN_OF_FLOAT 4
971#define PR_ALIGN_OF_DOUBLE 4
972#define PR_ALIGN_OF_POINTER 4
973#define PR_ALIGN_OF_WORD 4
974
975#define PR_BYTES_PER_WORD_LOG2 2
976#define PR_BYTES_PER_DWORD_LOG2 3
977
978#elif defined(__or1k__)
979
980#undef IS_LITTLE_ENDIAN
981#define IS_BIG_ENDIAN 1
982
983#define PR_BYTES_PER_BYTE 1
984#define PR_BYTES_PER_SHORT 2
985#define PR_BYTES_PER_INT 4
986#define PR_BYTES_PER_INT64 8
987#define PR_BYTES_PER_LONG 4
988#define PR_BYTES_PER_FLOAT 4
989#define PR_BYTES_PER_DOUBLE 8
990#define PR_BYTES_PER_WORD 4
991#define PR_BYTES_PER_DWORD 8
992
993#define PR_BITS_PER_BYTE 8
994#define PR_BITS_PER_SHORT 16
995#define PR_BITS_PER_INT 32
996#define PR_BITS_PER_INT64 64
997#define PR_BITS_PER_LONG 32
998#define PR_BITS_PER_FLOAT 32
999#define PR_BITS_PER_DOUBLE 64
1000#define PR_BITS_PER_WORD 32
1001
1002#define PR_BITS_PER_BYTE_LOG2 3
1003#define PR_BITS_PER_SHORT_LOG2 4
1004#define PR_BITS_PER_INT_LOG2 5
1005#define PR_BITS_PER_INT64_LOG2 6
1006#define PR_BITS_PER_LONG_LOG2 5
1007#define PR_BITS_PER_FLOAT_LOG2 5
1008#define PR_BITS_PER_DOUBLE_LOG2 6
1009#define PR_BITS_PER_WORD_LOG2 5
1010
1011#define PR_ALIGN_OF_SHORT 2
1012#define PR_ALIGN_OF_INT 4
1013#define PR_ALIGN_OF_LONG 4
1014#define PR_ALIGN_OF_INT64 4
1015#define PR_ALIGN_OF_FLOAT 4
1016#define PR_ALIGN_OF_DOUBLE 4
1017#define PR_ALIGN_OF_POINTER 4
1018#define PR_ALIGN_OF_WORD 4
1019
1020#define PR_BYTES_PER_WORD_LOG2 2
1021#define PR_BYTES_PER_DWORD_LOG2 3
1022
1023#elif defined(__riscv) && (__riscv_xlen == 32)
1024
1025#undef IS_BIG_ENDIAN
1026#define IS_LITTLE_ENDIAN 1
1027#undef IS_64
1028
1029#define PR_BYTES_PER_BYTE 1
1030#define PR_BYTES_PER_SHORT 2
1031#define PR_BYTES_PER_INT 4
1032#define PR_BYTES_PER_INT64 8
1033#define PR_BYTES_PER_LONG 4
1034#define PR_BYTES_PER_FLOAT 4
1035#define PR_BYTES_PER_DOUBLE 8
1036#define PR_BYTES_PER_WORD 4
1037#define PR_BYTES_PER_DWORD 8
1038
1039#define PR_BITS_PER_BYTE 8
1040#define PR_BITS_PER_SHORT 16
1041#define PR_BITS_PER_INT 32
1042#define PR_BITS_PER_INT64 64
1043#define PR_BITS_PER_LONG 32
1044#define PR_BITS_PER_FLOAT 32
1045#define PR_BITS_PER_DOUBLE 64
1046#define PR_BITS_PER_WORD 32
1047
1048#define PR_BITS_PER_BYTE_LOG2 3
1049#define PR_BITS_PER_SHORT_LOG2 4
1050#define PR_BITS_PER_INT_LOG2 5
1051#define PR_BITS_PER_INT64_LOG2 6
1052#define PR_BITS_PER_LONG_LOG2 5
1053#define PR_BITS_PER_FLOAT_LOG2 5
1054#define PR_BITS_PER_DOUBLE_LOG2 6
1055#define PR_BITS_PER_WORD_LOG2 5
1056
1057#define PR_ALIGN_OF_SHORT 2
1058#define PR_ALIGN_OF_INT 4
1059#define PR_ALIGN_OF_LONG 4
1060#define PR_ALIGN_OF_INT64 8
1061#define PR_ALIGN_OF_FLOAT 4
1062#define PR_ALIGN_OF_DOUBLE 8
1063#define PR_ALIGN_OF_POINTER 4
1064#define PR_ALIGN_OF_WORD 4
1065
1066#define PR_BYTES_PER_WORD_LOG2 2
1067#define PR_BYTES_PER_DWORD_LOG2 3
1068
1069#elif defined(__riscv) && (__riscv_xlen == 64)
1070
1071#undef IS_BIG_ENDIAN
1072#define IS_LITTLE_ENDIAN 1
1073#define IS_64
1074
1075#define PR_BYTES_PER_BYTE 1
1076#define PR_BYTES_PER_SHORT 2
1077#define PR_BYTES_PER_INT 4
1078#define PR_BYTES_PER_INT64 8
1079#define PR_BYTES_PER_LONG 8
1080#define PR_BYTES_PER_FLOAT 4
1081#define PR_BYTES_PER_DOUBLE 8
1082#define PR_BYTES_PER_WORD 8
1083#define PR_BYTES_PER_DWORD 8
1084
1085#define PR_BITS_PER_BYTE 8
1086#define PR_BITS_PER_SHORT 16
1087#define PR_BITS_PER_INT 32
1088#define PR_BITS_PER_INT64 64
1089#define PR_BITS_PER_LONG 64
1090#define PR_BITS_PER_FLOAT 32
1091#define PR_BITS_PER_DOUBLE 64
1092#define PR_BITS_PER_WORD 64
1093
1094#define PR_BITS_PER_BYTE_LOG2 3
1095#define PR_BITS_PER_SHORT_LOG2 4
1096#define PR_BITS_PER_INT_LOG2 5
1097#define PR_BITS_PER_INT64_LOG2 6
1098#define PR_BITS_PER_LONG_LOG2 6
1099#define PR_BITS_PER_FLOAT_LOG2 5
1100#define PR_BITS_PER_DOUBLE_LOG2 6
1101#define PR_BITS_PER_WORD_LOG2 6
1102
1103#define PR_ALIGN_OF_SHORT 2
1104#define PR_ALIGN_OF_INT 4
1105#define PR_ALIGN_OF_LONG 8
1106#define PR_ALIGN_OF_INT64 8
1107#define PR_ALIGN_OF_FLOAT 4
1108#define PR_ALIGN_OF_DOUBLE 8
1109#define PR_ALIGN_OF_POINTER 8
1110#define PR_ALIGN_OF_WORD 8
1111
1112#define PR_BYTES_PER_WORD_LOG2 3
1113#define PR_BYTES_PER_DWORD_LOG2 3
1114
1115#elif defined(__arc__)
1116
1117#define IS_LITTLE_ENDIAN 1
1118#undef IS_BIG_ENDIAN
1119
1120#define PR_BYTES_PER_BYTE 1
1121#define PR_BYTES_PER_SHORT 2
1122#define PR_BYTES_PER_INT 4
1123#define PR_BYTES_PER_INT64 8
1124#define PR_BYTES_PER_LONG 4
1125#define PR_BYTES_PER_FLOAT 4
1126#define PR_BYTES_PER_DOUBLE 8
1127#define PR_BYTES_PER_WORD 4
1128#define PR_BYTES_PER_DWORD 8
1129
1130#define PR_BITS_PER_BYTE 8
1131#define PR_BITS_PER_SHORT 16
1132#define PR_BITS_PER_INT 32
1133#define PR_BITS_PER_INT64 64
1134#define PR_BITS_PER_LONG 32
1135#define PR_BITS_PER_FLOAT 32
1136#define PR_BITS_PER_DOUBLE 64
1137#define PR_BITS_PER_WORD 32
1138
1139#define PR_BITS_PER_BYTE_LOG2 3
1140#define PR_BITS_PER_SHORT_LOG2 4
1141#define PR_BITS_PER_INT_LOG2 5
1142#define PR_BITS_PER_INT64_LOG2 6
1143#define PR_BITS_PER_LONG_LOG2 5
1144#define PR_BITS_PER_FLOAT_LOG2 5
1145#define PR_BITS_PER_DOUBLE_LOG2 6
1146#define PR_BITS_PER_WORD_LOG2 5
1147
1148#define PR_ALIGN_OF_SHORT 2
1149#define PR_ALIGN_OF_INT 4
1150#define PR_ALIGN_OF_LONG 4
1151#define PR_ALIGN_OF_INT64 4
1152#define PR_ALIGN_OF_FLOAT 4
1153#define PR_ALIGN_OF_DOUBLE 4
1154#define PR_ALIGN_OF_POINTER 4
1155#define PR_ALIGN_OF_WORD 4
1156
1157#define PR_BYTES_PER_WORD_LOG2 2
1158#define PR_BYTES_PER_DWORD_LOG2 3
1159
1160#elif defined(__nios2__) || defined(__microblaze__) || defined(__nds32__) || \
1161 defined(__xtensa__)
1162
1163#if defined(__microblaze__) && defined(__BIG_ENDIAN__)
1164#define IS_BIG_ENDIAN 1
1165#undef IS_LITTLE_ENDIAN
1166#else
1167#define IS_LITTLE_ENDIAN 1
1168#undef IS_BIG_ENDIAN
1169#endif
1170
1171#define PR_BYTES_PER_BYTE 1
1172#define PR_BYTES_PER_SHORT 2
1173#define PR_BYTES_PER_INT 4
1174#define PR_BYTES_PER_INT64 8
1175#define PR_BYTES_PER_LONG 4
1176#define PR_BYTES_PER_FLOAT 4
1177#define PR_BYTES_PER_DOUBLE 8
1178#define PR_BYTES_PER_WORD 4
1179#define PR_BYTES_PER_DWORD 8
1180
1181#define PR_BITS_PER_BYTE 8
1182#define PR_BITS_PER_SHORT 16
1183#define PR_BITS_PER_INT 32
1184#define PR_BITS_PER_INT64 64
1185#define PR_BITS_PER_LONG 32
1186#define PR_BITS_PER_FLOAT 32
1187#define PR_BITS_PER_DOUBLE 64
1188#define PR_BITS_PER_WORD 32
1189
1190#define PR_BITS_PER_BYTE_LOG2 3
1191#define PR_BITS_PER_SHORT_LOG2 4
1192#define PR_BITS_PER_INT_LOG2 5
1193#define PR_BITS_PER_INT64_LOG2 6
1194#define PR_BITS_PER_LONG_LOG2 5
1195#define PR_BITS_PER_FLOAT_LOG2 5
1196#define PR_BITS_PER_DOUBLE_LOG2 6
1197#define PR_BITS_PER_WORD_LOG2 5
1198
1199#define PR_ALIGN_OF_SHORT 2
1200#define PR_ALIGN_OF_INT 4
1201#define PR_ALIGN_OF_LONG 4
1202#define PR_ALIGN_OF_INT64 4
1203#define PR_ALIGN_OF_FLOAT 4
1204#define PR_ALIGN_OF_DOUBLE 4
1205#define PR_ALIGN_OF_POINTER 4
1206#define PR_ALIGN_OF_WORD 4
1207
1208#define PR_BYTES_PER_WORD_LOG2 2
1209#define PR_BYTES_PER_DWORD_LOG2 3
1210
1211#elif defined(__e2k__)
1212
1213#define IS_LITTLE_ENDIAN 1
1214#undef IS_BIG_ENDIAN
1215
1216#define IS_64
1217
1218#define PR_BYTES_PER_BYTE 1
1219#define PR_BYTES_PER_SHORT 2
1220#define PR_BYTES_PER_INT 4
1221#define PR_BYTES_PER_INT64 4
1222#define PR_BYTES_PER_LONG 8
1223#define PR_BYTES_PER_FLOAT 4
1224#define PR_BYTES_PER_DOUBLE 8
1225#define PR_BYTES_PER_WORD 8
1226#define PR_BYTES_PER_DWORD 8
1227
1228#define PR_BITS_PER_BYTE 8
1229#define PR_BITS_PER_SHORT 16
1230#define PR_BITS_PER_INT 32
1231#define PR_BITS_PER_INT64 32
1232#define PR_BITS_PER_LONG 64
1233#define PR_BITS_PER_FLOAT 32
1234#define PR_BITS_PER_DOUBLE 64
1235#define PR_BITS_PER_WORD 64
1236
1237#define PR_BITS_PER_BYTE_LOG2 3
1238#define PR_BITS_PER_SHORT_LOG2 4
1239#define PR_BITS_PER_INT_LOG2 5
1240#define PR_BITS_PER_INT64_LOG2 5
1241#define PR_BITS_PER_LONG_LOG2 6
1242#define PR_BITS_PER_FLOAT_LOG2 5
1243#define PR_BITS_PER_DOUBLE_LOG2 6
1244#define PR_BITS_PER_WORD_LOG2 6
1245
1246#define PR_ALIGN_OF_SHORT 2
1247#define PR_ALIGN_OF_INT 4
1248#define PR_ALIGN_OF_LONG 8
1249#define PR_ALIGN_OF_INT64 4
1250#define PR_ALIGN_OF_FLOAT 4
1251#define PR_ALIGN_OF_DOUBLE 8
1252#define PR_ALIGN_OF_POINTER 8
1253#define PR_ALIGN_OF_WORD 8
1254
1255#define PR_BYTES_PER_WORD_LOG2 3
1256#define PR_BYTES_PER_DWORD_LOG2 3
1257
1258#elif defined(__loongarch64)
1259
1260#undef IS_BIG_ENDIAN
1261#define IS_LITTLE_ENDIAN 1
1262#define IS_64
1263
1264#define PR_BYTES_PER_BYTE 1
1265#define PR_BYTES_PER_SHORT 2
1266#define PR_BYTES_PER_INT 4
1267#define PR_BYTES_PER_INT64 8
1268#define PR_BYTES_PER_LONG 8
1269#define PR_BYTES_PER_FLOAT 4
1270#define PR_BYTES_PER_DOUBLE 8
1271#define PR_BYTES_PER_WORD 8
1272#define PR_BYTES_PER_DWORD 8
1273
1274#define PR_BITS_PER_BYTE 8
1275#define PR_BITS_PER_SHORT 16
1276#define PR_BITS_PER_INT 32
1277#define PR_BITS_PER_INT64 64
1278#define PR_BITS_PER_LONG 64
1279#define PR_BITS_PER_FLOAT 32
1280#define PR_BITS_PER_DOUBLE 64
1281#define PR_BITS_PER_WORD 64
1282
1283#define PR_BITS_PER_BYTE_LOG2 3
1284#define PR_BITS_PER_SHORT_LOG2 4
1285#define PR_BITS_PER_INT_LOG2 5
1286#define PR_BITS_PER_INT64_LOG2 6
1287#define PR_BITS_PER_LONG_LOG2 6
1288#define PR_BITS_PER_FLOAT_LOG2 5
1289#define PR_BITS_PER_DOUBLE_LOG2 6
1290#define PR_BITS_PER_WORD_LOG2 6
1291
1292#define PR_ALIGN_OF_SHORT 2
1293#define PR_ALIGN_OF_INT 4
1294#define PR_ALIGN_OF_LONG 8
1295#define PR_ALIGN_OF_INT64 8
1296#define PR_ALIGN_OF_FLOAT 4
1297#define PR_ALIGN_OF_DOUBLE 8
1298#define PR_ALIGN_OF_POINTER 8
1299#define PR_ALIGN_OF_WORD 8
1300
1301#define PR_BYTES_PER_WORD_LOG2 3
1302#define PR_BYTES_PER_DWORD_LOG2 3
1303
1304#else
1305
1306#error "Unknown CPU architecture"
1307
1308#endif
1309
1310#ifndef HAVE_LONG_LONG
1311#define HAVE_LONG_LONG
1312#endif
1313#if PR_ALIGN_OF_DOUBLE == 8
1314#define HAVE_ALIGNED_DOUBLES
1315#endif
1316#if PR_ALIGN_OF_INT64 == 8
1317#define HAVE_ALIGNED_LONGLONGS
1318#endif
1319
1320#ifndef NO_NSPR_10_SUPPORT
1321
1322#define BYTES_PER_BYTE PR_BYTES_PER_BYTE
1323#define BYTES_PER_SHORT PR_BYTES_PER_SHORT
1324#define BYTES_PER_INT PR_BYTES_PER_INT
1325#define BYTES_PER_INT64 PR_BYTES_PER_INT64
1326#define BYTES_PER_LONG PR_BYTES_PER_LONG
1327#define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT
1328#define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE
1329#define BYTES_PER_WORD PR_BYTES_PER_WORD
1330#define BYTES_PER_DWORD PR_BYTES_PER_DWORD
1331
1332#define BITS_PER_BYTE PR_BITS_PER_BYTE
1333#define BITS_PER_SHORT PR_BITS_PER_SHORT
1334#define BITS_PER_INT PR_BITS_PER_INT
1335#define BITS_PER_INT64 PR_BITS_PER_INT64
1336#define BITS_PER_LONG PR_BITS_PER_LONG
1337#define BITS_PER_FLOAT PR_BITS_PER_FLOAT
1338#define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE
1339#define BITS_PER_WORD PR_BITS_PER_WORD
1340
1341#define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2
1342#define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2
1343#define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2
1344#define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2
1345#define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2
1346#define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2
1347#define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2
1348#define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2
1349
1350#define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT
1351#define ALIGN_OF_INT PR_ALIGN_OF_INT
1352#define ALIGN_OF_LONG PR_ALIGN_OF_LONG
1353#define ALIGN_OF_INT64 PR_ALIGN_OF_INT64
1354#define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT
1355#define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE
1356#define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER
1357#define ALIGN_OF_WORD PR_ALIGN_OF_WORD
1358
1359#define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2
1360#define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2
1361#define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2
1362
1363#endif /* NO_NSPR_10_SUPPORT */
1364
1365#endif /* nspr_cpucfg___ */
1366

source code of include/nspr/prcpucfg.h