aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/math-emu/lfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/math-emu/lfs.c')
-rw-r--r--arch/powerpc/math-emu/lfs.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/arch/powerpc/math-emu/lfs.c b/arch/powerpc/math-emu/lfs.c
index 6f18ebe3a7ff..434ed27be8db 100644
--- a/arch/powerpc/math-emu/lfs.c
+++ b/arch/powerpc/math-emu/lfs.c
@@ -2,15 +2,17 @@
2#include <linux/errno.h> 2#include <linux/errno.h>
3#include <asm/uaccess.h> 3#include <asm/uaccess.h>
4 4
5#include "soft-fp.h" 5#include <asm/sfp-machine.h>
6#include "double.h" 6#include <math-emu/soft-fp.h>
7#include "single.h" 7#include <math-emu/double.h>
8#include <math-emu/single.h>
8 9
9int 10int
10lfs(void *frD, void *ea) 11lfs(void *frD, void *ea)
11{ 12{
12 FP_DECL_D(R); 13 FP_DECL_D(R);
13 FP_DECL_S(A); 14 FP_DECL_S(A);
15 FP_DECL_EX;
14 float f; 16 float f;
15 17
16#ifdef DEBUG 18#ifdef DEBUG
@@ -20,7 +22,7 @@ lfs(void *frD, void *ea)
20 if (copy_from_user(&f, ea, sizeof(float))) 22 if (copy_from_user(&f, ea, sizeof(float)))
21 return -EFAULT; 23 return -EFAULT;
22 24
23 __FP_UNPACK_S(A, &f); 25 FP_UNPACK_S(A, f);
24 26
25#ifdef DEBUG 27#ifdef DEBUG
26 printk("A: %ld %lu %ld (%ld) [%08lx]\n", A_s, A_f, A_e, A_c, 28 printk("A: %ld %lu %ld (%ld) [%08lx]\n", A_s, A_f, A_e, A_c,
@@ -33,5 +35,12 @@ lfs(void *frD, void *ea)
33 printk("R: %ld %lu %lu %ld (%ld)\n", R_s, R_f1, R_f0, R_e, R_c); 35 printk("R: %ld %lu %lu %ld (%ld)\n", R_s, R_f1, R_f0, R_e, R_c);
34#endif 36#endif
35 37
36 return __FP_PACK_D(frD, R); 38 if (R_c == FP_CLS_NAN) {
39 R_e = _FP_EXPMAX_D;
40 _FP_PACK_RAW_2_P(D, frD, R);
41 } else {
42 __FP_PACK_D(frD, R);
43 }
44
45 return 0;
37} 46}