aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/math-emu/math.c
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2008-06-04 03:59:29 -0400
committerKumar Gala <galak@kernel.crashing.org>2008-10-01 09:40:07 -0400
commitd2b194ed820880eb19c43b9c10d9f5f30026ee54 (patch)
tree1ac21746a8c4395c7e7fd73a60202db892fe4d76 /arch/powerpc/math-emu/math.c
parenta969e76a7101bf5f3d369563df1ca1253dd6131b (diff)
powerpc/math-emu: Use kernel generic math-emu code
The math emulation code is centered around a set of generic macros that provide the core of the emulation that are shared by the various architectures and other projects (like glibc). Each arch implements its own sfp-machine.h to specific various arch specific details. For historic reasons that are now lost the powerpc math-emu code had its own version of the common headers. This moves us to using the kernel generic version and thus getting fixes when those are updated. Also cleaned up exception/error reporting from the FP emulation functions. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/math-emu/math.c')
-rw-r--r--arch/powerpc/math-emu/math.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/powerpc/math-emu/math.c b/arch/powerpc/math-emu/math.c
index 29e545e0272e..164d55935bd8 100644
--- a/arch/powerpc/math-emu/math.c
+++ b/arch/powerpc/math-emu/math.c
@@ -8,8 +8,8 @@
8#include <asm/uaccess.h> 8#include <asm/uaccess.h>
9#include <asm/reg.h> 9#include <asm/reg.h>
10 10
11#include "sfp-machine.h" 11#include <asm/sfp-machine.h>
12#include "double.h" 12#include <math-emu/double.h>
13 13
14#define FLOATFUNC(x) extern int x(void *, void *, void *, void *) 14#define FLOATFUNC(x) extern int x(void *, void *, void *, void *)
15 15
@@ -168,6 +168,8 @@ record_exception(struct pt_regs *regs, int eflag)
168 fpscr |= FPSCR_ZX; 168 fpscr |= FPSCR_ZX;
169 if (eflag & EFLAG_INEXACT) 169 if (eflag & EFLAG_INEXACT)
170 fpscr |= FPSCR_XX; 170 fpscr |= FPSCR_XX;
171 if (eflag & EFLAG_INVALID)
172 fpscr |= FPSCR_VX;
171 if (eflag & EFLAG_VXSNAN) 173 if (eflag & EFLAG_VXSNAN)
172 fpscr |= FPSCR_VXSNAN; 174 fpscr |= FPSCR_VXSNAN;
173 if (eflag & EFLAG_VXISI) 175 if (eflag & EFLAG_VXISI)
@@ -188,7 +190,7 @@ record_exception(struct pt_regs *regs, int eflag)
188 fpscr |= FPSCR_VXCVI; 190 fpscr |= FPSCR_VXCVI;
189 } 191 }
190 192
191 fpscr &= ~(FPSCR_VX); 193// fpscr &= ~(FPSCR_VX);
192 if (fpscr & (FPSCR_VXSNAN | FPSCR_VXISI | FPSCR_VXIDI | 194 if (fpscr & (FPSCR_VXSNAN | FPSCR_VXISI | FPSCR_VXIDI |
193 FPSCR_VXZDZ | FPSCR_VXIMZ | FPSCR_VXVC | 195 FPSCR_VXZDZ | FPSCR_VXIMZ | FPSCR_VXVC |
194 FPSCR_VXSOFT | FPSCR_VXSQRT | FPSCR_VXCVI)) 196 FPSCR_VXSOFT | FPSCR_VXSQRT | FPSCR_VXCVI))