[PATCH] PPC Fix bug in altivec emulation

From: Paul Mackerras
Date: Tue Aug 17 2004 - 00:29:48 EST


This patch fixes a bug in the kernel emulation of altivec instructions
with denormalized operands. The emulation of the vmaddfp and vmnsubfp
instructions was giving the wrong answer because I had the wrong order
of operands to the fmadds and fnmsubs instructions. This patch fixes
it for both ppc32 and ppc64.

Signed-off-by: Paul Mackerras <paulus@xxxxxxxxx>

diff -urN linux-2.5/arch/ppc/kernel/vector.S ppc64/arch/ppc/kernel/vector.S
--- linux-2.5/arch/ppc/kernel/vector.S 2004-05-19 00:48:08.000000000 +1000
+++ ppc64/arch/ppc/kernel/vector.S 2004-08-17 15:23:20.908955312 +1000
@@ -106,7 +106,7 @@
1: lfsx fr0,r4,r7
lfsx fr1,r5,r7
lfsx fr2,r6,r7
- fmadds fr0,fr0,fr1,fr2
+ fmadds fr0,fr0,fr2,fr1
stfsx fr0,r3,r7
addi r7,r7,4
bdnz 1b
@@ -133,7 +133,7 @@
1: lfsx fr0,r4,r7
lfsx fr1,r5,r7
lfsx fr2,r6,r7
- fnmsubs fr0,fr0,fr1,fr2
+ fnmsubs fr0,fr0,fr2,fr1
stfsx fr0,r3,r7
addi r7,r7,4
bdnz 1b
diff -urN linux-2.5/arch/ppc64/kernel/vector.S ppc64/arch/ppc64/kernel/vector.S
--- linux-2.5/arch/ppc64/kernel/vector.S 2004-06-23 12:52:07.000000000 +1000
+++ ppc64/arch/ppc64/kernel/vector.S 2004-08-17 13:22:18.000000000 +1000
@@ -89,7 +89,7 @@
1: lfsx fr0,r4,r7
lfsx fr1,r5,r7
lfsx fr2,r6,r7
- fmadds fr0,fr0,fr1,fr2
+ fmadds fr0,fr0,fr2,fr1
stfsx fr0,r3,r7
addi r7,r7,4
bdnz 1b
@@ -109,7 +109,7 @@
1: lfsx fr0,r4,r7
lfsx fr1,r5,r7
lfsx fr2,r6,r7
- fnmsubs fr0,fr0,fr1,fr2
+ fnmsubs fr0,fr0,fr2,fr1
stfsx fr0,r3,r7
addi r7,r7,4
bdnz 1b
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/