Merge tag 'sched-urgent-2020-12-27' of git://git.kernel.org/pub/scm/linux/kernel...
[linux/fpc-iii.git] / arch / powerpc / math-emu / fctiwz.c
blob426271c4f004920421e9edf3670000c67ec4ad91
1 // SPDX-License-Identifier: GPL-2.0
2 #include <linux/types.h>
3 #include <linux/errno.h>
4 #include <linux/uaccess.h>
6 #include <asm/sfp-machine.h>
7 #include <math-emu/soft-fp.h>
8 #include <math-emu/double.h>
10 int
11 fctiwz(u32 *frD, void *frB)
13 FP_DECL_D(B);
14 FP_DECL_EX;
15 u32 fpscr;
16 unsigned int r;
18 fpscr = __FPU_FPSCR;
19 __FPU_FPSCR &= ~(3);
20 __FPU_FPSCR |= FP_RND_ZERO;
22 FP_UNPACK_DP(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: ", __func__, frD, frB);
30 dump_double(frD);
31 printk("\n");
32 #endif
34 return 0;