diff mbox series

[v3,08/16] tcg/s390: Remove retranslation code

Message ID 20181130215221.20554-9-richard.henderson@linaro.org
State Superseded
Headers show
Series tcg: Assorted cleanups | expand

Commit Message

Richard Henderson Nov. 30, 2018, 9:52 p.m. UTC
There is no longer a need for preserving branch offset operands,
as we no longer re-translate.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 tcg/s390/tcg-target.inc.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

-- 
2.17.2

Comments

Alex Bennée Dec. 3, 2018, 10:37 a.m. UTC | #1
Richard Henderson <richard.henderson@linaro.org> writes:

> There is no longer a need for preserving branch offset operands,

> as we no longer re-translate.

>

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


Reviewed-by: Alex Bennée <alex.bennee@linaro.org>


> ---

>  tcg/s390/tcg-target.inc.c | 10 ++--------

>  1 file changed, 2 insertions(+), 8 deletions(-)

>

> diff --git a/tcg/s390/tcg-target.inc.c b/tcg/s390/tcg-target.inc.c

> index 17c435ade5..96c344142e 100644

> --- a/tcg/s390/tcg-target.inc.c

> +++ b/tcg/s390/tcg-target.inc.c

> @@ -1329,13 +1329,11 @@ static void tgen_branch(TCGContext *s, int cc, TCGLabel *l)

>  static void tgen_compare_branch(TCGContext *s, S390Opcode opc, int cc,

>                                  TCGReg r1, TCGReg r2, TCGLabel *l)

>  {

> -    intptr_t off;

> +    intptr_t off = 0;

>

>      if (l->has_value) {

>          off = l->u.value_ptr - s->code_ptr;

>      } else {

> -        /* We need to keep the offset unchanged for retranslation.  */

> -        off = s->code_ptr[1];

>          tcg_out_reloc(s, s->code_ptr + 1, R_390_PC16DBL, l, 2);

>      }

>

> @@ -1347,13 +1345,11 @@ static void tgen_compare_branch(TCGContext *s, S390Opcode opc, int cc,

>  static void tgen_compare_imm_branch(TCGContext *s, S390Opcode opc, int cc,

>                                      TCGReg r1, int i2, TCGLabel *l)

>  {

> -    tcg_target_long off;

> +    tcg_target_long off = 0;

>

>      if (l->has_value) {

>          off = l->u.value_ptr - s->code_ptr;

>      } else {

> -        /* We need to keep the offset unchanged for retranslation.  */

> -        off = s->code_ptr[1];

>          tcg_out_reloc(s, s->code_ptr + 1, R_390_PC16DBL, l, 2);

>      }

>

> @@ -1696,7 +1692,6 @@ static void tcg_out_qemu_ld(TCGContext* s, TCGReg data_reg, TCGReg addr_reg,

>

>      base_reg = tcg_out_tlb_read(s, addr_reg, opc, mem_index, 1);

>

> -    /* We need to keep the offset unchanged for retranslation.  */

>      tcg_out16(s, RI_BRC | (S390_CC_NE << 4));

>      label_ptr = s->code_ptr;

>      s->code_ptr += 1;

> @@ -1724,7 +1719,6 @@ static void tcg_out_qemu_st(TCGContext* s, TCGReg data_reg, TCGReg addr_reg,

>

>      base_reg = tcg_out_tlb_read(s, addr_reg, opc, mem_index, 0);

>

> -    /* We need to keep the offset unchanged for retranslation.  */

>      tcg_out16(s, RI_BRC | (S390_CC_NE << 4));

>      label_ptr = s->code_ptr;

>      s->code_ptr += 1;



--
Alex Bennée
diff mbox series

Patch

diff --git a/tcg/s390/tcg-target.inc.c b/tcg/s390/tcg-target.inc.c
index 17c435ade5..96c344142e 100644
--- a/tcg/s390/tcg-target.inc.c
+++ b/tcg/s390/tcg-target.inc.c
@@ -1329,13 +1329,11 @@  static void tgen_branch(TCGContext *s, int cc, TCGLabel *l)
 static void tgen_compare_branch(TCGContext *s, S390Opcode opc, int cc,
                                 TCGReg r1, TCGReg r2, TCGLabel *l)
 {
-    intptr_t off;
+    intptr_t off = 0;
 
     if (l->has_value) {
         off = l->u.value_ptr - s->code_ptr;
     } else {
-        /* We need to keep the offset unchanged for retranslation.  */
-        off = s->code_ptr[1];
         tcg_out_reloc(s, s->code_ptr + 1, R_390_PC16DBL, l, 2);
     }
 
@@ -1347,13 +1345,11 @@  static void tgen_compare_branch(TCGContext *s, S390Opcode opc, int cc,
 static void tgen_compare_imm_branch(TCGContext *s, S390Opcode opc, int cc,
                                     TCGReg r1, int i2, TCGLabel *l)
 {
-    tcg_target_long off;
+    tcg_target_long off = 0;
 
     if (l->has_value) {
         off = l->u.value_ptr - s->code_ptr;
     } else {
-        /* We need to keep the offset unchanged for retranslation.  */
-        off = s->code_ptr[1];
         tcg_out_reloc(s, s->code_ptr + 1, R_390_PC16DBL, l, 2);
     }
 
@@ -1696,7 +1692,6 @@  static void tcg_out_qemu_ld(TCGContext* s, TCGReg data_reg, TCGReg addr_reg,
 
     base_reg = tcg_out_tlb_read(s, addr_reg, opc, mem_index, 1);
 
-    /* We need to keep the offset unchanged for retranslation.  */
     tcg_out16(s, RI_BRC | (S390_CC_NE << 4));
     label_ptr = s->code_ptr;
     s->code_ptr += 1;
@@ -1724,7 +1719,6 @@  static void tcg_out_qemu_st(TCGContext* s, TCGReg data_reg, TCGReg addr_reg,
 
     base_reg = tcg_out_tlb_read(s, addr_reg, opc, mem_index, 0);
 
-    /* We need to keep the offset unchanged for retranslation.  */
     tcg_out16(s, RI_BRC | (S390_CC_NE << 4));
     label_ptr = s->code_ptr;
     s->code_ptr += 1;