Moved from soft-fp/sysdeps/sparc/sparc32/q_qtoi.c
[kopensolaris-gnu/glibc.git] / soft-fp / sysdeps / alpha / sfp-machine.h
1 #define _FP_W_TYPE_SIZE         64
2 #define _FP_W_TYPE              unsigned long
3 #define _FP_WS_TYPE             signed long
4 #define _FP_I_TYPE              long
5
6 #define _alpha_mul_64_128(rhi, rlo, x, y)               \
7   __asm__("umulh %2,%3,%0; mulq %2,%3,%1"               \
8           : "=&r"(rhi), "=r"(rlo) : "r"(x), "r"(y))
9
10 #define _FP_MUL_MEAT_S(R,X,Y)                                   \
11   _FP_MUL_MEAT_1_imm(_FP_WFRACBITS_S,R,X,Y)
12 #define _FP_MUL_MEAT_D(R,X,Y)                                   \
13   _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_D,R,X,Y,_alpha_mul_64_128)
14 #define _FP_MUL_MEAT_Q(R,X,Y)                                   \
15   _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_Q,R,X,Y,_alpha_mul_64_128)
16
17 #define _FP_DIV_MEAT_S(R,X,Y)   _FP_DIV_MEAT_1_imm(S,R,X,Y,_FP_DIV_HELP_imm)
18 #define _FP_DIV_MEAT_D(R,X,Y)   _FP_DIV_MEAT_1_udiv(D,R,X,Y)
19 #define _FP_DIV_MEAT_Q(R,X,Y)   _FP_DIV_MEAT_2_udiv(Q,R,X,Y)
20
21 #define _FP_NANFRAC_S           _FP_QNANBIT_S
22 #define _FP_NANFRAC_D           _FP_QNANBIT_D
23 #define _FP_NANFRAC_Q           _FP_QNANBIT_Q, 0
24 /* FIXME: This is just a wild guess */
25 #define _FP_NANSIGN_S           1
26 #define _FP_NANSIGN_D           1
27 #define _FP_NANSIGN_Q           1
28
29 #define _FP_KEEPNANFRACP 1
30 #define _FP_CHOOSENAN(fs, wc, R, X, Y, OP)                      \
31   do {                                                          \
32     R##_s = Y##_s;                                              \
33     _FP_FRAC_COPY_##wc(R,Y);                                    \
34     R##_c = FP_CLS_NAN;                                         \
35   } while (0)