1 #ifndef __IEEE_BIG_ENDIAN
2 #ifndef __IEEE_LITTLE_ENDIAN
4 /* This file can define macros to choose variations of the IEEE float
7 _FLT_LARGEST_EXPONENT_IS_NORMAL
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.
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.
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.
24 Defined if the float format is big endian. This is mutually exclusive
25 with __IEEE_LITTLE_ENDIAN.
29 Defined if the float format is little endian. This is mutually exclusive
30 with __IEEE_BIG_ENDIAN.
32 Note that one of __IEEE_BIG_ENDIAN or __IEEE_LITTLE_ENDIAN must be specified for a
33 platform or error will occur.
35 __IEEE_BYTES_LITTLE_ENDIAN
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.
43 This is used on platforms that support double by using the 32-bit IEEE
48 This represents what type a float arg is passed as. It is used when the type is
49 not promoted to double.
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. */
60 # define __IEEE_LITTLE_ENDIAN
62 # define __IEEE_BIG_ENDIAN
65 # define __IEEE_BIG_ENDIAN
67 # define __IEEE_BYTES_LITTLE_ENDIAN
73 #define __IEEE_BIG_ENDIAN
77 #define __IEEE_BIG_ENDIAN
79 #define isfinite(__y) \
80 (__extension__ ({int __cy; \
81 (sizeof (__y) == sizeof (float)) ? (1) : \
82 (__cy = fpclassify(__y)) != FP_INFINITE && __cy != FP_NAN;}))
84 #define isinf(__x) ((sizeof (__x) == sizeof (float)) ? (0) : __isinfd(__x))
85 #define isnan(__x) ((sizeof (__x) == sizeof (float)) ? (0) : __isnand(__x))
88 * Macros for use in ieeefp.h. We can't just define the real ones here
89 * (like those above) as we have name space issues when this is *not*
90 * included via generic the ieeefp.h.
92 #define __ieeefp_isnanf(x) 0
93 #define __ieeefp_isinff(x) 0
94 #define __ieeefp_finitef(x) 1
98 #ifdef __LITTLE_ENDIAN_DATA__
99 #define __IEEE_LITTLE_ENDIAN
101 #define __IEEE_BIG_ENDIAN
105 #if defined(__m68k__) || defined(__mc68000__)
106 #define __IEEE_BIG_ENDIAN
109 #if defined(__mc68hc11__) || defined(__mc68hc12__) || defined(__mc68hc1x__)
110 #define __IEEE_BIG_ENDIAN
111 #ifdef __HAVE_SHORT_DOUBLE__
112 # define _DOUBLE_IS_32BITS
116 #if defined (__H8300__) || defined (__H8300H__) || defined (__H8300S__) || defined (__H8500__) || defined (__H8300SX__)
117 #define __IEEE_BIG_ENDIAN
118 #define _FLOAT_ARG float
119 #define _DOUBLE_IS_32BITS
122 #if defined (__xc16x__) || defined (__xc16xL__) || defined (__xc16xS__)
123 #define __IEEE_LITTLE_ENDIAN
124 #define _FLOAT_ARG float
125 #define _DOUBLE_IS_32BITS
130 #ifdef __LITTLE_ENDIAN__
131 #define __IEEE_LITTLE_ENDIAN
133 #define __IEEE_BIG_ENDIAN
135 #if defined(__SH2E__) || defined(__SH3E__) || defined(__SH4_SINGLE_ONLY__) || defined(__SH2A_SINGLE_ONLY__)
136 #define _DOUBLE_IS_32BITS
141 #define __IEEE_BIG_ENDIAN
145 #define __IEEE_LITTLE_ENDIAN
149 #define __IEEE_LITTLE_ENDIAN
153 #define __IEEE_LITTLE_ENDIAN
157 #define __IEEE_BIG_ENDIAN
161 #define __IEEE_BIG_ENDIAN
164 #if defined(_C4x) || defined(_C3x)
165 #define __IEEE_BIG_ENDIAN
166 #define _DOUBLE_IS_32BITS
171 #define __IEEE_BIG_ENDIAN
173 #define __IEEE_LITTLE_ENDIAN
178 #define __IEEE_LITTLE_ENDIAN
182 #define __IEEE_LITTLE_ENDIAN
185 #define __IEEE_BIG_ENDIAN
189 #define __IEEE_BIG_ENDIAN
193 #define __IEEE_BIG_ENDIAN
196 /* necv70 was __IEEE_LITTLE_ENDIAN. */
199 #define __IEEE_LITTLE_ENDIAN
200 #define _DOUBLE_IS_32BITS
203 #if defined(__Z8001__) || defined(__Z8002__)
204 #define __IEEE_BIG_ENDIAN
208 #define __IEEE_BIG_ENDIAN
212 #define __IEEE_LITTLE_ENDIAN
216 #define __IEEE_LITTLE_ENDIAN
217 #define _DOUBLE_IS_32BITS
221 #define __IEEE_LITTLE_ENDIAN
225 #define __IEEE_LITTLE_ENDIAN
229 #define __IEEE_BIG_ENDIAN
231 #define _DOUBLE_IS_32BITS
236 #if (defined(_BIG_ENDIAN) && _BIG_ENDIAN) || (defined(_AIX) && _AIX)
237 #define __IEEE_BIG_ENDIAN
239 #if (defined(_LITTLE_ENDIAN) && _LITTLE_ENDIAN) || (defined(__sun__) && __sun__) || (defined(_WIN32) && _WIN32)
240 #define __IEEE_LITTLE_ENDIAN
246 #define __IEEE_LITTLE_ENDIAN
250 #ifdef __big_endian__
251 #define __IEEE_BIG_ENDIAN
253 #define __IEEE_LITTLE_ENDIAN
258 #define __IEEE_LITTLE_ENDIAN
262 #define __IEEE_BIG_ENDIAN
266 #define __IEEE_BIG_ENDIAN
270 #define __IEEE_BIG_ENDIAN
274 #define __IEEE_BIG_ENDIAN
278 #define __IEEE_BIG_ENDIAN
282 #ifdef __BIG_ENDIAN__
283 #define __IEEE_BIG_ENDIAN
285 #define __IEEE_LITTLE_ENDIAN
290 #define __IEEE_LITTLE_ENDIAN
291 #define _DOUBLE_IS_32BITS
294 #if defined(__or32__) || defined(__or1k__) || defined(__or16__)
295 #define __IEEE_BIG_ENDIAN
299 #define __IEEE_BIG_ENDIAN
300 #define __SMALL_BITFIELDS
301 #define _DOUBLE_IS_32BITS
305 #define __IEEE_BIG_ENDIAN
310 # define __IEEE_LITTLE_ENDIAN
311 #else /* must be __ARMEB__ */
312 # define __IEEE_BIG_ENDIAN
313 #endif /* __ARMEL__ */
314 #endif /* __MAVERICK__ */
317 #define __IEEE_LITTLE_ENDIAN
318 #define __SMALL_BITFIELDS
322 #define __IEEE_LITTLE_ENDIAN
326 #define __IEEE_LITTLE_ENDIAN
330 #define __IEEE_LITTLE_ENDIAN
334 #ifdef __LITTLE_ENDIAN__
335 #define __IEEE_LITTLE_ENDIAN
337 #define __IEEE_BIG_ENDIAN
341 #ifdef __MICROBLAZE__
342 #define __IEEE_BIG_ENDIAN
346 #define __IEEE_LITTLE_ENDIAN
347 #define __SMALL_BITFIELDS /* 16 Bit INT */
348 #define _DOUBLE_IS_32BITS
353 #ifdef __RX_BIG_ENDIAN__
354 #define __IEEE_BIG_ENDIAN
356 #define __IEEE_LITTLE_ENDIAN
359 #ifndef __RX_64BIT_DOUBLES__
360 #define _DOUBLE_IS_32BITS
363 #ifdef __RX_16BIT_INTS__
364 #define __SMALL_BITFIELDS
369 #if (defined(__CR16__) || defined(__CR16C__) ||defined(__CR16CP__))
370 #define __IEEE_LITTLE_ENDIAN
371 #define __SMALL_BITFIELDS /* 16 Bit INT */
374 #ifndef __IEEE_BIG_ENDIAN
375 #ifndef __IEEE_LITTLE_ENDIAN
376 #error Endianess not declared!!
377 #endif /* not __IEEE_LITTLE_ENDIAN */
378 #endif /* not __IEEE_BIG_ENDIAN */
380 #endif /* not __IEEE_LITTLE_ENDIAN */
381 #endif /* not __IEEE_BIG_ENDIAN */