Skip to contentSkip to conversation

target/arm: Fix PC test for LDM (exception return)

PATCH Applied Richard Henderson 3 participants 3 messages Mar 1, 2019 – Mar 4, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/arm: Fix PC test for LDM (exception return)

Found by inspection: Rn is the base register against which the load began; I is the register within the mask being processed. The exception return should of course be procesed from the loaded PC.

---
 target/arm/translate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/arm/translate.c +1 -1
index 8f7f5b95aa..ad879e3480 100644
@@ -10612,7 +10612,7 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn)
                             } else if (i == rn) {
                                 loaded_var = tmp;
                                 loaded_base = 1;
-                            } else if (rn == 15 && exc_return) {
+                            } else if (i == 15 && exc_return) {
                                 store_pc_exc_ret(s, tmp);
                             } else {
                                 store_reg_from_load(s, i, tmp);
Signature · 1 line
2.17.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Richard Henderson

Found by inspection: Rn is the base register against which the load began; I is the register within the mask being processed. The exception return should of course be procesed from the loaded PC.

"processed"

Quoted 12 lines
---
 target/arm/translate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/arm/translate.c +0 -0
index 8f7f5b95aa..ad879e3480 100644

target/arm/translate.c static void disas_arm_insn(DisasContext *s, unsigned int insn) · line 10618

Quoted 8 lines
target/arm/translate.c +1 -1
@@ -10612,7 +10612,7 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn)
                             } else if (i == rn) {
                                 loaded_var = tmp;
                                 loaded_base = 1;
-                            } else if (rn == 15 && exc_return) {
+                            } else if (i == 15 && exc_return) {
                                 store_pc_exc_ret(s, tmp);
                             } else {
                                 store_reg_from_load(s, i, tmp);
#2 lore raw
Quoted 14 lines · Philippe Mathieu-Daudé
Quoted 3 lines · Richard Henderson

Found by inspection: Rn is the base register against which the load began; I is the register within the mask being processed. The exception return should of course be procesed from the loaded PC.

"processed"

Quoted 6 lines
---
 target/arm/translate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines
Quoted 6 lines
target/arm/translate.c +0 -0
index 8f7f5b95aa..ad879e3480 100644

target/arm/translate.c static void disas_arm_insn(DisasContext *s, unsigned int insn) · line 10618

Quoted 8 lines
target/arm/translate.c +1 -1
@@ -10612,7 +10612,7 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn)
                             } else if (i == rn) {
                                 loaded_var = tmp;
                                 loaded_base = 1;
-                            } else if (rn == 15 && exc_return) {
+                            } else if (i == 15 && exc_return) {
                                 store_pc_exc_ret(s, tmp);
                             } else {
                                 store_reg_from_load(s, i, tmp);

Applied to target-arm.next (with the typo fixed), thanks.

-- PMM