OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.18.0/] [newlib/] [libc/] [include/] [machine/] [ieeefp.h] - Blame information for rev 258

Go to most recent revision | Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.