Go to the documentation of this file.
25 #ifndef __MATH_EMU_DOUBLE_H__
26 #define __MATH_EMU_DOUBLE_H__
28 #if _FP_W_TYPE_SIZE < 32
29 #error "Here's a nickel kid. Go buy yourself a real computer."
32 #if _FP_W_TYPE_SIZE < 64
33 #define _FP_FRACTBITS_D (2 * _FP_W_TYPE_SIZE)
35 #define _FP_FRACTBITS_D _FP_W_TYPE_SIZE
38 #define _FP_FRACBITS_D 53
39 #define _FP_FRACXBITS_D (_FP_FRACTBITS_D - _FP_FRACBITS_D)
40 #define _FP_WFRACBITS_D (_FP_WORKBITS + _FP_FRACBITS_D)
41 #define _FP_WFRACXBITS_D (_FP_FRACTBITS_D - _FP_WFRACBITS_D)
42 #define _FP_EXPBITS_D 11
43 #define _FP_EXPBIAS_D 1023
44 #define _FP_EXPMAX_D 2047
46 #define _FP_QNANBIT_D \
47 ((_FP_W_TYPE)1 << (_FP_FRACBITS_D-2) % _FP_W_TYPE_SIZE)
48 #define _FP_IMPLBIT_D \
49 ((_FP_W_TYPE)1 << (_FP_FRACBITS_D-1) % _FP_W_TYPE_SIZE)
50 #define _FP_OVERFLOW_D \
51 ((_FP_W_TYPE)1 << _FP_WFRACBITS_D % _FP_W_TYPE_SIZE)
53 #if _FP_W_TYPE_SIZE < 64
59 #if __BYTE_ORDER == __BIG_ENDIAN
73 #define FP_DECL_D(X) _FP_DECL(2,X)
74 #define FP_UNPACK_RAW_D(X,val) _FP_UNPACK_RAW_2(D,X,val)
75 #define FP_UNPACK_RAW_DP(X,val) _FP_UNPACK_RAW_2_P(D,X,val)
76 #define FP_PACK_RAW_D(val,X) _FP_PACK_RAW_2(D,val,X)
77 #define FP_PACK_RAW_DP(val,X) \
79 if (!FP_INHIBIT_RESULTS) \
80 _FP_PACK_RAW_2_P(D,val,X); \
83 #define FP_UNPACK_D(X,val) \
85 _FP_UNPACK_RAW_2(D,X,val); \
86 _FP_UNPACK_CANONICAL(D,2,X); \
89 #define FP_UNPACK_DP(X,val) \
91 _FP_UNPACK_RAW_2_P(D,X,val); \
92 _FP_UNPACK_CANONICAL(D,2,X); \
95 #define FP_PACK_D(val,X) \
97 _FP_PACK_CANONICAL(D,2,X); \
98 _FP_PACK_RAW_2(D,val,X); \
101 #define FP_PACK_DP(val,X) \
103 _FP_PACK_CANONICAL(D,2,X); \
104 if (!FP_INHIBIT_RESULTS) \
105 _FP_PACK_RAW_2_P(D,val,X); \
108 #define FP_ISSIGNAN_D(X) _FP_ISSIGNAN(D,2,X)
109 #define FP_NEG_D(R,X) _FP_NEG(D,2,R,X)
110 #define FP_ADD_D(R,X,Y) _FP_ADD(D,2,R,X,Y)
111 #define FP_SUB_D(R,X,Y) _FP_SUB(D,2,R,X,Y)
112 #define FP_MUL_D(R,X,Y) _FP_MUL(D,2,R,X,Y)
113 #define FP_DIV_D(R,X,Y) _FP_DIV(D,2,R,X,Y)
114 #define FP_SQRT_D(R,X) _FP_SQRT(D,2,R,X)
115 #define _FP_SQRT_MEAT_D(R,S,T,X,Q) _FP_SQRT_MEAT_2(R,S,T,X,Q)
117 #define FP_CMP_D(r,X,Y,un) _FP_CMP(D,2,r,X,Y,un)
118 #define FP_CMP_EQ_D(r,X,Y) _FP_CMP_EQ(D,2,r,X,Y)
120 #define FP_TO_INT_D(r,X,rsz,rsg) _FP_TO_INT(D,2,r,X,rsz,rsg)
121 #define FP_TO_INT_ROUND_D(r,X,rsz,rsg) _FP_TO_INT_ROUND(D,2,r,X,rsz,rsg)
122 #define FP_FROM_INT_D(X,r,rs,rt) _FP_FROM_INT(D,2,X,r,rs,rt)
124 #define _FP_FRAC_HIGH_D(X) _FP_FRAC_HIGH_2(X)
125 #define _FP_FRAC_HIGH_RAW_D(X) _FP_FRAC_HIGH_2(X)
133 #if __BYTE_ORDER == __BIG_ENDIAN
145 #define FP_DECL_D(X) _FP_DECL(1,X)
146 #define FP_UNPACK_RAW_D(X,val) _FP_UNPACK_RAW_1(D,X,val)
147 #define FP_UNPACK_RAW_DP(X,val) _FP_UNPACK_RAW_1_P(D,X,val)
148 #define FP_PACK_RAW_D(val,X) _FP_PACK_RAW_1(D,val,X)
149 #define FP_PACK_RAW_DP(val,X) \
151 if (!FP_INHIBIT_RESULTS) \
152 _FP_PACK_RAW_1_P(D,val,X); \
155 #define FP_UNPACK_D(X,val) \
157 _FP_UNPACK_RAW_1(D,X,val); \
158 _FP_UNPACK_CANONICAL(D,1,X); \
161 #define FP_UNPACK_DP(X,val) \
163 _FP_UNPACK_RAW_1_P(D,X,val); \
164 _FP_UNPACK_CANONICAL(D,1,X); \
167 #define FP_PACK_D(val,X) \
169 _FP_PACK_CANONICAL(D,1,X); \
170 _FP_PACK_RAW_1(D,val,X); \
173 #define FP_PACK_DP(val,X) \
175 _FP_PACK_CANONICAL(D,1,X); \
176 if (!FP_INHIBIT_RESULTS) \
177 _FP_PACK_RAW_1_P(D,val,X); \
180 #define FP_ISSIGNAN_D(X) _FP_ISSIGNAN(D,1,X)
181 #define FP_NEG_D(R,X) _FP_NEG(D,1,R,X)
182 #define FP_ADD_D(R,X,Y) _FP_ADD(D,1,R,X,Y)
183 #define FP_SUB_D(R,X,Y) _FP_SUB(D,1,R,X,Y)
184 #define FP_MUL_D(R,X,Y) _FP_MUL(D,1,R,X,Y)
185 #define FP_DIV_D(R,X,Y) _FP_DIV(D,1,R,X,Y)
186 #define FP_SQRT_D(R,X) _FP_SQRT(D,1,R,X)
187 #define _FP_SQRT_MEAT_D(R,S,T,X,Q) _FP_SQRT_MEAT_1(R,S,T,X,Q)
192 #define FP_CMP_D(r,X,Y,un) _FP_CMP(D,1,r,X,Y,un)
193 #define FP_CMP_EQ_D(r,X,Y) _FP_CMP_EQ(D,1,r,X,Y)
195 #define FP_TO_INT_D(r,X,rsz,rsg) _FP_TO_INT(D,1,r,X,rsz,rsg)
196 #define FP_TO_INT_ROUND_D(r,X,rsz,rsg) _FP_TO_INT_ROUND(D,1,r,X,rsz,rsg)
197 #define FP_FROM_INT_D(X,r,rs,rt) _FP_FROM_INT(D,1,X,r,rs,rt)
199 #define _FP_FRAC_HIGH_D(X) _FP_FRAC_HIGH_1(X)
200 #define _FP_FRAC_HIGH_RAW_D(X) _FP_FRAC_HIGH_1(X)