ARM: Fix VQSHL/VQSHLU immediate forms
v2 cover ARM: Fix VQSHL/VQSHLU immediate forms
This patchset fixes errors in the decoding and implementation of the immediate forms of the VQSHL/VQSHLU ARM instructions. Tested in the usual random-instruction-set way. This is the final part of the maemo-qemu tree commit 03a2445a fixes (the first part being the already-committed VQSHL-reg patchset); the patch down as authored by me is a minor tweaking of changes in the maemo-qemu commit.
There are no code changes here since v1, I've just got the author attributions right (and added the reviewed-by tags from Aurelien, thanks!)
Juha Riihimäki (1):
ARM: add neon helpers for VQSHLU
Peter Maydell (1):
ARM: Fix decoding of VQSHL/VQSHLU immediate forms
target-arm/helpers.h | 4 +++ target-arm/neon_helper.c | 47 ++++++++++++++++++++++++++++++++++++++++++ target-arm/translate.c | 51 ++++++++++++++++++++++++++++++++------------- 3 files changed, 87 insertions(+), 15 deletions(-)
PATCH v2 1/2 ARM: add neon helpers for VQSHLU
From: Juha Riihimäki <[email protected]>
Add neon helper functions to implement VQSHLU, which is a signed-to-unsigned version of VQSHL available only as an immediate form.
--- target-arm/helpers.h | 4 +++ target-arm/neon_helper.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 0 deletions(-)
target-arm/helpers.h +4 -0
@@ -249,6 +249,10 @@ DEF_HELPER_3(neon_qshl_u32, i32, env, i32, i32) DEF_HELPER_3(neon_qshl_s32, i32, env, i32, i32) DEF_HELPER_3(neon_qshl_u64, i64, env, i64, i64) DEF_HELPER_3(neon_qshl_s64, i64, env, i64, i64) +DEF_HELPER_3 (neon_qshlu_s8, i32, env, i32, i32); +DEF_HELPER_3 (neon_qshlu_s16, i32, env, i32, i32); +DEF_HELPER_3 (neon_qshlu_s32, i32, env, i32, i32); +DEF_HELPER_3 (neon_qshlu_s64, i64, env, i64, i64); DEF_HELPER_3(neon_qrshl_u8, i32, env, i32, i32) DEF_HELPER_3(neon_qrshl_s8, i32, env, i32, i32)DEF_HELPER_3 (neon_qrshl_u16, i32, env, i32, i32)
target-arm/neon_helper.c +47 -0
53 lines not on this page · raw message
Signature · 1 line
1.6.3.3
PATCH v2 2/2 ARM: Fix decoding of VQSHL/VQSHLU immediate forms
In reply to Peter MaydellFix errors in the decoding of ARM VQSHL/VQSHLU immediate forms, including using the new VQSHLU helper functions where appropriate.
--- target-arm/translate.c | 51 +++++++++++++++++++++++++++++++++-------------- 1 files changed, 36 insertions(+), 15 deletions(-)
target-arm/translate.c +36 -15
@@ -4652,14 +4652,22 @@ static int disas_neon_data_insn(CPUState * env, DisasContext *s, uint32_t insn)case 5 :/* VSHL, VSLI */ gen_helper_neon_shl_u64 (cpu_V0, cpu_V0, cpu_V1);break ; -case 6 :/* VQSHL */ -if (u) -gen_helper_neon_qshl_u64 (cpu_V0, cpu_env, cpu_V0, cpu_V1); -else -gen_helper_neon_qshl_s64 (cpu_V0, cpu_env, cpu_V0, cpu_V1); +case 6 :/* VQSHLU */ +if (u) { +gen_helper_neon_qshlu_s64 (cpu_V0, cpu_env, + cpu_V0, cpu_V1); + }else { +return 1 ; + }break ; -case 7 :/* VQSHLU */ -gen_helper_neon_qshl_u64 (cpu_V0, cpu_env, cpu_V0, cpu_V1); +case 7 :/* VQSHL */ +if (u) { +gen_helper_neon_qshl_u64 (cpu_V0, cpu_env, + cpu_V0, cpu_V1); + }else { +gen_helper_neon_qshl_s64 (cpu_V0, cpu_env, + cpu_V0, cpu_V1); + }break ; }if (op ==1 || op ==3 ) {
@@ -4698,17 +4706,30 @@ static int disas_neon_data_insn(CPUState * env, DisasContext *s, uint32_t insn)default :return 1 ; }break ; -case 6 :/* VQSHL */ -GEN_NEON_INTEGER_OP_ENV (qshl); -break ; -case 7 :/* VQSHLU */ +case 6 :/* VQSHLU */ +if (!u) { +return 1 ; + }switch (size) { -case 0 :gen_helper_neon_qshl_u8 (tmp, cpu_env, tmp, tmp2);break ; -case 1 :gen_helper_neon_qshl_u16 (tmp, cpu_env, tmp, tmp2);break ; -case 2 :gen_helper_neon_qshl_u32 (tmp, cpu_env, tmp, tmp2);break ; -default :return 1 ; +case 0 : +gen_helper_neon_qshlu_s8 (tmp, cpu_env, + tmp, tmp2); +break ; +case 1 : +gen_helper_neon_qshlu_s16 (tmp, cpu_env, + tmp, tmp2); +break ; +case 2 : +gen_helper_neon_qshlu_s32 (tmp, cpu_env, + tmp, tmp2); +break ; +default : +return 1 ; }break ; +case 7 :/* VQSHL */ +GEN_NEON_INTEGER_OP_ENV (qshl); +break ; }dead_tmp (tmp2);
Signature · 1 line
1.6.3.3
Quoted 14 lines · Peter Maydell
This patchset fixes errors in the decoding and implementation of the immediate forms of the VQSHL/VQSHLU ARM instructions. Tested in the usual random-instruction-set way. This is the final part of the maemo-qemu tree commit
03a2445afixes (the first part being the already-committed VQSHL-reg patchset); the patch down as authored by me is a minor tweaking of changes in the maemo-qemu commit.There are no code changes here since v1, I've just got the author attributions right (and added the reviewed-by tags from Aurelien, thanks!)
Juha Riihimäki (1):
ARM: add neon helpers for VQSHLU
Quoted 8 lines
Peter Maydell (1):
ARM: Fix decoding of VQSHL/VQSHLU immediate formstarget-arm/helpers.h | 4 +++ target-arm/neon_helper.c | 47 ++++++++++++++++++++++++++++++++++++++++++ target-arm/translate.c | 51 ++++++++++++++++++++++++++++++++------------- 3 files changed, 87 insertions(+), 15 deletions(-)
Thanks, both applied.
Signature · 2 lines
Aurelien Jarno GPG: 1024D/F1BCDB73 [email protected] http://www.aurel32.net