xref: /linux/arch/powerpc/math-emu/fctiw.c (revision 498495dba268b20e8eadd7fe93c140c68b6cc9d2)
1*b2441318SGreg Kroah-Hartman // SPDX-License-Identifier: GPL-2.0
25cd27208SKumar Gala #include <linux/types.h>
35cd27208SKumar Gala #include <linux/errno.h>
47c0f6ba6SLinus Torvalds #include <linux/uaccess.h>
55cd27208SKumar Gala 
6d2b194edSKumar Gala #include <asm/sfp-machine.h>
7d2b194edSKumar Gala #include <math-emu/soft-fp.h>
8d2b194edSKumar Gala #include <math-emu/double.h>
95cd27208SKumar Gala 
105cd27208SKumar Gala int
fctiw(u32 * frD,void * frB)115cd27208SKumar Gala fctiw(u32 *frD, void *frB)
125cd27208SKumar Gala {
135cd27208SKumar Gala 	FP_DECL_D(B);
14d2b194edSKumar Gala 	FP_DECL_EX;
155cd27208SKumar Gala 	unsigned int r;
165cd27208SKumar Gala 
17d2b194edSKumar Gala 	FP_UNPACK_DP(B, frB);
185cd27208SKumar Gala 	FP_TO_INT_D(r, B, 32, 1);
195cd27208SKumar Gala 	frD[1] = r;
205cd27208SKumar Gala 
215cd27208SKumar Gala #ifdef DEBUG
22e48b1b45SHarvey Harrison 	printk("%s: D %p, B %p: ", __func__, frD, frB);
235cd27208SKumar Gala 	dump_double(frD);
245cd27208SKumar Gala 	printk("\n");
255cd27208SKumar Gala #endif
265cd27208SKumar Gala 
275cd27208SKumar Gala 	return 0;
285cd27208SKumar Gala }
29