aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/math-emu/mtfsf.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-10-19 13:04:47 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-19 13:04:47 -0400
commit3e10e879a8c334a5927d800a3663a24d562cfa31 (patch)
tree5d18bc7e38c986a044e99aa0d0a4aff4931ec7d0 /arch/powerpc/math-emu/mtfsf.c
parent98d9c66ab07471006fd7910cb16453581c41a3e7 (diff)
parent0cfd81031a26717fe14380d18275f8e217571615 (diff)
Merge branch 'linus' into tracing-v28-for-linus-v3
Conflicts: init/main.c kernel/module.c scripts/bootgraph.pl
Diffstat (limited to 'arch/powerpc/math-emu/mtfsf.c')
-rw-r--r--arch/powerpc/math-emu/mtfsf.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/arch/powerpc/math-emu/mtfsf.c b/arch/powerpc/math-emu/mtfsf.c
index 48014d8e3af1..dbce92e4f046 100644
--- a/arch/powerpc/math-emu/mtfsf.c
+++ b/arch/powerpc/math-emu/mtfsf.c
@@ -2,12 +2,14 @@
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 <math-emu/soft-fp.h>
6 7
7int 8int
8mtfsf(unsigned int FM, u32 *frB) 9mtfsf(unsigned int FM, u32 *frB)
9{ 10{
10 u32 mask; 11 u32 mask;
12 u32 fpscr;
11 13
12 if (FM == 0) 14 if (FM == 0)
13 return 0; 15 return 0;
@@ -37,6 +39,22 @@ mtfsf(unsigned int FM, u32 *frB)
37 __FPU_FPSCR &= ~(mask); 39 __FPU_FPSCR &= ~(mask);
38 __FPU_FPSCR |= (frB[1] & mask); 40 __FPU_FPSCR |= (frB[1] & mask);
39 41
42 __FPU_FPSCR &= ~(FPSCR_VX);
43 if (__FPU_FPSCR & (FPSCR_VXSNAN | FPSCR_VXISI | FPSCR_VXIDI |
44 FPSCR_VXZDZ | FPSCR_VXIMZ | FPSCR_VXVC |
45 FPSCR_VXSOFT | FPSCR_VXSQRT | FPSCR_VXCVI))
46 __FPU_FPSCR |= FPSCR_VX;
47
48 fpscr = __FPU_FPSCR;
49 fpscr &= ~(FPSCR_FEX);
50 if (((fpscr & FPSCR_VX) && (fpscr & FPSCR_VE)) ||
51 ((fpscr & FPSCR_OX) && (fpscr & FPSCR_OE)) ||
52 ((fpscr & FPSCR_UX) && (fpscr & FPSCR_UE)) ||
53 ((fpscr & FPSCR_ZX) && (fpscr & FPSCR_ZE)) ||
54 ((fpscr & FPSCR_XX) && (fpscr & FPSCR_XE)))
55 fpscr |= FPSCR_FEX;
56 __FPU_FPSCR = fpscr;
57
40#ifdef DEBUG 58#ifdef DEBUG
41 printk("%s: %02x %p: %08lx\n", __func__, FM, frB, __FPU_FPSCR); 59 printk("%s: %02x %p: %08lx\n", __func__, FM, frB, __FPU_FPSCR);
42#endif 60#endif