master
1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6#ifndef _FP_CONSTS_H
7#define _FP_CONSTS_H
8
9/*
10According to IEEE 754 a QNaN has exponent bits of all 1 values and
11initial significand bit of 1. A SNaN has has an exponent of all 1
12values and initial significand bit of 0 (with one or more other
13significand bits of 1). An Inf has significand of 0 and
14exponent of all 1 values. A denormal value has all exponent bits of 0.
15*/
16
17
18#define __DOUBLE_INF_REP { 0, 0, 0, 0x7ff0 }
19#define __DOUBLE_QNAN_REP { 0, 0, 0, 0x7ff8 }
20#define __DOUBLE_SNAN_REP { 0, 0, 0, 0x7ff0 }
21#define __DOUBLE_DENORM_REP {1, 0, 0, 0}
22
23#define D_NAN_MASK 0x7ff0000000000000LL /* this will mask NaN's and Inf's */
24
25#define __FLOAT_INF_REP { 0, 0x7f80 }
26#define __FLOAT_QNAN_REP { 0, 0x7fc0 }
27#define __FLOAT_SNAN_REP { 0, 0x7f80 }
28#define __FLOAT_DENORM_REP {1,0}
29
30#define F_NAN_MASK 0x7f800000
31
32/*
33 This assumes no implicit (hidden) bit in extended mode.
34 Padded to 96 bits
35 */
36#define __LONG_DOUBLE_INF_REP { 0, 0, 0, 0x8000, 0x7fff, 0 }
37#define __LONG_DOUBLE_QNAN_REP { 0, 0, 0, 0xc000, 0x7fff, 0 }
38#define __LONG_DOUBLE_SNAN_REP { 0, 0, 0, 0x8000, 0x7fff, 0 }
39#define __LONG_DOUBLE_DENORM_REP {1, 0, 0, 0, 0, 0}
40
41union _ieee_rep
42{
43 unsigned short rep[6];
44 float float_val;
45 double double_val;
46 long double ldouble_val;
47};
48
49#endif /* _FP_CONSTS_H */
50