int fctiwz(u32 *frD, void *frB) { FP_DECL_D(B); FP_DECL_EX; u32 fpscr; unsigned int r; fpscr = __FPU_FPSCR; __FPU_FPSCR &= ~(3); __FPU_FPSCR |= FP_RND_ZERO; FP_UNPACK_DP(B, frB); FP_TO_INT_D(r, B, 32, 1); frD[1] = r; __FPU_FPSCR = fpscr; #ifdef DEBUG printk("%s: D %p, B %p: ", __func__, frD, frB); dump_double(frD); printk("\n"); #endif return 0; }
int FDTOI(unsigned *rd, void *rs2) { FP_DECL_D(A); unsigned r; __FP_UNPACK_D(A, rs2); FP_TO_INT_D(r, A, 32, 1); *rd = r; return 1; }
UDItype __fixunsdfdi(DFtype a) { FP_DECL_EX; FP_DECL_D(A); UDItype r; FP_UNPACK_RAW_D(A, a); FP_TO_INT_D(r, A, DI_BITS, 0); FP_HANDLE_EXCEPTIONS; return r; }
DItype __fixdfdi(double a) { FP_DECL_EX; FP_DECL_D(A); DItype r; FP_UNPACK_D(A, a); FP_TO_INT_D(r, A, 64, 1); FP_HANDLE_EXCEPTIONS; return r; }
SItype __fixdfsi(DFtype a) { FP_DECL_EX; FP_DECL_D(A); USItype r; FP_UNPACK_RAW_D(A, a); FP_TO_INT_D(r, A, SI_BITS, 1); FP_HANDLE_EXCEPTIONS; return r; }
int fctiw(u32 *frD, void *frB) { FP_DECL_D(B); unsigned int r; __FP_UNPACK_D(B, frB); FP_TO_INT_D(r, B, 32, 1); frD[1] = r; #ifdef DEBUG printk("%s: D %p, B %p: ", __FUNCTION__, frD, frB); dump_double(frD); printk("\n"); #endif return 0; }
int efdctsi(u32 *rD, void *rB) { FP_DECL_D(B); unsigned int r; __FP_UNPACK_D(B, rB); _FP_ROUND(2, B); FP_TO_INT_D(r, B, 32, 1); rD[1] = r; #ifdef DEBUG printk("%s: D %p, B %p: ", __FUNCTION__, rD, rB); dump_double(rD); printk("\n"); #endif return 0; }