* add p cc
[mascara-docs.git] / i386 / linux / linux-2.3.21 / arch / ppc / math-emu / fctiwz.c
blob6e4fbe00795409cb6b18ca4e4f259d59f2a0df90
1 /* $Id: fctiwz.c,v 1.1 1999/08/23 18:59:31 cort Exp $
2 */
4 #include <linux/types.h>
5 #include <linux/errno.h>
6 #include <asm/uaccess.h>
8 #include "soft-fp.h"
9 #include "double.h"
11 int
12 fctiwz(u32 *frD, void *frB)
14 FP_DECL_D(B);
15 u32 fpscr;
16 unsigned int r;
18 fpscr = __FPU_FPSCR;
19 __FPU_FPSCR &= ~(3);
20 __FPU_FPSCR |= FP_RND_ZERO;
22 __FP_UNPACK_D(B, frB);
23 FP_TO_INT_D(r, B, 32, 1);
24 frD[1] = r;
26 __FPU_FPSCR = fpscr;
28 #ifdef DEBUG
29 printk("%s: D %p, B %p: ", __FUNCTION__, frD, frB);
30 dump_double(frD);
31 printk("\n");
32 #endif
34 return 0;