15cd27208SKumar Gala #include <linux/types.h> 25cd27208SKumar Gala #include <linux/errno.h> 35cd27208SKumar Gala #include <asm/uaccess.h> 45cd27208SKumar Gala 5*d2b194edSKumar Gala #include <asm/sfp-machine.h> 6*d2b194edSKumar Gala #include <math-emu/soft-fp.h> 7*d2b194edSKumar Gala #include <math-emu/double.h> 85cd27208SKumar Gala 95cd27208SKumar Gala int 105cd27208SKumar Gala fctiwz(u32 *frD, void *frB) 115cd27208SKumar Gala { 125cd27208SKumar Gala FP_DECL_D(B); 13*d2b194edSKumar Gala FP_DECL_EX; 145cd27208SKumar Gala u32 fpscr; 155cd27208SKumar Gala unsigned int r; 165cd27208SKumar Gala 175cd27208SKumar Gala fpscr = __FPU_FPSCR; 185cd27208SKumar Gala __FPU_FPSCR &= ~(3); 195cd27208SKumar Gala __FPU_FPSCR |= FP_RND_ZERO; 205cd27208SKumar Gala 21*d2b194edSKumar Gala FP_UNPACK_DP(B, frB); 225cd27208SKumar Gala FP_TO_INT_D(r, B, 32, 1); 235cd27208SKumar Gala frD[1] = r; 245cd27208SKumar Gala 255cd27208SKumar Gala __FPU_FPSCR = fpscr; 265cd27208SKumar Gala 275cd27208SKumar Gala #ifdef DEBUG 28e48b1b45SHarvey Harrison printk("%s: D %p, B %p: ", __func__, frD, frB); 295cd27208SKumar Gala dump_double(frD); 305cd27208SKumar Gala printk("\n"); 315cd27208SKumar Gala #endif 325cd27208SKumar Gala 335cd27208SKumar Gala return 0; 345cd27208SKumar Gala } 35