1 #ifndef __IEEE_BIG_ENDIAN 2 #ifndef __IEEE_LITTLE_ENDIAN 3 4 /* This file can define macros to choose variations of the IEEE float 5 format: 6 7 _FLT_LARGEST_EXPONENT_IS_NORMAL 8 9 Defined if the float format uses the largest exponent for finite 10 numbers rather than NaN and infinity representations. Such a 11 format cannot represent NaNs or infinities at all, but it's FLT_MAX 12 is twice the IEEE value. 13 14 _FLT_NO_DENORMALS 15 16 Defined if the float format does not support IEEE denormals. Every 17 float with a zero exponent is taken to be a zero representation. 18 19 ??? At the moment, there are no equivalent macros above for doubles and 20 the macros are not fully supported by --enable-newlib-hw-fp. 21 22 __IEEE_BIG_ENDIAN 23 24 Defined if the float format is big endian. This is mutually exclusive 25 with __IEEE_LITTLE_ENDIAN. 26 27 __IEEE_LITTLE_ENDIAN 28 29 Defined if the float format is little endian. This is mutually exclusive 30 with __IEEE_BIG_ENDIAN. 31 32 Note that one of __IEEE_BIG_ENDIAN or __IEEE_LITTLE_ENDIAN must be specified for a 33 platform or error will occur. 34 35 __IEEE_BYTES_LITTLE_ENDIAN 36 37 This flag is used in conjunction with __IEEE_BIG_ENDIAN to describe a situation 38 whereby multiple words of an IEEE floating point are in big endian order, but the 39 words themselves are little endian with respect to the bytes. 40 41 _DOUBLE_IS_32_BITS 42 43 This is used on platforms that support double by using the 32-bit IEEE 44 float type. 45 46 _FLOAT_ARG 47 48 This represents what type a float arg is passed as. It is used when the type is 49 not promoted to double. 50 51 */ 52 53 #if (defined(__arm__) || defined(__thumb__)) && !defined(__MAVERICK__) 54 /* ARM traditionally used big-endian words; and within those words the 55 byte ordering was big or little endian depending upon the target. 56 Modern floating-point formats are naturally ordered; in this case 57 __VFP_FP__ will be defined, even if soft-float. */ 58 #ifdef __VFP_FP__ 59 # ifdef __ARMEL__ 60 # define __IEEE_LITTLE_ENDIAN 61 # else 62 # define __IEEE_BIG_ENDIAN 63 # endif 64 #else 65 # define __IEEE_BIG_ENDIAN 66 # ifdef __ARMEL__ 67 # define __IEEE_BYTES_LITTLE_ENDIAN 68 # endif 69 #endif 70 #endif 71 72 #ifdef __hppa__ 73 #define __IEEE_BIG_ENDIAN 74 #endif 75 76 #ifdef __sparc__ 77 #ifdef __LITTLE_ENDIAN_DATA__ 78 #define __IEEE_LITTLE_ENDIAN 79 #else 80 #define __IEEE_BIG_ENDIAN 81 #endif 82 #endif 83 84 #if defined(__m68k__) || defined(__mc68000__) 85 #define __IEEE_BIG_ENDIAN 86 #endif 87 88 #if defined(__mc68hc11__) || defined(__mc68hc12__) || defined(__mc68hc1x__) 89 #define __IEEE_BIG_ENDIAN 90 #ifdef __HAVE_SHORT_DOUBLE__ 91 # define _DOUBLE_IS_32BITS 92 #endif 93 #endif 94 95 #if defined (__H8300__) || defined (__H8300H__) || defined (__H8300S__) || defined (__H8500__) || defined (__H8300SX__) 96 #define __IEEE_BIG_ENDIAN 97 #define _FLOAT_ARG float 98 #define _DOUBLE_IS_32BITS 99 #endif 100 101 #ifdef __sh__ 102 #ifdef __LITTLE_ENDIAN__ 103 #define __IEEE_LITTLE_ENDIAN 104 #else 105 #define __IEEE_BIG_ENDIAN 106 #endif 107 #if defined(__SH2E__) || defined(__SH3E__) || defined(__SH4_SINGLE_ONLY__) || defined(__SH2A_SINGLE_ONLY__) 108 #define _DOUBLE_IS_32BITS 109 #endif 110 #endif 111 112 #ifdef _AM29K 113 #define __IEEE_BIG_ENDIAN 114 #endif 115 116 #ifdef _WIN32 117 #define __IEEE_LITTLE_ENDIAN 118 #endif 119 120 #ifdef __i386__ 121 #define __IEEE_LITTLE_ENDIAN 122 #endif 123 124 #ifdef __i960__ 125 #define __IEEE_LITTLE_ENDIAN 126 #endif 127 128 #ifdef __M32R__ 129 #define __IEEE_BIG_ENDIAN 130 #endif 131 132 #if defined(_C4x) || defined(_C3x) 133 #define __IEEE_BIG_ENDIAN 134 #define _DOUBLE_IS_32BITS 135 #endif 136 137 #ifdef __TIC80__ 138 #define __IEEE_LITTLE_ENDIAN 139 #endif 140 141 #ifdef __MIPSEL__ 142 #define __IEEE_LITTLE_ENDIAN 143 #endif 144 #ifdef __MIPSEB__ 145 #define __IEEE_BIG_ENDIAN 146 #endif 147 148 #ifdef __MMIX__ 149 #define __IEEE_BIG_ENDIAN 150 #endif 151 152 #ifdef __D30V__ 153 #define __IEEE_BIG_ENDIAN 154 #endif 155 156 /* necv70 was __IEEE_LITTLE_ENDIAN. */ 157 158 #ifdef __W65__ 159 #define __IEEE_LITTLE_ENDIAN 160 #define _DOUBLE_IS_32BITS 161 #endif 162 163 #if defined(__Z8001__) || defined(__Z8002__) 164 #define __IEEE_BIG_ENDIAN 165 #endif 166 167 #ifdef __m88k__ 168 #define __IEEE_BIG_ENDIAN 169 #endif 170 171 #ifdef __mn10300__ 172 #define __IEEE_LITTLE_ENDIAN 173 #endif 174 175 #ifdef __mn10200__ 176 #define __IEEE_LITTLE_ENDIAN 177 #define _DOUBLE_IS_32BITS 178 #endif 179 180 #ifdef __v800 181 #define __IEEE_LITTLE_ENDIAN 182 #endif 183 184 #ifdef __v850 185 #define __IEEE_LITTLE_ENDIAN 186 #endif 187 188 #ifdef __D10V__ 189 #define __IEEE_BIG_ENDIAN 190 #if __DOUBLE__ == 32 191 #define _DOUBLE_IS_32BITS 192 #endif 193 #endif 194 195 #ifdef __PPC__ 196 #if (defined(_BIG_ENDIAN) && _BIG_ENDIAN) || (defined(_AIX) && _AIX) 197 #define __IEEE_BIG_ENDIAN 198 #else 199 #if (defined(_LITTLE_ENDIAN) && _LITTLE_ENDIAN) || (defined(__sun__) && __sun__) || (defined(_WIN32) && _WIN32) 200 #define __IEEE_LITTLE_ENDIAN 201 #endif 202 #endif 203 #endif 204 205 #ifdef __xstormy16__ 206 #define __IEEE_LITTLE_ENDIAN 207 #endif 208 209 #ifdef __arc__ 210 #ifdef __big_endian__ 211 #define __IEEE_BIG_ENDIAN 212 #else 213 #define __IEEE_LITTLE_ENDIAN 214 #endif 215 #endif 216 217 #ifdef __CRX__ 218 #define __IEEE_LITTLE_ENDIAN 219 #endif 220 221 #ifdef __fr30__ 222 #define __IEEE_BIG_ENDIAN 223 #endif 224 225 #ifdef __mcore__ 226 #define __IEEE_BIG_ENDIAN 227 #endif 228 229 #ifdef __mt__ 230 #define __IEEE_BIG_ENDIAN 231 #endif 232 233 #ifdef __frv__ 234 #define __IEEE_BIG_ENDIAN 235 #endif 236 237 #ifdef __ia64__ 238 #ifdef __BIG_ENDIAN__ 239 #define __IEEE_BIG_ENDIAN 240 #else 241 #define __IEEE_LITTLE_ENDIAN 242 #endif 243 #endif 244 245 #ifdef __AVR__ 246 #define __IEEE_LITTLE_ENDIAN 247 #define _DOUBLE_IS_32BITS 248 #endif 249 250 #if defined(__or32__) || defined(__or1k__) || defined(__or16__) 251 #define __IEEE_BIG_ENDIAN 252 #endif 253 254 #if defined(__ba__) 255 # if defined(__BA_BYTES_LITTLE__) 256 # define __IEEE_LITTLE_ENDIAN 257 # undef __IEEE_BIG_ENDIAN 258 # else 259 # define __IEEE_BIG_ENDIAN 260 # undef __IEEE_LITTLE_ENDIAN 261 # endif 262 #endif 263 264 #if 0 265 266 #if defined(__aeon__) && !defined(__AEONEL__) 267 # define __IEEE_BIG_ENDIAN 268 # undef __IEEE_LITTLE_ENDIAN 269 # else 270 # define __IEEE_LITTLE_ENDIAN 271 # undef __IEEE_BIG_ENDIAN 272 #endif 273 274 #else 275 276 #if defined(__aeon__) 277 # if defined(__AEON_BYTES_LITTLE__) 278 # define __IEEE_LITTLE_ENDIAN 279 # undef __IEEE_BIG_ENDIAN 280 # else 281 # define __IEEE_BIG_ENDIAN 282 # undef __IEEE_LITTLE_ENDIAN 283 # endif 284 #endif 285 286 #endif 287 288 #ifdef __IP2K__ 289 #define __IEEE_BIG_ENDIAN 290 #define __SMALL_BITFIELDS 291 #define _DOUBLE_IS_32BITS 292 #endif 293 294 #ifdef __iq2000__ 295 #define __IEEE_BIG_ENDIAN 296 #endif 297 298 #ifdef __MAVERICK__ 299 #ifdef __ARMEL__ 300 # define __IEEE_LITTLE_ENDIAN 301 #else /* must be __ARMEB__ */ 302 # define __IEEE_BIG_ENDIAN 303 #endif /* __ARMEL__ */ 304 #endif /* __MAVERICK__ */ 305 306 #ifdef __m32c__ 307 #define __IEEE_LITTLE_ENDIAN 308 #define __SMALL_BITFIELDS 309 #endif 310 311 #ifdef __CRIS__ 312 #define __IEEE_LITTLE_ENDIAN 313 #endif 314 315 #ifndef __IEEE_BIG_ENDIAN 316 #ifndef __IEEE_LITTLE_ENDIAN 317 #error Endianess not declared!! 318 #endif /* not __IEEE_LITTLE_ENDIAN */ 319 #endif /* not __IEEE_BIG_ENDIAN */ 320 321 #endif /* not __IEEE_LITTLE_ENDIAN */ 322 #endif /* not __IEEE_BIG_ENDIAN */ 323 324