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__) 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__) 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 __fr30__ 218: #define __IEEE_BIG_ENDIAN 219: #endif 220: 221: #ifdef __mcore__ 222: #define __IEEE_BIG_ENDIAN 223: #endif 224: 225: #ifdef __frv__ 226: #define __IEEE_BIG_ENDIAN 227: #endif 228: 229: #ifdef __ia64__ 230: #ifdef __BIG_ENDIAN__ 231: #define __IEEE_BIG_ENDIAN 232: #else 233: #define __IEEE_LITTLE_ENDIAN 234: #endif 235: #endif 236: 237: #ifdef __AVR__ 238: #define __IEEE_LITTLE_ENDIAN 239: #define _DOUBLE_IS_32BITS 240: #endif 241: 242: #if defined(__or32__) || defined(__or1k__) || defined(__or16__) 243: #define __IEEE_BIG_ENDIAN 244: #endif 245: 246: #ifdef __IP2K__ 247: #define __IEEE_BIG_ENDIAN 248: #define __SMALL_BITFIELDS 249: #define _DOUBLE_IS_32BITS 250: #endif 251: 252: #ifdef __iq2000__ 253: #define __IEEE_BIG_ENDIAN 254: #endif 255: 256: #ifdef __MAVERICK__ 257: #ifdef __ARMEL__ 258: # define __IEEE_LITTLE_ENDIAN 259: #else /* must be __ARMEB__ */ 260: # define __IEEE_BIG_ENDIAN 261: #endif /* __ARMEL__ */ 262: #endif /* __MAVERICK__ */ 263: 264: #ifndef __IEEE_BIG_ENDIAN 265: #ifndef __IEEE_LITTLE_ENDIAN 266: #error Endianess not declared!! 267: #endif /* not __IEEE_LITTLE_ENDIAN */ 268: #endif /* not __IEEE_BIG_ENDIAN */ 269: 270: #endif /* not __IEEE_LITTLE_ENDIAN */ 271: #endif /* not __IEEE_BIG_ENDIAN */ 272: 273: