ieeefp.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. #ifndef __CLASSPATH_IEEEFP_H__
  2. #define __CLASSPATH_IEEEFP_H__
  3. #ifndef __IEEE_BIG_ENDIAN
  4. #ifndef __IEEE_LITTLE_ENDIAN
  5. #ifdef __aarch64__
  6. #ifdef __AARCH64EB__
  7. #define __IEEE_BIG_ENDIAN
  8. #else
  9. #define __IEEE_LITTLE_ENDIAN
  10. #endif
  11. #endif
  12. #ifdef __alpha__
  13. #define __IEEE_LITTLE_ENDIAN
  14. #endif
  15. #if defined(__arm__) || defined(__thumb__)
  16. /* ARM traditionally used big-endian words; and within those words the
  17. byte ordering was big or little endian depending upon the target.
  18. Modern floating-point formats are naturally ordered; in this case
  19. __VFP_FP__ will be defined, even if soft-float. */
  20. #ifdef __VFP_FP__
  21. #ifdef __ARMEL__
  22. #define __IEEE_LITTLE_ENDIAN
  23. #else
  24. #define __IEEE_BIG_ENDIAN
  25. #endif
  26. #else
  27. #define __IEEE_BIG_ENDIAN
  28. #ifdef __ARMEL__
  29. #define __IEEE_BYTES_LITTLE_ENDIAN
  30. #endif
  31. #endif
  32. #endif
  33. #ifdef __hppa__
  34. #define __IEEE_BIG_ENDIAN
  35. #endif
  36. #if defined (__sparc) || defined (__sparc__)
  37. #define __IEEE_BIG_ENDIAN
  38. #endif
  39. #ifdef __m32r__
  40. #ifdef __LITTLE_ENDIAN__
  41. #define __IEEE_LITTLE_ENDIAN
  42. #else
  43. #define __IEEE_BIG_ENDIAN
  44. #endif
  45. #endif
  46. #if defined(__m68k__) || defined(__mc68000__)
  47. #define __IEEE_BIG_ENDIAN
  48. #endif
  49. #if defined (__H8300__) || defined (__H8300H__)
  50. #define __IEEE_BIG_ENDIAN
  51. #define __SMALL_BITFIELDS
  52. #define _DOUBLE_IS_32BITS
  53. #endif
  54. #ifdef __H8500__
  55. #define __IEEE_BIG_ENDIAN
  56. #define __SMALL_BITFIELDS
  57. #define _DOUBLE_IS_32BITS
  58. #endif
  59. #ifdef __sh__
  60. #ifdef __LITTLE_ENDIAN__
  61. #define __IEEE_LITTLE_ENDIAN
  62. #else
  63. #define __IEEE_BIG_ENDIAN
  64. #endif
  65. #ifdef __SH3E__
  66. #define _DOUBLE_IS_32BITS
  67. #endif
  68. #endif
  69. #ifdef _AM29K
  70. #define __IEEE_BIG_ENDIAN
  71. #endif
  72. #ifdef __i386__
  73. #define __IEEE_LITTLE_ENDIAN
  74. #endif
  75. #ifdef __x86_64__
  76. #define __IEEE_LITTLE_ENDIAN
  77. #endif
  78. #ifdef __i960__
  79. #define __IEEE_LITTLE_ENDIAN
  80. #endif
  81. #ifdef __AVR32__
  82. #define __IEEE_BIG_ENDIAN
  83. #endif
  84. #ifdef __MIPSEL__
  85. #define __IEEE_LITTLE_ENDIAN
  86. #endif
  87. #ifdef __MIPSEB__
  88. #define __IEEE_BIG_ENDIAN
  89. #endif
  90. #ifdef __pj__
  91. #ifdef __pjl__
  92. #define __IEEE_LITTLE_ENDIAN
  93. #else
  94. #define __IEEE_BIG_ENDIAN
  95. #endif
  96. #endif
  97. /* necv70 was __IEEE_LITTLE_ENDIAN. */
  98. #ifdef __W65__
  99. #define __IEEE_LITTLE_ENDIAN
  100. #define __SMALL_BITFIELDS
  101. #define _DOUBLE_IS_32BITS
  102. #endif
  103. #if defined(__Z8001__) || defined(__Z8002__)
  104. #define __IEEE_BIG_ENDIAN
  105. #endif
  106. #ifdef __m88k__
  107. #define __IEEE_BIG_ENDIAN
  108. #endif
  109. #ifdef __v800
  110. #define __IEEE_LITTLE_ENDIAN
  111. #endif
  112. #if defined (__PPC__) || defined (__ppc__) || defined (__powerpc__) || defined (__ppc64__) || defined (_POWER) || defined (_IBMR2)
  113. #if (defined(_BIG_ENDIAN) && _BIG_ENDIAN) || (defined(_AIX) && _AIX) || defined (__BIG_ENDIAN__)|| defined (__APPLE__)
  114. #define __IEEE_BIG_ENDIAN
  115. #else
  116. #if (defined(_LITTLE_ENDIAN) && _LITTLE_ENDIAN) || (defined(__sun__) && __sun__) || (defined(__WIN32__) && __WIN32__)
  117. #define __IEEE_LITTLE_ENDIAN
  118. #endif
  119. #endif
  120. #endif
  121. #ifdef __fr30__
  122. #define __IEEE_BIG_ENDIAN
  123. #endif
  124. #ifdef __mcore__
  125. #define __IEEE_BIG_ENDIAN
  126. #endif
  127. #ifdef __ia64__
  128. #ifdef __BIG_ENDIAN__
  129. #define __IEEE_BIG_ENDIAN
  130. #else
  131. #define __IEEE_LITTLE_ENDIAN
  132. #endif
  133. #endif
  134. #ifdef __s390__
  135. #define __IEEE_BIG_ENDIAN
  136. #endif
  137. #ifndef __IEEE_BIG_ENDIAN
  138. #ifndef __IEEE_LITTLE_ENDIAN
  139. #error Endianess not declared!!
  140. #endif /* not __IEEE_LITTLE_ENDIAN */
  141. #endif /* not __IEEE_BIG_ENDIAN */
  142. #endif /* not __IEEE_LITTLE_ENDIAN */
  143. #endif /* not __IEEE_BIG_ENDIAN */
  144. #endif /* __CLASSPATH_IEEEFP_H__ */