xref: /openbmc/linux/arch/powerpc/math-emu/fctiw.c (revision 36d26912)
1 // SPDX-License-Identifier: GPL-2.0
2 #include <linux/types.h>
3 #include <linux/errno.h>
4 #include <linux/uaccess.h>
5 
6 #include <asm/sfp-machine.h>
7 #include <math-emu/soft-fp.h>
8 #include <math-emu/double.h>
9 
10 int
11 fctiw(u32 *frD, void *frB)
12 {
13 	FP_DECL_D(B);
14 	FP_DECL_EX;
15 	unsigned int r;
16 
17 	FP_UNPACK_DP(B, frB);
18 	FP_TO_INT_D(r, B, 32, 1);
19 	frD[1] = r;
20 
21 #ifdef DEBUG
22 	printk("%s: D %p, B %p: ", __func__, frD, frB);
23 	dump_double(frD);
24 	printk("\n");
25 #endif
26 
27 	return 0;
28 }
29