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
5 
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)
12 
13 #define _FP_MUL_MEAT_DW_S(R,X,Y)				\
14   _FP_MUL_MEAT_DW_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
15 #define _FP_MUL_MEAT_DW_D(R,X,Y)				\
16   _FP_MUL_MEAT_DW_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
17 #define _FP_MUL_MEAT_DW_Q(R,X,Y)				\
18   _FP_MUL_MEAT_DW_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
19 
20 #define _FP_DIV_MEAT_S(R,X,Y)	_FP_DIV_MEAT_1_udiv_norm(S,R,X,Y)
21 #define _FP_DIV_MEAT_D(R,X,Y)	_FP_DIV_MEAT_2_udiv(D,R,X,Y)
22 #define _FP_DIV_MEAT_Q(R,X,Y)	_FP_DIV_MEAT_4_udiv(Q,R,X,Y)
23 
24 #ifdef __mips_nan2008
25 # define _FP_NANFRAC_S		((_FP_QNANBIT_S << 1) - 1)
26 # define _FP_NANFRAC_D		((_FP_QNANBIT_D << 1) - 1), -1
27 # define _FP_NANFRAC_Q		((_FP_QNANBIT_Q << 1) - 1), -1, -1, -1
28 #else
29 # define _FP_NANFRAC_S		(_FP_QNANBIT_S - 1)
30 # define _FP_NANFRAC_D		(_FP_QNANBIT_D - 1), -1
31 # define _FP_NANFRAC_Q		(_FP_QNANBIT_Q - 1), -1, -1, -1
32 #endif
33 #define _FP_NANSIGN_S		0
34 #define _FP_NANSIGN_D		0
35 #define _FP_NANSIGN_Q		0
36 
37 #define _FP_KEEPNANFRACP 1
38 #ifdef __mips_nan2008
39 # define _FP_QNANNEGATEDP 0
40 #else
41 # define _FP_QNANNEGATEDP 1
42 #endif
43 
44 #ifdef __mips_nan2008
45 /* NaN payloads should be preserved for NAN2008.  */
46 # define _FP_CHOOSENAN(fs, wc, R, X, Y, OP)	\
47   do						\
48     {						\
49       R##_s = X##_s;				\
50       _FP_FRAC_COPY_##wc (R, X);		\
51       R##_c = FP_CLS_NAN;			\
52     }						\
53   while (0)
54 #else
55 /* From my experiments it seems X is chosen unless one of the
56    NaNs is sNaN,  in which case the result is NANSIGN/NANFRAC.  */
57 # define _FP_CHOOSENAN(fs, wc, R, X, Y, OP)			\
58   do {								\
59     if ((_FP_FRAC_HIGH_RAW_##fs(X)				\
60 	 | _FP_FRAC_HIGH_RAW_##fs(Y)) & _FP_QNANBIT_##fs)	\
61       {								\
62 	R##_s = _FP_NANSIGN_##fs;				\
63         _FP_FRAC_SET_##wc(R,_FP_NANFRAC_##fs);			\
64       }								\
65     else							\
66       {								\
67 	R##_s = X##_s;						\
68         _FP_FRAC_COPY_##wc(R,X);				\
69       }								\
70     R##_c = FP_CLS_NAN;						\
71   } while (0)
72 #endif
73 
74 #define FP_EX_INVALID           (1 << 4)
75 #define FP_EX_DIVZERO           (1 << 3)
76 #define FP_EX_OVERFLOW          (1 << 2)
77 #define FP_EX_UNDERFLOW         (1 << 1)
78 #define FP_EX_INEXACT           (1 << 0)
79 
80 #define _FP_TININESS_AFTER_ROUNDING 1
81