Skip to contentSkip to conversation

target-arm: fix Neon VUZP, VZIP instructions

PATCH In review Peter Maydell 2 participants 4 messages Feb 14, 2011 – Feb 20, 2011

lore
Share & tools
lore
#0 lore raw

v2 cover target-arm: fix Neon VUZP, VZIP instructions

This patch series fixes bugs in the Neon VZIP and VUZP instructions by abandoning the existing inline implementations in favour of calling out to straightforward helper functions. The inline routines could generate 50+ TCG ops each, which is well over the recommended limit in tcg/README for using helpers instead; they also did not give the correct results...

I've tested these patches using the usual random instruction generation approach.

V2 changes: moved the decoding of register numbers, size and q flag out of the helper functions into translate.c; split the helpers up into one per (size, q) combination.

Peter Maydell (2):
target-arm: Move Neon VUZP to helper functions
target-arm: Move Neon VZIP to helper functions

 target-arm/helpers.h     |   11 +++
 target-arm/neon_helper.c |  186 +++++++++++++++++++++++++++++++++++++++
 target-arm/translate.c   |  215 +++++++++++++++-------------------------------
 3 files changed, 267 insertions(+), 145 deletions(-)
#1 lore raw

PATCH v2 1/2 target-arm: Move Neon VUZP to helper functions

Move the implementation of the Neon VUZP unzip instruction from inline code to helper functions. (At 50+ TCG ops it was well over the recommended limit for coding inline.) The helper implementations also fix the handling of the quadword version of the instruction.

---
 target-arm/helpers.h     |    6 +++
 target-arm/neon_helper.c |   94 ++++++++++++++++++++++++++++++++++++++
 target-arm/translate.c   |  112 +++++++++++++++-------------------------------
 3 files changed, 137 insertions(+), 75 deletions(-)
target-arm/helpers.h +6 -0
index 77f1635..88c2fce 100644
@@ -460,4 +460,10 @@ DEF_HELPER_3(iwmmxt_muladdswl, i64, i64, i32, i32)
 
 DEF_HELPER_2(set_teecr, void, env, i32)
 
+DEF_HELPER_3(neon_unzip8, void, env, i32, i32)
+DEF_HELPER_3(neon_unzip16, void, env, i32, i32)
+DEF_HELPER_3(neon_qunzip8, void, env, i32, i32)
+DEF_HELPER_3(neon_qunzip16, void, env, i32, i32)
+DEF_HELPER_3(neon_qunzip32, void, env, i32, i32)
+
 #include "def-helper.h"
target-arm/neon_helper.c +94 -0

97 lines not on this page · raw message

target-arm/translate.c +37 -75

132 lines not on this page · raw message

Signature · 1 line
1.7.1
#2 lore raw

PATCH v2 2/2 target-arm: Move Neon VZIP to helper functions

In reply to Peter Maydell

Move the implementation of the Neon VUZP unzip instruction from inline code to helper functions. (At 50+ TCG ops it was well over the recommended limit for coding inline.) The helper implementations also give the correct answers where the inline implementation did not.

---
 target-arm/helpers.h     |    5 ++
 target-arm/neon_helper.c |   92 ++++++++++++++++++++++++++++++++++++++
 target-arm/translate.c   |  109 +++++++++++++++-------------------------------
 3 files changed, 133 insertions(+), 73 deletions(-)
target-arm/helpers.h +5 -0
index 88c2fce..e494b47 100644
@@ -465,5 +465,10 @@ DEF_HELPER_3(neon_unzip16, void, env, i32, i32)
 DEF_HELPER_3(neon_qunzip8, void, env, i32, i32)
 DEF_HELPER_3(neon_qunzip16, void, env, i32, i32)
 DEF_HELPER_3(neon_qunzip32, void, env, i32, i32)
+DEF_HELPER_3(neon_zip8, void, env, i32, i32)
+DEF_HELPER_3(neon_zip16, void, env, i32, i32)
+DEF_HELPER_3(neon_qzip8, void, env, i32, i32)
+DEF_HELPER_3(neon_qzip16, void, env, i32, i32)
+DEF_HELPER_3(neon_qzip32, void, env, i32, i32)
 
 #include "def-helper.h"
target-arm/neon_helper.c +92 -0

95 lines not on this page · raw message

target-arm/translate.c +36 -73

124 lines not on this page · raw message

Signature · 1 line
1.7.1
#3 lore raw
In reply to Peter Maydell
Quoted 14 lines · Peter Maydell

This patch series fixes bugs in the Neon VZIP and VUZP instructions by abandoning the existing inline implementations in favour of calling out to straightforward helper functions. The inline routines could generate 50+ TCG ops each, which is well over the recommended limit in tcg/README for using helpers instead; they also did not give the correct results...

I've tested these patches using the usual random instruction generation approach.

V2 changes: moved the decoding of register numbers, size and q flag out of the helper functions into translate.c; split the helpers up into one per (size, q) combination.

Quoted 9 lines

Peter Maydell (2):
target-arm: Move Neon VUZP to helper functions
target-arm: Move Neon VZIP to helper functions

 target-arm/helpers.h     |   11 +++
 target-arm/neon_helper.c |  186 +++++++++++++++++++++++++++++++++++++++
 target-arm/translate.c   |  215 +++++++++++++++-------------------------------
 3 files changed, 267 insertions(+), 145 deletions(-)

Thanks, both applied.

Signature · 2 lines
Aurelien Jarno                          GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net