xref: /openbmc/linux/arch/powerpc/math-emu/frsp.c (revision fbb6b31a)
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 #include <math-emu/single.h>
10 
11 int
12 frsp(void *frD, void *frB)
13 {
14 	FP_DECL_D(B);
15 	FP_DECL_EX;
16 
17 #ifdef DEBUG
18 	printk("%s: D %p, B %p\n", __func__, frD, frB);
19 #endif
20 
21 	FP_UNPACK_DP(B, frB);
22 
23 #ifdef DEBUG
24 	printk("B: %ld %lu %lu %ld (%ld)\n", B_s, B_f1, B_f0, B_e, B_c);
25 #endif
26 
27 	__FP_PACK_DS(frD, B);
28 
29 	return FP_CUR_EXCEPTIONS;
30 }
31