Skip to contentSkip to conversation

more tcg-arm cleanups

PATCH In review Richard Henderson 2 participants 5 messages Apr 29, 2013 – May 3, 2013

lore
Share & tools
lore
#0 lore raw

cover more tcg-arm cleanups

The first patch really ought to get into 1.5.

The second patch is a re-done version of the 19/19 patch from version 5 of the previous patch series. We had dropped that due to wanting to avoid 16MB assumption changes. The revised patch merely changes how we handle the constant that needs loading.

Please apply.

r~

Richard Henderson (2):
tcg-arm: Fix 64-bit tlb load for pre-v6
tcg-arm: Use movi32 in exit_tb

 tcg/arm/tcg-target.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)
Signature · 1 line
1.8.1.4
#1 lore raw

PATCH 1/2 tcg-arm: Fix 64-bit tlb load for pre-v6

Found by inspection, since the effect of the bug was simply to send all memory ops through the slow path.

---
 tcg/arm/tcg-target.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tcg/arm/tcg-target.c +1 -1
index 7216f7a..12edad4 100644
@@ -1190,7 +1190,7 @@ static void tcg_out_tlb_read(TCGContext *s, TCGReg addrlo, TCGReg addrhi,
         tcg_out_memop_12(s, COND_AL, INSN_LDR_IMM, TCG_REG_R0,
                          TCG_REG_R2, tlb_offset, 1, 1);
         if (TARGET_LONG_BITS == 64) {
-            tcg_out_memop_12(s, COND_AL, INSN_LDR_IMM, TCG_REG_R0,
+            tcg_out_memop_12(s, COND_AL, INSN_LDR_IMM, TCG_REG_R1,
                              TCG_REG_R2, 4, 1, 0);
         }
     }
Signature · 1 line
1.8.1.4
#2 lore raw

PATCH 2/2 tcg-arm: Use movi32 in exit_tb

In reply to Richard Henderson

Avoid the mini constant pool for armv7, and avoid replicating the test for pre-v7.

---
 tcg/arm/tcg-target.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)
tcg/arm/tcg-target.c +7 -9
index 12edad4..3d43412 100644
@@ -1611,17 +1611,15 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc,
 
     switch (opc) {
     case INDEX_op_exit_tb:
-        {
+        if (use_armv7_instructions || check_fit_imm(args[0])) {
+            tcg_out_movi32(s, COND_AL, TCG_REG_R0, args[0]);
+            tcg_out_goto(s, COND_AL, (tcg_target_ulong) tb_ret_addr);
+        } else {
             uint8_t *ld_ptr = s->code_ptr;
-            if (args[0] >> 8)
-                tcg_out_ld32_12(s, COND_AL, TCG_REG_R0, TCG_REG_PC, 0);
-            else
-                tcg_out_dat_imm(s, COND_AL, ARITH_MOV, TCG_REG_R0, 0, args[0]);
+            tcg_out_ld32_12(s, COND_AL, TCG_REG_R0, TCG_REG_PC, 0);
             tcg_out_goto(s, COND_AL, (tcg_target_ulong) tb_ret_addr);
-            if (args[0] >> 8) {
-                *ld_ptr = (uint8_t) (s->code_ptr - ld_ptr) - 8;
-                tcg_out32(s, args[0]);
-            }
+            *ld_ptr = (uint8_t) (s->code_ptr - ld_ptr) - 8;
+            tcg_out32(s, args[0]);
         }
         break;
     case INDEX_op_goto_tb:
Signature · 1 line
1.8.1.4
#3 lore raw
In reply to Richard Henderson

Quick ping since the freeze is coming soon...

r~

Quoted 20 lines · Richard Henderson

The first patch really ought to get into 1.5.

The second patch is a re-done version of the 19/19 patch from version 5 of the previous patch series. We had dropped that due to wanting to avoid 16MB assumption changes. The revised patch merely changes how we handle the constant that needs loading.

Please apply.

r~

Richard Henderson (2):
tcg-arm: Fix 64-bit tlb load for pre-v6
tcg-arm: Use movi32 in exit_tb

  tcg/arm/tcg-target.c | 18 ++++++++----------
  1 file changed, 8 insertions(+), 10 deletions(-)
#4 lore raw
In reply to Richard Henderson
Quoted 13 lines · Richard Henderson

The first patch really ought to get into 1.5.

The second patch is a re-done version of the 19/19 patch from version 5 of the previous patch series. We had dropped that due to wanting to avoid 16MB assumption changes. The revised patch merely changes how we handle the constant that needs loading.

Please apply.

r~

Quoted 7 lines

Richard Henderson (2):
tcg-arm: Fix 64-bit tlb load for pre-v6
tcg-arm: Use movi32 in exit_tb

 tcg/arm/tcg-target.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

Thanks, both applied.

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