Go to the documentation of this file.
25 #ifndef __MATH_EMU_SINGLE_H__
26 #define __MATH_EMU_SINGLE_H__
28 #if _FP_W_TYPE_SIZE < 32
29 #error "Here's a nickel kid. Go buy yourself a real computer."
32 #define _FP_FRACBITS_S 24
33 #define _FP_FRACXBITS_S (_FP_W_TYPE_SIZE - _FP_FRACBITS_S)
34 #define _FP_WFRACBITS_S (_FP_WORKBITS + _FP_FRACBITS_S)
35 #define _FP_WFRACXBITS_S (_FP_W_TYPE_SIZE - _FP_WFRACBITS_S)
36 #define _FP_EXPBITS_S 8
37 #define _FP_EXPBIAS_S 127
38 #define _FP_EXPMAX_S 255
39 #define _FP_QNANBIT_S ((_FP_W_TYPE)1 << (_FP_FRACBITS_S-2))
40 #define _FP_IMPLBIT_S ((_FP_W_TYPE)1 << (_FP_FRACBITS_S-1))
41 #define _FP_OVERFLOW_S ((_FP_W_TYPE)1 << (_FP_WFRACBITS_S))
50 #if __BYTE_ORDER == __BIG_ENDIAN
62 #define FP_DECL_S(X) _FP_DECL(1,X)
63 #define FP_UNPACK_RAW_S(X,val) _FP_UNPACK_RAW_1(S,X,val)
64 #define FP_UNPACK_RAW_SP(X,val) _FP_UNPACK_RAW_1_P(S,X,val)
65 #define FP_PACK_RAW_S(val,X) _FP_PACK_RAW_1(S,val,X)
66 #define FP_PACK_RAW_SP(val,X) \
68 if (!FP_INHIBIT_RESULTS) \
69 _FP_PACK_RAW_1_P(S,val,X); \
72 #define FP_UNPACK_S(X,val) \
74 _FP_UNPACK_RAW_1(S,X,val); \
75 _FP_UNPACK_CANONICAL(S,1,X); \
78 #define FP_UNPACK_SP(X,val) \
80 _FP_UNPACK_RAW_1_P(S,X,val); \
81 _FP_UNPACK_CANONICAL(S,1,X); \
84 #define FP_PACK_S(val,X) \
86 _FP_PACK_CANONICAL(S,1,X); \
87 _FP_PACK_RAW_1(S,val,X); \
90 #define FP_PACK_SP(val,X) \
92 _FP_PACK_CANONICAL(S,1,X); \
93 if (!FP_INHIBIT_RESULTS) \
94 _FP_PACK_RAW_1_P(S,val,X); \
97 #define FP_ISSIGNAN_S(X) _FP_ISSIGNAN(S,1,X)
98 #define FP_NEG_S(R,X) _FP_NEG(S,1,R,X)
99 #define FP_ADD_S(R,X,Y) _FP_ADD(S,1,R,X,Y)
100 #define FP_SUB_S(R,X,Y) _FP_SUB(S,1,R,X,Y)
101 #define FP_MUL_S(R,X,Y) _FP_MUL(S,1,R,X,Y)
102 #define FP_DIV_S(R,X,Y) _FP_DIV(S,1,R,X,Y)
103 #define FP_SQRT_S(R,X) _FP_SQRT(S,1,R,X)
104 #define _FP_SQRT_MEAT_S(R,S,T,X,Q) _FP_SQRT_MEAT_1(R,S,T,X,Q)
106 #define FP_CMP_S(r,X,Y,un) _FP_CMP(S,1,r,X,Y,un)
107 #define FP_CMP_EQ_S(r,X,Y) _FP_CMP_EQ(S,1,r,X,Y)
109 #define FP_TO_INT_S(r,X,rsz,rsg) _FP_TO_INT(S,1,r,X,rsz,rsg)
110 #define FP_TO_INT_ROUND_S(r,X,rsz,rsg) _FP_TO_INT_ROUND(S,1,r,X,rsz,rsg)
111 #define FP_FROM_INT_S(X,r,rs,rt) _FP_FROM_INT(S,1,X,r,rs,rt)
113 #define _FP_FRAC_HIGH_S(X) _FP_FRAC_HIGH_1(X)
114 #define _FP_FRAC_HIGH_RAW_S(X) _FP_FRAC_HIGH_1(X)