1 #define _FP_W_TYPE_SIZE 32
2 #define _FP_W_TYPE unsigned long
3 #define _FP_WS_TYPE signed long
4 #define _FP_I_TYPE long
6 #define _FP_MUL_MEAT_S(R,X,Y) \
7 _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
8 #define _FP_MUL_MEAT_D(R,X,Y) \
9 _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
10 #define _FP_MUL_MEAT_Q(R,X,Y) \
11 _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
13 #define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_loop(S,R,X,Y)
14 #define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_2_udiv(D,R,X,Y)
15 #define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_4_udiv(Q,R,X,Y)
17 #define _FP_NANFRAC_S ((_FP_QNANBIT_S << 1) - 1)
18 #define _FP_NANFRAC_D ((_FP_QNANBIT_D << 1) - 1), -1
19 #define _FP_NANFRAC_Q ((_FP_QNANBIT_Q << 1) - 1), -1, -1, -1
20 #define _FP_NANSIGN_S 0
21 #define _FP_NANSIGN_D 0
22 #define _FP_NANSIGN_Q 0
24 #define _FP_KEEPNANFRACP 1
26 /* Someone please check this. */
27 #define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
29 if ((_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs) \
30 && !(_FP_FRAC_HIGH_RAW_##fs(Y) & _FP_QNANBIT_##fs)) \
33 _FP_FRAC_COPY_##wc(R,Y); \
38 _FP_FRAC_COPY_##wc(R,X); \
43 /* Exception flags. We use the bit positions of the appropriate bits
44 in the FPSCR, which also correspond to the FE_* bits. This makes
45 everything easier ;-). */
46 #define FP_EX_INVALID (1 << (31 - 2))
47 #define FP_EX_OVERFLOW (1 << (31 - 3))
48 #define FP_EX_UNDERFLOW (1 << (31 - 4))
49 #define FP_EX_DENORM FP_EX_UNDERFLOW
50 #define FP_EX_DIVZERO (1 << (31 - 5))
51 #define FP_EX_INEXACT (1 << (31 - 6))
53 #define FP_HANDLE_EXCEPTIONS __simulate_exceptions (_fex)
54 #define FP_ROUNDMODE __sim_round_mode
56 extern int __sim_exceptions
;
57 libc_hidden_proto (__sim_exceptions
);
58 extern int __sim_disabled_exceptions
;
59 libc_hidden_proto (__sim_disabled_exceptions
);
60 extern int __sim_round_mode
;
61 libc_hidden_proto (__sim_round_mode
);
63 extern void __simulate_exceptions (int x
) attribute_hidden
;