lkml.org 
[lkml]   [2004]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] PPC Fix bug in altivec emulation
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@samba.org>

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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 14:05    [W:0.032 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site