1 /* Copyright (C) 1992, 1995 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If
16 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
17 Cambridge, MA 02139, USA. */
25 /* This is the IEEE 754 single-precision format. */
28 #if __BYTE_ORDER == __BIG_ENDIAN
29 unsigned int negative
:1;
30 unsigned int exponent
:8;
31 unsigned int mantissa
:23;
32 #endif /* Big endian. */
33 #if __BYTE_ORDER == __LITTLE_ENDIAN
34 unsigned int mantissa
:23;
35 unsigned int exponent
:8;
36 unsigned int negative
:1;
37 #endif /* Little endian. */
40 /* This format makes it easier to see if a NaN is a signalling NaN. */
43 #if __BYTE_ORDER == __BIG_ENDIAN
44 unsigned int negative
:1;
45 unsigned int exponent
:8;
46 unsigned int quiet_nan
:1;
47 unsigned int mantissa
:22;
48 #endif /* Big endian. */
49 #if __BYTE_ORDER == __LITTLE_ENDIAN
50 unsigned int mantissa
:22;
51 unsigned int quiet_nan
:1;
52 unsigned int exponent
:8;
53 unsigned int negative
:1;
54 #endif /* Little endian. */
58 #define IEEE754_FLOAT_BIAS 0x7f /* Added to exponent. */
65 /* This is the IEEE 754 double-precision format. */
68 #if __BYTE_ORDER == __BIG_ENDIAN
69 unsigned int negative
:1;
70 unsigned int exponent
:11;
71 /* Together these comprise the mantissa. */
72 unsigned int mantissa0
:20;
73 unsigned int mantissa1
:32;
74 #endif /* Big endian. */
75 #if __BYTE_ORDER == __LITTLE_ENDIAN
76 /* Together these comprise the mantissa. */
77 unsigned int mantissa1
:32;
78 unsigned int mantissa0
:20;
79 unsigned int exponent
:11;
80 unsigned int negative
:1;
81 #endif /* Little endian. */
84 /* This format makes it easier to see if a NaN is a signalling NaN. */
87 #if __BYTE_ORDER == __BIG_ENDIAN
88 unsigned int negative
:1;
89 unsigned int exponent
:11;
90 unsigned int quiet_nan
:1;
91 /* Together these conprise the mantissa. */
92 unsigned int mantissa0
:19;
93 unsigned int mantissa1
:32;
95 /* Together these conprise the mantissa. */
96 unsigned int mantissa1
:32;
97 unsigned int mantissa0
:19;
98 unsigned int quiet_nan
:1;
99 unsigned int exponent
:11;
100 unsigned int negative
:1;
105 #define IEEE754_DOUBLE_BIAS 0x3ff /* Added to exponent. */
108 union ieee854_long_double
112 /* This is the IEEE 854 double-extended-precision format. */
115 #if __BYTE_ORDER == __BIG_ENDIAN
116 unsigned int negative
:1;
117 unsigned int exponent
:15;
118 unsigned int empty
:16;
119 unsigned int mantissa0
:32;
120 unsigned int mantissa1
:32;
122 #if __BYTE_ORDER == __LITTLE_ENDIAN
123 unsigned int mantissa1
:32;
124 unsigned int mantissa0
:32;
125 unsigned int exponent
:15;
126 unsigned int negative
:1;
127 unsigned int empty
:16;
131 /* This is for NaNs in the IEEE 854 double-extended-precision format. */
134 #if __BYTE_ORDER == __BIG_ENDIAN
135 unsigned int negative
:1;
136 unsigned int exponent
:15;
137 unsigned int empty
:16;
138 unsigned int quiet_nan
:1;
139 unsigned int mantissa0
:31;
140 unsigned int mantissa1
:32;
142 #if __BYTE_ORDER == __LITTLE_ENDIAN
143 unsigned int mantissa1
:32;
144 unsigned int mantissa0
:31;
145 unsigned int quiet_nan
:1;
146 unsigned int exponent
:15;
147 unsigned int negative
:1;
148 unsigned int empty
:16;
153 #define IEEE854_LONG_DOUBLE_BIAS 0x3fff