Skip to contentSkip to conversation

target-arm: Fix loading of scalar value for Neon multiply-by-scalar

PATCH Applied Peter Maydell 4 participants 6 messages Jan 19, 2011 – Jan 26, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target-arm: Fix loading of scalar value for Neon multiply-by-scalar

Fix the register and part of register we get the scalar from in the various "multiply vector by scalar" ops (VMUL by scalar and friends).

---
 target-arm/translate.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
target-arm/translate.c +6 -6
index c60cd18..0c2856a 100644
@@ -3608,14 +3608,14 @@ static inline TCGv neon_get_scalar(int size, int reg)
 {
     TCGv tmp;
     if (size == 1) {
-        tmp = neon_load_reg(reg >> 1, reg & 1);
-    } else {
-        tmp = neon_load_reg(reg >> 2, (reg >> 1) & 1);
-        if (reg & 1) {
-            gen_neon_dup_low16(tmp);
-        } else {
+        tmp = neon_load_reg(reg & 7, reg >> 4);
+        if (reg & 8) {
             gen_neon_dup_high16(tmp);
+        } else {
+            gen_neon_dup_low16(tmp);
         }
+    } else {
+        tmp = neon_load_reg(reg & 15, reg >> 4);
     }
     return tmp;
 }
Signature · 1 line
1.6.3.3
#1 lore raw
Quoted 4 lines · Peter Maydell

Fix the register and part of register we get the scalar from in the various "multiply vector by scalar" ops (VMUL by scalar and friends).

I do confirm that with this patch, I can see many improvements in my tests.

Thanks.

#2 lore raw

RE: [Qemu-devel] [PATCH] target-arm: Fix loading of scalar value forNeon multiply-by-scalar

In reply to Peter Maydell
Quoted 10 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Peter Maydell
Sent: Wednesday, January 19, 2011 11:30 AM
To: [email protected]
Cc: Christophe Lyon; [email protected]
Subject: [Qemu-devel] [PATCH] target-arm: Fix loading of scalar value forNeon multiply-by-scalar

Quoted 3 lines

Fix the register and part of register we get the scalar from in the various "multiply vector by scalar" ops (VMUL by scalar and friends).

FWIW, on the two test cases that I have, this patch (together with Christophe's) does not improve behaviour (see
https://bugs.launchpad.net/bugs/702885).

Regards,
- Wolfgang

#3 lore raw

Re: [Qemu-devel] [PATCH] target-arm: Fix loading of scalar value forNeon multiply-by-scalar

Quoted 3 lines · Wolfgang

FWIW, on the two test cases that I have, this patch (together with Christophe's) does not improve behaviour (see
https://bugs.launchpad.net/bugs/702885).

Hrm. Can you attached the compiled ARM binaries to that bug report, to save me the effort of digging out an armcc, please?

thanks
-- PMM

#4 lore raw

RE: [Qemu-devel] [PATCH] target-arm: Fix loading of scalar valueforNeon multiply-by-scalar

In reply to Schildbach, Wolfgang
Quoted 9 lines

From: [email protected] [mailto:[email protected]] On Behalf Of Schildbach, Wolfgang

Quoted 5 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Peter Maydell

Quoted 7 lines
Quoted 2 lines

Fix the register and part of register we get the scalar from in the various "multiply vector by scalar" ops (VMUL by scalar and

friends).

FWIW, on the two test cases that I have, this patch (together with Christophe's) does not improve behaviour (see
https://bugs.launchpad.net/bugs/702885).

Duh. I had missed the greater part of Christophe's patch (I am still having trouble with my mail client; applying patches off the list is manual for me).

With both patches applied, indeed the bug filed on launchpad seems fixed. On my second test case, behaviour is also much improved. Thanks much!

- Wolfgang

#5 lore raw
In reply to Peter Maydell
Quoted 8 lines · Peter Maydell

Fix the register and part of register we get the scalar from in the various "multiply vector by scalar" ops (VMUL by scalar and friends).

---
 target-arm/translate.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

Thanks, applied.

Quoted 30 lines
target-arm/translate.c +6 -6
index c60cd18..0c2856a 100644
@@ -3608,14 +3608,14 @@ static inline TCGv neon_get_scalar(int size, int reg)
 {
     TCGv tmp;
     if (size == 1) {
-        tmp = neon_load_reg(reg >> 1, reg & 1);
-    } else {
-        tmp = neon_load_reg(reg >> 2, (reg >> 1) & 1);
-        if (reg & 1) {
-            gen_neon_dup_low16(tmp);
-        } else {
+        tmp = neon_load_reg(reg & 7, reg >> 4);
+        if (reg & 8) {
             gen_neon_dup_high16(tmp);
+        } else {
+            gen_neon_dup_low16(tmp);
         }
+    } else {
+        tmp = neon_load_reg(reg & 15, reg >> 4);
     }
     return tmp;
 }
Signature · 1 line
1.6.3.3
Signature · 2 lines
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net