Subversion Repositories Kolibri OS

Rev

Rev 4921 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4349 Serge 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_32BITS
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
 
4921 Serge 72
#if defined (__aarch64__)
73
#if defined (__AARCH64EL__)
74
#define __IEEE_LITTLE_ENDIAN
75
#else
76
#define __IEEE_BIG_ENDIAN
77
#endif
78
#endif
79
 
80
#ifdef __epiphany__
81
#define __IEEE_LITTLE_ENDIAN
82
#define Sudden_Underflow 1
83
#endif
84
 
4349 Serge 85
#ifdef __hppa__
86
#define __IEEE_BIG_ENDIAN
87
#endif
88
 
4921 Serge 89
#ifdef __nds32__
90
#ifdef __big_endian__
91
#define __IEEE_BIG_ENDIAN
92
#else
93
#define __IEEE_LITTLE_ENDIAN
94
#endif
95
#endif
96
 
4349 Serge 97
#ifdef __SPU__
98
#define __IEEE_BIG_ENDIAN
99
 
100
#define isfinite(__y) \
101
	(__extension__ ({int __cy; \
6099 serge 102
		(sizeof (__y) == sizeof (float))  ? (1) : \
4349 Serge 103
		(__cy = fpclassify(__y)) != FP_INFINITE && __cy != FP_NAN;}))
104
 
105
#define isinf(__x) ((sizeof (__x) == sizeof (float))  ?  (0) : __isinfd(__x))
106
#define isnan(__x) ((sizeof (__x) == sizeof (float))  ?  (0) : __isnand(__x))
107
 
108
/*
109
 * Macros for use in ieeefp.h. We can't just define the real ones here
110
 * (like those above) as we have name space issues when this is *not*
111
 * included via generic the ieeefp.h.
112
 */
113
#define __ieeefp_isnanf(x)	0
114
#define __ieeefp_isinff(x)	0
115
#define __ieeefp_finitef(x)	1
116
#endif
117
 
118
#ifdef __sparc__
119
#ifdef __LITTLE_ENDIAN_DATA__
120
#define __IEEE_LITTLE_ENDIAN
121
#else
122
#define __IEEE_BIG_ENDIAN
123
#endif
124
#endif
125
 
126
#if defined(__m68k__) || defined(__mc68000__)
127
#define __IEEE_BIG_ENDIAN
128
#endif
129
 
130
#if defined(__mc68hc11__) || defined(__mc68hc12__) || defined(__mc68hc1x__)
131
#define __IEEE_BIG_ENDIAN
132
#ifdef __HAVE_SHORT_DOUBLE__
133
# define _DOUBLE_IS_32BITS
134
#endif
135
#endif
136
 
137
#if defined (__H8300__) || defined (__H8300H__) || defined (__H8300S__) || defined (__H8500__) || defined (__H8300SX__)
138
#define __IEEE_BIG_ENDIAN
139
#define _FLOAT_ARG float
140
#define _DOUBLE_IS_32BITS
141
#endif
142
 
143
#if defined (__xc16x__) || defined (__xc16xL__) || defined (__xc16xS__)
144
#define __IEEE_LITTLE_ENDIAN
145
#define _FLOAT_ARG float
146
#define _DOUBLE_IS_32BITS
147
#endif
148
 
149
 
150
#ifdef __sh__
151
#ifdef __LITTLE_ENDIAN__
152
#define __IEEE_LITTLE_ENDIAN
153
#else
154
#define __IEEE_BIG_ENDIAN
155
#endif
156
#if defined(__SH2E__) || defined(__SH3E__) || defined(__SH4_SINGLE_ONLY__) || defined(__SH2A_SINGLE_ONLY__)
157
#define _DOUBLE_IS_32BITS
158
#endif
159
#endif
160
 
161
#ifdef _AM29K
162
#define __IEEE_BIG_ENDIAN
163
#endif
164
 
165
#ifdef _WIN32
166
#define __IEEE_LITTLE_ENDIAN
167
#endif
168
 
169
#ifdef __i386__
170
#define __IEEE_LITTLE_ENDIAN
171
#endif
172
 
173
#ifdef __i960__
174
#define __IEEE_LITTLE_ENDIAN
175
#endif
176
 
177
#ifdef __lm32__
178
#define __IEEE_BIG_ENDIAN
179
#endif
180
 
181
#ifdef __M32R__
182
#define __IEEE_BIG_ENDIAN
183
#endif
184
 
185
#if defined(_C4x) || defined(_C3x)
186
#define __IEEE_BIG_ENDIAN
187
#define _DOUBLE_IS_32BITS
188
#endif
189
 
190
#ifdef __TMS320C6X__
191
#ifdef _BIG_ENDIAN
192
#define __IEEE_BIG_ENDIAN
193
#else
194
#define __IEEE_LITTLE_ENDIAN
195
#endif
196
#endif
197
 
198
#ifdef __TIC80__
199
#define __IEEE_LITTLE_ENDIAN
200
#endif
201
 
202
#ifdef __MIPSEL__
203
#define __IEEE_LITTLE_ENDIAN
204
#endif
205
#ifdef __MIPSEB__
206
#define __IEEE_BIG_ENDIAN
207
#endif
208
 
209
#ifdef __MMIX__
210
#define __IEEE_BIG_ENDIAN
211
#endif
212
 
213
#ifdef __D30V__
214
#define __IEEE_BIG_ENDIAN
215
#endif
216
 
217
/* necv70 was __IEEE_LITTLE_ENDIAN. */
218
 
219
#ifdef __W65__
220
#define __IEEE_LITTLE_ENDIAN
221
#define _DOUBLE_IS_32BITS
222
#endif
223
 
224
#if defined(__Z8001__) || defined(__Z8002__)
225
#define __IEEE_BIG_ENDIAN
226
#endif
227
 
228
#ifdef __m88k__
229
#define __IEEE_BIG_ENDIAN
230
#endif
231
 
232
#ifdef __mn10300__
233
#define __IEEE_LITTLE_ENDIAN
234
#endif
235
 
236
#ifdef __mn10200__
237
#define __IEEE_LITTLE_ENDIAN
238
#define _DOUBLE_IS_32BITS
239
#endif
240
 
241
#ifdef __v800
242
#define __IEEE_LITTLE_ENDIAN
243
#endif
244
 
245
#ifdef __v850
246
#define __IEEE_LITTLE_ENDIAN
247
#endif
248
 
249
#ifdef __D10V__
250
#define __IEEE_BIG_ENDIAN
251
#if __DOUBLE__ == 32
252
#define _DOUBLE_IS_32BITS
253
#endif
254
#endif
255
 
256
#ifdef __PPC__
257
#if (defined(_BIG_ENDIAN) && _BIG_ENDIAN) || (defined(_AIX) && _AIX)
258
#define __IEEE_BIG_ENDIAN
259
#else
260
#if (defined(_LITTLE_ENDIAN) && _LITTLE_ENDIAN) || (defined(__sun__) && __sun__) || (defined(_WIN32) && _WIN32)
261
#define __IEEE_LITTLE_ENDIAN
262
#endif
263
#endif
264
#endif
265
 
266
#ifdef __xstormy16__
267
#define __IEEE_LITTLE_ENDIAN
268
#endif
269
 
270
#ifdef __arc__
271
#ifdef __big_endian__
272
#define __IEEE_BIG_ENDIAN
273
#else
274
#define __IEEE_LITTLE_ENDIAN
275
#endif
276
#endif
277
 
278
#ifdef __CRX__
279
#define __IEEE_LITTLE_ENDIAN
280
#endif
281
 
282
#ifdef __fr30__
283
#define __IEEE_BIG_ENDIAN
284
#endif
285
 
6099 serge 286
#ifdef __FT32__
287
#define __IEEE_LITTLE_ENDIAN
288
#endif
289
 
4349 Serge 290
#ifdef __mcore__
291
#define __IEEE_BIG_ENDIAN
292
#endif
293
 
294
#ifdef __mt__
295
#define __IEEE_BIG_ENDIAN
296
#endif
297
 
298
#ifdef __frv__
299
#define __IEEE_BIG_ENDIAN
300
#endif
301
 
302
#ifdef __moxie__
4921 Serge 303
#ifdef __MOXIE_BIG_ENDIAN__
4349 Serge 304
#define __IEEE_BIG_ENDIAN
4921 Serge 305
#else
306
#define __IEEE_LITTLE_ENDIAN
4349 Serge 307
#endif
4921 Serge 308
#endif
4349 Serge 309
 
310
#ifdef __ia64__
311
#ifdef __BIG_ENDIAN__
312
#define __IEEE_BIG_ENDIAN
313
#else
314
#define __IEEE_LITTLE_ENDIAN
315
#endif
316
#endif
317
 
318
#ifdef __AVR__
319
#define __IEEE_LITTLE_ENDIAN
320
#define _DOUBLE_IS_32BITS
321
#endif
322
 
6099 serge 323
#if defined(__or1k__) || defined(__OR1K__) || defined(__OR1KND__)
4349 Serge 324
#define __IEEE_BIG_ENDIAN
325
#endif
326
 
327
#ifdef __IP2K__
328
#define __IEEE_BIG_ENDIAN
329
#define __SMALL_BITFIELDS
330
#define _DOUBLE_IS_32BITS
331
#endif
332
 
333
#ifdef __iq2000__
334
#define __IEEE_BIG_ENDIAN
335
#endif
336
 
337
#ifdef __MAVERICK__
338
#ifdef __ARMEL__
339
#  define __IEEE_LITTLE_ENDIAN
340
#else  /* must be __ARMEB__ */
341
#  define __IEEE_BIG_ENDIAN
342
#endif /* __ARMEL__ */
343
#endif /* __MAVERICK__ */
344
 
345
#ifdef __m32c__
346
#define __IEEE_LITTLE_ENDIAN
347
#define __SMALL_BITFIELDS
348
#endif
349
 
350
#ifdef __CRIS__
351
#define __IEEE_LITTLE_ENDIAN
352
#endif
353
 
354
#ifdef __BFIN__
355
#define __IEEE_LITTLE_ENDIAN
356
#endif
357
 
358
#ifdef __x86_64__
359
#define __IEEE_LITTLE_ENDIAN
360
#endif
361
 
362
#ifdef __mep__
363
#ifdef __LITTLE_ENDIAN__
364
#define __IEEE_LITTLE_ENDIAN
365
#else
366
#define __IEEE_BIG_ENDIAN
367
#endif
368
#endif
369
 
370
#ifdef __MICROBLAZE__
4921 Serge 371
#ifndef __MICROBLAZEEL__
4349 Serge 372
#define __IEEE_BIG_ENDIAN
4921 Serge 373
#else
374
#define __IEEE_LITTLE_ENDIAN
4349 Serge 375
#endif
4921 Serge 376
#endif
4349 Serge 377
 
4921 Serge 378
#ifdef __MSP430__
379
#define __IEEE_LITTLE_ENDIAN
380
#define __SMALL_BITFIELDS	/* 16 Bit INT */
381
#endif
382
 
4349 Serge 383
#ifdef __RL78__
384
#define __IEEE_LITTLE_ENDIAN
385
#define __SMALL_BITFIELDS	/* 16 Bit INT */
6099 serge 386
#ifndef __RL78_64BIT_DOUBLES__
4349 Serge 387
#define _DOUBLE_IS_32BITS
388
#endif
6099 serge 389
#endif
4349 Serge 390
 
391
#ifdef __RX__
392
 
393
#ifdef __RX_BIG_ENDIAN__
394
#define __IEEE_BIG_ENDIAN
395
#else
396
#define __IEEE_LITTLE_ENDIAN
397
#endif
398
 
399
#ifndef __RX_64BIT_DOUBLES__
400
#define _DOUBLE_IS_32BITS
401
#endif
402
 
403
#ifdef __RX_16BIT_INTS__
404
#define __SMALL_BITFIELDS
405
#endif
406
 
407
#endif
408
 
409
#if (defined(__CR16__) || defined(__CR16C__) ||defined(__CR16CP__))
410
#define __IEEE_LITTLE_ENDIAN
411
#define __SMALL_BITFIELDS	/* 16 Bit INT */
412
#endif
413
 
4921 Serge 414
#ifdef __NIOS2__
415
# ifdef __nios2_big_endian__
416
#  define __IEEE_BIG_ENDIAN
417
# else
418
#  define __IEEE_LITTLE_ENDIAN
419
# endif
420
#endif
421
 
6099 serge 422
#ifdef __VISIUM__
423
#define __IEEE_BIG_ENDIAN
424
#endif
425
 
4349 Serge 426
#ifndef __IEEE_BIG_ENDIAN
427
#ifndef __IEEE_LITTLE_ENDIAN
428
#error Endianess not declared!!
429
#endif /* not __IEEE_LITTLE_ENDIAN */
430
#endif /* not __IEEE_BIG_ENDIAN */
431
 
432
#endif /* not __IEEE_LITTLE_ENDIAN */
433
#endif /* not __IEEE_BIG_ENDIAN */
434