Back to index

glibc  2.9
sfp-machine.h
Go to the documentation of this file.
00001 #define _FP_W_TYPE_SIZE            32
00002 #define _FP_W_TYPE          unsigned long
00003 #define _FP_WS_TYPE         signed long
00004 #define _FP_I_TYPE          long
00005 
00006 #define _FP_MUL_MEAT_S(R,X,Y)                           \
00007   _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
00008 #define _FP_MUL_MEAT_D(R,X,Y)                           \
00009   _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
00010 #define _FP_MUL_MEAT_Q(R,X,Y)                           \
00011   _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
00012 
00013 #define _FP_DIV_MEAT_S(R,X,Y)      _FP_DIV_MEAT_1_udiv_norm(S,R,X,Y)
00014 #define _FP_DIV_MEAT_D(R,X,Y)      _FP_DIV_MEAT_2_udiv(D,R,X,Y)
00015 #define _FP_DIV_MEAT_Q(R,X,Y)      _FP_DIV_MEAT_4_udiv(Q,R,X,Y)
00016 
00017 #define _FP_NANFRAC_S              ((_FP_QNANBIT_S << 1) - 1)
00018 #define _FP_NANFRAC_D              ((_FP_QNANBIT_D << 1) - 1), -1
00019 #define _FP_NANFRAC_Q              ((_FP_QNANBIT_Q << 1) - 1), -1, -1, -1
00020 #define _FP_NANSIGN_S              0
00021 #define _FP_NANSIGN_D              0
00022 #define _FP_NANSIGN_Q              0
00023 
00024 #define _FP_KEEPNANFRACP 1
00025 /* From my experiments it seems X is chosen unless one of the
00026    NaNs is sNaN,  in which case the result is NANSIGN/NANFRAC.  */
00027 #define _FP_CHOOSENAN(fs, wc, R, X, Y, OP)                     \
00028   do {                                                  \
00029     if ((_FP_FRAC_HIGH_RAW_##fs(X) |                           \
00030         _FP_FRAC_HIGH_RAW_##fs(Y)) & _FP_QNANBIT_##fs)         \
00031       {                                                        \
00032        R##_s = _FP_NANSIGN_##fs;                        \
00033         _FP_FRAC_SET_##wc(R,_FP_NANFRAC_##fs);                 \
00034       }                                                        \
00035     else                                                \
00036       {                                                        \
00037        R##_s = X##_s;                                          \
00038         _FP_FRAC_COPY_##wc(R,X);                        \
00039       }                                                        \
00040     R##_c = FP_CLS_NAN;                                        \
00041   } while (0)
00042 
00043 #define FP_EX_INVALID           (1 << 4)
00044 #define FP_EX_DIVZERO           (1 << 3)
00045 #define FP_EX_OVERFLOW          (1 << 2)
00046 #define FP_EX_UNDERFLOW         (1 << 1)
00047 #define FP_EX_INEXACT           (1 << 0)