42 #include <asm/asm-offsets.h>
44 #include <asm/math-emu.h>
48 #define IS_INF(a) ((a)->exp == 0x7fff)
49 #define IS_ZERO(a) ((a)->mant.m64 == 0)
52 #define fp_set_sr(bit) ({ \
53 FPDATA->fpsr |= 1 << (bit); \
56 #define fp_set_quotient(quotient) ({ \
57 FPDATA->fpsr &= 0xff00ffff; \
58 FPDATA->fpsr |= ((quotient) & 0xff) << 16; \
64 #define fp_normalize_ext(fpreg) ({ \
65 register struct fp_ext *reg asm ("a0") = fpreg; \
66 register int res asm ("d0"); \
68 asm volatile ("jsr fp_conv_ext2ext" \
69 : "=d" (res) : "a" (reg) \
70 : "a1", "d1", "d2", "memory"); \
74 #define fp_copy_ext(dest, src) ({ \
78 #define fp_monadic_check(dest, src) ({ \
79 fp_copy_ext(dest, src); \
80 if (!fp_normalize_ext(dest)) \
84 #define fp_dyadic_check(dest, src) ({ \
85 if (!fp_normalize_ext(dest)) \
87 if (!fp_normalize_ext(src)) { \
88 fp_copy_ext(dest, src); \
96 #define fp_set_nan(dest) ({ \
97 fp_set_sr(FPSR_EXC_OPERR); \
102 #define fp_set_ovrflw(dest) ({ \
103 fp_set_sr(FPSR_EXC_OVFL); \
104 dest->exp = 0x7fff; \
105 dest->mant.m64 = 0; \
108 #define fp_conv_ext2long(src) ({ \
109 register struct fp_ext *__src asm ("a0") = src; \
110 register int __res asm ("d0"); \
112 asm volatile ("jsr fp_conv_ext2long" \
113 : "=d" (__res) : "a" (__src) \
114 : "a1", "d1", "d2", "memory"); \
118 #define fp_conv_long2ext(dest, src) ({ \
119 register struct fp_ext *__dest asm ("a0") = dest; \
120 register int __src asm ("d0") = src; \
122 asm volatile ("jsr fp_conv_ext2long" \
123 : : "d" (__src), "a" (__dest) \
124 : "a1", "d1", "d2", "memory"); \
137 bclr #(\
bit&7),(FPD_FPSR+3-(\bit/8),
FPDATA)
141 btst #(\bit&7),(FPD_FPSR+3-(\
bit/8),
FPDATA)