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_loop(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 
00026 /* Someone please check this.  */
00027 #define _FP_CHOOSENAN(fs, wc, R, X, Y, OP)                     \
00028   do {                                                  \
00029     if ((_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs)         \
00030        && !(_FP_FRAC_HIGH_RAW_##fs(Y) & _FP_QNANBIT_##fs))     \
00031       {                                                        \
00032        R##_s = Y##_s;                                          \
00033        _FP_FRAC_COPY_##wc(R,Y);                         \
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 /* Exception flags.  We use the bit positions of the appropriate bits
00044    in the FPSCR, which also correspond to the FE_* bits.  This makes
00045    everything easier ;-).  */
00046 #define FP_EX_INVALID         (1 << (31 - 2))
00047 #define FP_EX_OVERFLOW        (1 << (31 - 3))
00048 #define FP_EX_UNDERFLOW       (1 << (31 - 4))
00049 #define FP_EX_DENORM          FP_EX_UNDERFLOW
00050 #define FP_EX_DIVZERO         (1 << (31 - 5))
00051 #define FP_EX_INEXACT         (1 << (31 - 6))
00052 
00053 #define FP_HANDLE_EXCEPTIONS  __simulate_exceptions (_fex)
00054 #define FP_ROUNDMODE          __sim_round_mode
00055 
00056 extern int __sim_exceptions;
00057 libc_hidden_proto (__sim_exceptions);
00058 extern int __sim_disabled_exceptions;
00059 libc_hidden_proto (__sim_disabled_exceptions);
00060 extern int __sim_round_mode;
00061 libc_hidden_proto (__sim_round_mode);
00062 
00063 extern void __simulate_exceptions (int x) attribute_hidden;