2 * Definitions for IEEE Double Precision
5 #if _FP_W_TYPE_SIZE < 32
6 #error "Here's a nickel kid. Go buy yourself a real computer."
9 #if _FP_W_TYPE_SIZE < 64
10 #define _FP_FRACTBITS_D (2 * _FP_W_TYPE_SIZE)
12 #define _FP_FRACTBITS_D _FP_W_TYPE_SIZE
15 #define _FP_FRACBITS_D 53
16 #define _FP_FRACXBITS_D (_FP_FRACTBITS_D - _FP_FRACBITS_D)
17 #define _FP_WFRACBITS_D (_FP_WORKBITS + _FP_FRACBITS_D)
18 #define _FP_WFRACXBITS_D (_FP_FRACTBITS_D - _FP_WFRACBITS_D)
19 #define _FP_EXPBITS_D 11
20 #define _FP_EXPBIAS_D 1023
21 #define _FP_EXPMAX_D 2047
23 #define _FP_QNANBIT_D \
24 ((_FP_W_TYPE)1 << ((_FP_FRACBITS_D-2) % _FP_W_TYPE_SIZE))
25 #define _FP_IMPLBIT_D \
26 ((_FP_W_TYPE)1 << ((_FP_FRACBITS_D-1) % _FP_W_TYPE_SIZE))
27 #define _FP_OVERFLOW_D \
28 ((_FP_W_TYPE)1 << (_FP_WFRACBITS_D % _FP_W_TYPE_SIZE))
30 #if _FP_W_TYPE_SIZE < 64
36 #if __BYTE_ORDER == __BIG_ENDIAN
38 unsigned exp
: _FP_EXPBITS_D
;
39 unsigned frac1
: _FP_FRACBITS_D
- (_FP_IMPLBIT_D
!= 0) - _FP_W_TYPE_SIZE
;
40 unsigned frac0
: _FP_W_TYPE_SIZE
;
42 unsigned frac0
: _FP_W_TYPE_SIZE
;
43 unsigned frac1
: _FP_FRACBITS_D
- (_FP_IMPLBIT_D
!= 0) - _FP_W_TYPE_SIZE
;
44 unsigned exp
: _FP_EXPBITS_D
;
47 } bits
__attribute__((packed
));
50 #define FP_DECL_D(X) _FP_DECL(2,X)
51 #define FP_UNPACK_RAW_D(X,val) _FP_UNPACK_RAW_2(D,X,val)
52 #define FP_PACK_RAW_D(val,X) _FP_PACK_RAW_2(D,val,X)
54 #define FP_UNPACK_D(X,val) \
56 _FP_UNPACK_RAW_2(D,X,val); \
57 _FP_UNPACK_CANONICAL(D,2,X); \
60 #define FP_PACK_D(val,X) \
62 _FP_PACK_CANONICAL(D,2,X); \
63 _FP_PACK_RAW_2(D,val,X); \
66 #define FP_NEG_D(R,X) _FP_NEG(D,2,R,X)
67 #define FP_ADD_D(R,X,Y) _FP_ADD(D,2,R,X,Y)
68 #define FP_SUB_D(R,X,Y) _FP_SUB(D,2,R,X,Y)
69 #define FP_MUL_D(R,X,Y) _FP_MUL(D,2,R,X,Y)
70 #define FP_DIV_D(R,X,Y) _FP_DIV(D,2,R,X,Y)
71 #define FP_SQRT_D(R,X) _FP_SQRT(D,2,R,X)
73 #define FP_CMP_D(r,X,Y,un) _FP_CMP(D,2,r,X,Y,un)
74 #define FP_CMP_EQ_D(r,X,Y) _FP_CMP_EQ(D,2,r,X,Y)
76 #define FP_TO_INT_D(r,X,rsz,rsg) _FP_TO_INT(D,2,r,X,rsz,rsg)
77 #define FP_FROM_INT_D(X,r,rs,rt) _FP_FROM_INT(D,2,X,r,rs,rt)
85 #if __BYTE_ORDER == __BIG_ENDIAN
87 unsigned exp
: _FP_EXPBITS_D
;
88 unsigned long frac
: _FP_FRACBITS_D
- (_FP_IMPLBIT_D
!= 0);
90 unsigned long frac
: _FP_FRACBITS_D
- (_FP_IMPLBIT_D
!= 0);
91 unsigned exp
: _FP_EXPBITS_D
;
94 } bits
__attribute__((packed
));
97 #define FP_DECL_D(X) _FP_DECL(1,X)
98 #define FP_UNPACK_RAW_D(X,val) _FP_UNPACK_RAW_1(D,X,val)
99 #define FP_PACK_RAW_D(val,X) _FP_PACK_RAW_1(D,val,X)
101 #define FP_UNPACK_D(X,val) \
103 _FP_UNPACK_RAW_1(D,X,val); \
104 _FP_UNPACK_CANONICAL(D,1,X); \
107 #define FP_PACK_D(val,X) \
109 _FP_PACK_CANONICAL(D,1,X); \
110 _FP_PACK_RAW_1(D,val,X); \
113 #define FP_NEG_D(R,X) _FP_NEG(D,1,R,X)
114 #define FP_ADD_D(R,X,Y) _FP_ADD(D,1,R,X,Y)
115 #define FP_SUB_D(R,X,Y) _FP_SUB(D,1,R,X,Y)
116 #define FP_MUL_D(R,X,Y) _FP_MUL(D,1,R,X,Y)
117 #define FP_DIV_D(R,X,Y) _FP_DIV(D,1,R,X,Y)
118 #define FP_SQRT_D(R,X) _FP_SQRT(D,1,R,X)
120 /* The implementation of _FP_MUL_D and _FP_DIV_D should be chosen by
121 the target machine. */
123 #define FP_CMP_D(r,X,Y,un) _FP_CMP(D,1,r,X,Y,un)
124 #define FP_CMP_EQ_D(r,X,Y) _FP_CMP_EQ(D,1,r,X,Y)
126 #define FP_TO_INT_D(r,X,rsz,rsg) _FP_TO_INT(D,1,r,X,rsz,rsg)
127 #define FP_FROM_INT_D(X,r,rs,rt) _FP_FROM_INT(D,1,X,r,rs,rt)
129 #endif /* W_TYPE_SIZE < 64 */