Updated to fedora-glibc-20041124T0741
[glibc.git] / sysdeps / arm / ieee754.h
blob629b97fb1bc51fa3b5f9a6a99233ed5dc68de8ab
1 /* Copyright (C) 1992, 1995, 1996, 1998 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 Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the 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 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, write to the Free
16 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17 02111-1307 USA. */
19 #ifndef _IEEE754_H
21 #define _IEEE754_H 1
22 #include <features.h>
24 #include <endian.h>
26 __BEGIN_DECLS
28 union ieee754_float
30 float f;
32 /* This is the IEEE 754 single-precision format. */
33 struct
35 unsigned int mantissa:23;
36 unsigned int exponent:8;
37 unsigned int negative:1;
38 } ieee;
40 /* This format makes it easier to see if a NaN is a signalling NaN. */
41 struct
43 unsigned int mantissa:22;
44 unsigned int quiet_nan:1;
45 unsigned int exponent:8;
46 unsigned int negative:1;
47 } ieee_nan;
50 #define IEEE754_FLOAT_BIAS 0x7f /* Added to exponent. */
53 union ieee754_double
55 double d;
57 /* This is the IEEE 754 double-precision format. */
58 struct
60 unsigned int mantissa0:20;
61 unsigned int exponent:11;
62 unsigned int negative:1;
63 unsigned int mantissa1:32;
64 } ieee;
66 /* This format makes it easier to see if a NaN is a signalling NaN. */
67 struct
69 unsigned int mantissa0:19;
70 unsigned int quiet_nan:1;
71 unsigned int exponent:11;
72 unsigned int negative:1;
73 unsigned int mantissa1:32;
74 } ieee_nan;
77 #define IEEE754_DOUBLE_BIAS 0x3ff /* Added to exponent. */
80 /* The following two structures are correct for `new' floating point systems but
81 wrong for the old FPPC. The only solution seems to be to avoid their use on
82 old hardware. */
84 union ieee854_long_double
86 long double d;
88 /* This is the IEEE 854 double-extended-precision format. */
89 struct
91 unsigned int exponent:15;
92 unsigned int empty:16;
93 unsigned int negative:1;
94 unsigned int mantissa1:32;
95 unsigned int mantissa0:32;
96 } ieee;
98 /* This is for NaNs in the IEEE 854 double-extended-precision format. */
99 struct
101 unsigned int exponent:15;
102 unsigned int empty:16;
103 unsigned int negative:1;
104 unsigned int mantissa1:32;
105 unsigned int mantissa0:30;
106 unsigned int quiet_nan:1;
107 unsigned int one:1;
108 } ieee_nan;
111 #define IEEE854_LONG_DOUBLE_BIAS 0x3fff
113 __END_DECLS
115 #endif /* ieee754.h */