_linux.cfg 32 KB

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