1 /* Copyright (C) 1992, 1995, 1996, 1999, 2006 Free Software Foundation, Inc.
3 This file is part of GCC.
5 GCC is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free
7 Software Foundation; either version 2, or (at your option) any later
10 In addition to the permissions in the GNU General Public License, the
11 Free Software Foundation gives you unlimited permission to link the
12 compiled version of this file into combinations with other programs,
13 and to distribute those combinations without any restriction coming
14 from the use of this file. (The General Public License restrictions
15 do apply in other respects; for example, they cover modification of
16 the file, and distribution when not linked into a combine
19 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
20 WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24 You should have received a copy of the GNU General Public License
25 along with GCC; see the file COPYING. If not, write to the Free
26 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
38 /* This is the IEEE 754 single-precision format. */
41 #if __BYTE_ORDER == __BIG_ENDIAN
42 unsigned int negative
:1;
43 unsigned int exponent
:8;
44 unsigned int mantissa
:23;
45 #endif /* Big endian. */
46 #if __BYTE_ORDER == __LITTLE_ENDIAN
47 unsigned int mantissa
:23;
48 unsigned int exponent
:8;
49 unsigned int negative
:1;
50 #endif /* Little endian. */
53 /* This format makes it easier to see if a NaN is a signalling NaN. */
56 #if __BYTE_ORDER == __BIG_ENDIAN
57 unsigned int negative
:1;
58 unsigned int exponent
:8;
59 unsigned int quiet_nan
:1;
60 unsigned int mantissa
:22;
61 #endif /* Big endian. */
62 #if __BYTE_ORDER == __LITTLE_ENDIAN
63 unsigned int mantissa
:22;
64 unsigned int quiet_nan
:1;
65 unsigned int exponent
:8;
66 unsigned int negative
:1;
67 #endif /* Little endian. */
71 #define IEEE754_FLOAT_BIAS 0x7f /* Added to exponent. */
78 /* This is the IEEE 754 double-precision format. */
81 #if __BYTE_ORDER == __BIG_ENDIAN
82 unsigned int negative
:1;
83 unsigned int exponent
:11;
84 /* Together these comprise the mantissa. */
85 unsigned int mantissa0
:20;
86 unsigned int mantissa1
:32;
87 #endif /* Big endian. */
88 #if __BYTE_ORDER == __LITTLE_ENDIAN
89 # if __FLOAT_WORD_ORDER == BIG_ENDIAN
90 unsigned int mantissa0
:20;
91 unsigned int exponent
:11;
92 unsigned int negative
:1;
93 unsigned int mantissa1
:32;
95 /* Together these comprise the mantissa. */
96 unsigned int mantissa1
:32;
97 unsigned int mantissa0
:20;
98 unsigned int exponent
:11;
99 unsigned int negative
:1;
101 #endif /* Little endian. */
104 /* This format makes it easier to see if a NaN is a signalling NaN. */
107 #if __BYTE_ORDER == __BIG_ENDIAN
108 unsigned int negative
:1;
109 unsigned int exponent
:11;
110 unsigned int quiet_nan
:1;
111 /* Together these comprise the mantissa. */
112 unsigned int mantissa0
:19;
113 unsigned int mantissa1
:32;
115 # if __FLOAT_WORD_ORDER == BIG_ENDIAN
116 unsigned int mantissa0
:19;
117 unsigned int quiet_nan
:1;
118 unsigned int exponent
:11;
119 unsigned int negative
:1;
120 unsigned int mantissa1
:32;
122 /* Together these comprise the mantissa. */
123 unsigned int mantissa1
:32;
124 unsigned int mantissa0
:19;
125 unsigned int quiet_nan
:1;
126 unsigned int exponent
:11;
127 unsigned int negative
:1;
133 #define IEEE754_DOUBLE_BIAS 0x3ff /* Added to exponent. */
136 #endif /* ieee754.h */