fix ARM parallel instructions implementation bug
cover fix ARM parallel instructions implementation bug
The three patches focuse on Bugs 595906 & Bug 591320. The first is related to Bug 595906 and the other solve Bug 591320.
The series are also attached in the threads, listed below
https://bugs.launchpad.net/qemu/+bug/595906
https://bugs.launchpad.net/qemu/+bug/591320
[PATCH 1/3] target-arm: fix addsub/subadd implementation [PATCH 2/3] target-arm : fix thumb2 parallel add/sub opcode decoding [PATCH 3/3] target-arm : fix parallel saturated subtraction implementation
PATCH 1/3 target-arm: fix addsub/subadd implementation
--- target-arm/op_addsub.h | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
target-arm/op_addsub.h +4 -4
@@ -73,8 +73,8 @@ uint32_t HELPER(glue(PFX,subaddx))(uint32_t a, uint32_t b GE_ARG)uint32_t res =0 ;DECLARE_GE ; -ADD16 (a, b,0 ); -SUB16 (a >>16 , b >>16 ,1 ); +ADD16 (a, b >>16 ,0 ); +SUB16 (a >>16 , b,1 );SET_GE ;return res; }
@@ -84,8 +84,8 @@ uint32_t HELPER(glue(PFX,addsubx))(uint32_t a, uint32_t b GE_ARG)uint32_t res =0 ;DECLARE_GE ; -SUB16 (a, b,0 ); -ADD16 (a >>16 , b >>16 ,1 ); +SUB16 (a, b >>16 ,0 ); +ADD16 (a >>16 , b,1 );SET_GE ;return res; }
Signature · 1 line
1.7.0.4
PATCH 2/3 target-arm : fix thumb2 parallel add/sub opcode decoding ref : DDI0406B_arm_architecture_reference_manual_errata_markup_4_0.pdf section A6.3.1[34]
In reply to Chih-Min Chao--- target-arm/translate.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
target-arm/translate.c +2 -2
@@ -561,7 +561,7 @@ static void gen_arm_parallel_addsub(int op1, int op2, TCGv a, TCGv b)/* For unknown reasons Arm and Thumb-2 use arbitrarily different encodings. */ #define PAS_OP (pfx) \ - switch (op2) { \ + switch (op1) { \ case 0: gen_pas_helper(glue(pfx,add8)); break; \ case 1: gen_pas_helper(glue(pfx,add16)); break; \ case 2: gen_pas_helper(glue(pfx,addsubx)); break; \
@@ -573,7 +573,7 @@ static void gen_thumb2_parallel_addsub(int op1, int op2, TCGv a, TCGv b) {TCGv_ptr tmp; -switch (op1) { +switch (op2) {#define gen_pas_helper (name) glue(gen_helper_,name)(a, a, b, tmp)case 0 : tmp =tcg_temp_new_ptr ();
Signature · 1 line
1.7.0.4
PATCH 3/3 target-arm : fix parallel saturated subtraction implementation
In reply to Chih-Min Chao--- target-arm/helper.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
target-arm/helper.c +2 -2
@@ -2047,7 +2047,7 @@ static inline uint16_t add16_usat(uint16_t a, uint16_t b)static inline uint16_t sub16_usat (uint16_t a,uint16_t b) { -if (a < b) +if (a > b)return a - b;else return 0 ;
@@ -2064,7 +2064,7 @@ static inline uint8_t add8_usat(uint8_t a, uint8_t b)static inline uint8_t sub8_usat (uint8_t a,uint8_t b) { -if (a < b) +if (a > b)return a - b;else return 0 ;
Signature · 1 line
1.7.0.4
Quoted 12 lines · Chih-Min Chao
The three patches focuse on Bugs 595906 & Bug 591320. The first is related to Bug 595906 and the other solve Bug 591320.
The series are also attached in the threads, listed below
https://bugs.launchpad.net/qemu/+bug/595906
https://bugs.launchpad.net/qemu/+bug/591320[PATCH 1/3] target-arm: fix addsub/subadd implementation [PATCH 2/3] target-arm : fix thumb2 parallel add/sub opcode decoding [PATCH 3/3] target-arm : fix parallel saturated subtraction implementation
Thanks, all applied.
Signature · 2 lines
Aurelien Jarno GPG: 1024D/F1BCDB73 [email protected] http://www.aurel32.net