All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/47] target/arm: Use tcg_constant
@ 2022-04-26 16:29 Richard Henderson
  2022-04-26 16:29 ` [PATCH 01/47] target/arm: Use tcg_constant in gen_probe_access Richard Henderson
                   ` (47 more replies)
  0 siblings, 48 replies; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:29 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Split the tcg_constant patches out of my larger v3 cleanups
patch set, and then split the 5 patches into tiny bites.


r~


Richard Henderson (47):
  target/arm: Use tcg_constant in gen_probe_access
  target/arm: Use tcg_constant in gen_mte_check*
  target/arm: Use tcg_constant in gen_exception*
  target/arm: Use tcg_constant in gen_adc_CC
  target/arm: Use tcg_constant in handle_msr_i
  target/arm: Use tcg_constant in handle_sys
  target/arm: Use tcg_constant in disas_exc
  target/arm: Use tcg_constant in gen_compare_and_swap_pair
  target/arm: Use tcg_constant in disas_ld_lit
  target/arm: Use tcg_constant in disas_ldst_*
  target/arm: Use tcg_constant in disas_add_sum_imm*
  target/arm: Use tcg_constant in disas_movw_imm
  target/arm: Use tcg_constant in shift_reg_imm
  target/arm: Use tcg_constant in disas_cond_select
  target/arm: Use tcg_constant in handle_{rev16,crc32}
  target/arm: Use tcg_constant in disas_data_proc_2src
  target/arm: Use tcg_constant in disas_fp*
  target/arm: Use tcg_constant in simd shift expanders
  target/arm: Use tcg_constant in simd fp/int conversion
  target/arm: Use tcg_constant in 2misc expanders
  target/arm: Use tcg_constant in balance of translate-a64.c
  target/arm: Use tcg_constant for aa32 exceptions
  target/arm: Use tcg_constant for disas_iwmmxt_insn
  target/arm: Use tcg_constant for gen_{msr,mrs}
  target/arm: Use tcg_constant for vector shift expanders
  target/arm: Use tcg_constant for do_coproc_insn
  target/arm: Use tcg_constant for gen_srs
  target/arm: Use tcg_constant for op_s_{rri,rxi}_rot
  target/arm: Use tcg_constant for MOVW, UMAAL, CRC32
  target/arm: Use tcg_constant for v7m MRS, MSR
  target/arm: Use tcg_constant for TT, SAT, SMMLA
  target/arm: Use tcg_constant in LDM, STM
  target/arm: Use tcg_constant in CLRM, DLS, WLS, LE
  target/arm: Use tcg_constant in trans_CPS_v7m
  target/arm: Use tcg_constant in trans_CSEL
  target/arm: Use tcg_constant for trans_INDEX_*
  target/arm: Use tcg_constant in SINCDEC, INCDEC
  target/arm: Use tcg_constant in FCPY, CPY
  target/arm: Use tcg_constant in {incr,wrap}_last_active
  target/arm: Use tcg_constant in do_clast_scalar
  target/arm: Use tcg_constant in WHILE
  target/arm: Use tcg_constant in LD1, ST1
  target/arm: Use tcg_constant in SUBR
  target/arm: Use tcg_constant in do_zzi_{sat,ool}, do_fp_imm
  target/arm: Use tcg_constant for predicate descriptors
  target/arm: Use tcg_constant for do_brk{2,3}
  target/arm: Use tcg_constant for vector descriptor

 target/arm/translate-a64.c | 302 +++++++++++--------------------------
 target/arm/translate-sve.c | 202 +++++++++----------------
 target/arm/translate.c     | 244 ++++++++++--------------------
 3 files changed, 241 insertions(+), 507 deletions(-)

-- 
2.34.1



^ permalink raw reply	[flat|nested] 97+ messages in thread

* [PATCH 01/47] target/arm: Use tcg_constant in gen_probe_access
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
@ 2022-04-26 16:29 ` Richard Henderson
  2022-04-28  9:36   ` Peter Maydell
  2022-04-26 16:29 ` [PATCH 02/47] target/arm: Use tcg_constant in gen_mte_check* Richard Henderson
                   ` (46 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:29 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-a64.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index adbcd99941..c6ab0433af 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -240,14 +240,10 @@ static void gen_address_with_allocation_tag0(TCGv_i64 dst, TCGv_i64 src)
 static void gen_probe_access(DisasContext *s, TCGv_i64 ptr,
                              MMUAccessType acc, int log2_size)
 {
-    TCGv_i32 t_acc = tcg_const_i32(acc);
-    TCGv_i32 t_idx = tcg_const_i32(get_mem_index(s));
-    TCGv_i32 t_size = tcg_const_i32(1 << log2_size);
-
-    gen_helper_probe_access(cpu_env, ptr, t_acc, t_idx, t_size);
-    tcg_temp_free_i32(t_acc);
-    tcg_temp_free_i32(t_idx);
-    tcg_temp_free_i32(t_size);
+    gen_helper_probe_access(cpu_env, ptr,
+                            tcg_constant_i32(acc),
+                            tcg_constant_i32(get_mem_index(s)),
+                            tcg_constant_i32(1 << log2_size));
 }
 
 /*
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 02/47] target/arm: Use tcg_constant in gen_mte_check*
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
  2022-04-26 16:29 ` [PATCH 01/47] target/arm: Use tcg_constant in gen_probe_access Richard Henderson
@ 2022-04-26 16:29 ` Richard Henderson
  2022-04-28  9:36   ` Peter Maydell
  2022-04-26 16:29 ` [PATCH 03/47] target/arm: Use tcg_constant in gen_exception* Richard Henderson
                   ` (45 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:29 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-a64.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index c6ab0433af..7b5bfb0889 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -258,7 +258,6 @@ static TCGv_i64 gen_mte_check1_mmuidx(DisasContext *s, TCGv_i64 addr,
                                       int core_idx)
 {
     if (tag_checked && s->mte_active[is_unpriv]) {
-        TCGv_i32 tcg_desc;
         TCGv_i64 ret;
         int desc = 0;
 
@@ -267,11 +266,9 @@ static TCGv_i64 gen_mte_check1_mmuidx(DisasContext *s, TCGv_i64 addr,
         desc = FIELD_DP32(desc, MTEDESC, TCMA, s->tcma);
         desc = FIELD_DP32(desc, MTEDESC, WRITE, is_write);
         desc = FIELD_DP32(desc, MTEDESC, SIZEM1, (1 << log2_size) - 1);
-        tcg_desc = tcg_const_i32(desc);
 
         ret = new_tmp_a64(s);
-        gen_helper_mte_check(ret, cpu_env, tcg_desc, addr);
-        tcg_temp_free_i32(tcg_desc);
+        gen_helper_mte_check(ret, cpu_env, tcg_constant_i32(desc), addr);
 
         return ret;
     }
@@ -292,7 +289,6 @@ TCGv_i64 gen_mte_checkN(DisasContext *s, TCGv_i64 addr, bool is_write,
                         bool tag_checked, int size)
 {
     if (tag_checked && s->mte_active[0]) {
-        TCGv_i32 tcg_desc;
         TCGv_i64 ret;
         int desc = 0;
 
@@ -301,11 +297,9 @@ TCGv_i64 gen_mte_checkN(DisasContext *s, TCGv_i64 addr, bool is_write,
         desc = FIELD_DP32(desc, MTEDESC, TCMA, s->tcma);
         desc = FIELD_DP32(desc, MTEDESC, WRITE, is_write);
         desc = FIELD_DP32(desc, MTEDESC, SIZEM1, size - 1);
-        tcg_desc = tcg_const_i32(desc);
 
         ret = new_tmp_a64(s);
-        gen_helper_mte_check(ret, cpu_env, tcg_desc, addr);
-        tcg_temp_free_i32(tcg_desc);
+        gen_helper_mte_check(ret, cpu_env, tcg_constant_i32(desc), addr);
 
         return ret;
     }
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 03/47] target/arm: Use tcg_constant in gen_exception*
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
  2022-04-26 16:29 ` [PATCH 01/47] target/arm: Use tcg_constant in gen_probe_access Richard Henderson
  2022-04-26 16:29 ` [PATCH 02/47] target/arm: Use tcg_constant in gen_mte_check* Richard Henderson
@ 2022-04-26 16:29 ` Richard Henderson
  2022-04-28  9:37   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 04/47] target/arm: Use tcg_constant in gen_adc_CC Richard Henderson
                   ` (44 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:29 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-a64.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index 7b5bfb0889..b0b5e8b26d 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -338,11 +338,8 @@ static void gen_rebuild_hflags(DisasContext *s)
 
 static void gen_exception_internal(int excp)
 {
-    TCGv_i32 tcg_excp = tcg_const_i32(excp);
-
     assert(excp_is_internal(excp));
-    gen_helper_exception_internal(cpu_env, tcg_excp);
-    tcg_temp_free_i32(tcg_excp);
+    gen_helper_exception_internal(cpu_env, tcg_constant_i32(excp));
 }
 
 static void gen_exception_internal_insn(DisasContext *s, uint64_t pc, int excp)
@@ -354,12 +351,8 @@ static void gen_exception_internal_insn(DisasContext *s, uint64_t pc, int excp)
 
 static void gen_exception_bkpt_insn(DisasContext *s, uint32_t syndrome)
 {
-    TCGv_i32 tcg_syn;
-
     gen_a64_set_pc_im(s->pc_curr);
-    tcg_syn = tcg_const_i32(syndrome);
-    gen_helper_exception_bkpt_insn(cpu_env, tcg_syn);
-    tcg_temp_free_i32(tcg_syn);
+    gen_helper_exception_bkpt_insn(cpu_env, tcg_constant_i32(syndrome));
     s->base.is_jmp = DISAS_NORETURN;
 }
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 04/47] target/arm: Use tcg_constant in gen_adc_CC
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (2 preceding siblings ...)
  2022-04-26 16:29 ` [PATCH 03/47] target/arm: Use tcg_constant in gen_exception* Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28  9:39   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 05/47] target/arm: Use tcg_constant in handle_msr_i Richard Henderson
                   ` (43 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Note that tmp was doing double-duty as zero
and then later as a temporary in its own right.
Split the use of 0 to a new variable 'zero'.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-a64.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index b0b5e8b26d..5c0fd897d6 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -814,15 +814,15 @@ static void gen_adc(int sf, TCGv_i64 dest, TCGv_i64 t0, TCGv_i64 t1)
 static void gen_adc_CC(int sf, TCGv_i64 dest, TCGv_i64 t0, TCGv_i64 t1)
 {
     if (sf) {
-        TCGv_i64 result, cf_64, vf_64, tmp;
-        result = tcg_temp_new_i64();
-        cf_64 = tcg_temp_new_i64();
-        vf_64 = tcg_temp_new_i64();
-        tmp = tcg_const_i64(0);
+        TCGv_i64 result = tcg_temp_new_i64();
+        TCGv_i64 cf_64 = tcg_temp_new_i64();
+        TCGv_i64 vf_64 = tcg_temp_new_i64();
+        TCGv_i64 tmp = tcg_temp_new_i64();
+        TCGv_i64 zero = tcg_constant_i64(0);
 
         tcg_gen_extu_i32_i64(cf_64, cpu_CF);
-        tcg_gen_add2_i64(result, cf_64, t0, tmp, cf_64, tmp);
-        tcg_gen_add2_i64(result, cf_64, result, cf_64, t1, tmp);
+        tcg_gen_add2_i64(result, cf_64, t0, zero, cf_64, zero);
+        tcg_gen_add2_i64(result, cf_64, result, cf_64, t1, zero);
         tcg_gen_extrl_i64_i32(cpu_CF, cf_64);
         gen_set_NZ64(result);
 
@@ -838,15 +838,15 @@ static void gen_adc_CC(int sf, TCGv_i64 dest, TCGv_i64 t0, TCGv_i64 t1)
         tcg_temp_free_i64(cf_64);
         tcg_temp_free_i64(result);
     } else {
-        TCGv_i32 t0_32, t1_32, tmp;
-        t0_32 = tcg_temp_new_i32();
-        t1_32 = tcg_temp_new_i32();
-        tmp = tcg_const_i32(0);
+        TCGv_i32 t0_32 = tcg_temp_new_i32();
+        TCGv_i32 t1_32 = tcg_temp_new_i32();
+        TCGv_i32 tmp = tcg_temp_new_i32();
+        TCGv_i32 zero = tcg_constant_i32(0);
 
         tcg_gen_extrl_i64_i32(t0_32, t0);
         tcg_gen_extrl_i64_i32(t1_32, t1);
-        tcg_gen_add2_i32(cpu_NF, cpu_CF, t0_32, tmp, cpu_CF, tmp);
-        tcg_gen_add2_i32(cpu_NF, cpu_CF, cpu_NF, cpu_CF, t1_32, tmp);
+        tcg_gen_add2_i32(cpu_NF, cpu_CF, t0_32, zero, cpu_CF, zero);
+        tcg_gen_add2_i32(cpu_NF, cpu_CF, cpu_NF, cpu_CF, t1_32, zero);
 
         tcg_gen_mov_i32(cpu_ZF, cpu_NF);
         tcg_gen_xor_i32(cpu_VF, cpu_NF, t0_32);
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 05/47] target/arm: Use tcg_constant in handle_msr_i
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (3 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 04/47] target/arm: Use tcg_constant in gen_adc_CC Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28  9:39   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 06/47] target/arm: Use tcg_constant in handle_sys Richard Henderson
                   ` (42 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-a64.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index 5c0fd897d6..ec4765362b 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -1615,7 +1615,6 @@ static void gen_axflag(void)
 static void handle_msr_i(DisasContext *s, uint32_t insn,
                          unsigned int op1, unsigned int op2, unsigned int crm)
 {
-    TCGv_i32 t1;
     int op = op1 << 3 | op2;
 
     /* End the TB by default, chaining is ok.  */
@@ -1674,9 +1673,7 @@ static void handle_msr_i(DisasContext *s, uint32_t insn,
         if (s->current_el == 0) {
             goto do_unallocated;
         }
-        t1 = tcg_const_i32(crm & PSTATE_SP);
-        gen_helper_msr_i_spsel(cpu_env, t1);
-        tcg_temp_free_i32(t1);
+        gen_helper_msr_i_spsel(cpu_env, tcg_constant_i32(crm & PSTATE_SP));
         break;
 
     case 0x19: /* SSBS */
@@ -1704,15 +1701,11 @@ static void handle_msr_i(DisasContext *s, uint32_t insn,
         break;
 
     case 0x1e: /* DAIFSet */
-        t1 = tcg_const_i32(crm);
-        gen_helper_msr_i_daifset(cpu_env, t1);
-        tcg_temp_free_i32(t1);
+        gen_helper_msr_i_daifset(cpu_env, tcg_constant_i32(crm));
         break;
 
     case 0x1f: /* DAIFClear */
-        t1 = tcg_const_i32(crm);
-        gen_helper_msr_i_daifclear(cpu_env, t1);
-        tcg_temp_free_i32(t1);
+        gen_helper_msr_i_daifclear(cpu_env, tcg_constant_i32(crm));
         /* For DAIFClear, exit the cpu loop to re-evaluate pending IRQs.  */
         s->base.is_jmp = DISAS_UPDATE_EXIT;
         break;
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 06/47] target/arm: Use tcg_constant in handle_sys
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (4 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 05/47] target/arm: Use tcg_constant in handle_msr_i Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28  9:41   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 07/47] target/arm: Use tcg_constant in disas_exc Richard Henderson
                   ` (41 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-a64.c | 31 +++++++++----------------------
 1 file changed, 9 insertions(+), 22 deletions(-)

diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index ec4765362b..5d1bccaf46 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -1818,19 +1818,14 @@ static void handle_sys(DisasContext *s, uint32_t insn, bool isread,
         /* Emit code to perform further access permissions checks at
          * runtime; this may result in an exception.
          */
-        TCGv_ptr tmpptr;
-        TCGv_i32 tcg_syn, tcg_isread;
         uint32_t syndrome;
 
-        gen_a64_set_pc_im(s->pc_curr);
-        tmpptr = tcg_const_ptr(ri);
         syndrome = syn_aa64_sysregtrap(op0, op1, op2, crn, crm, rt, isread);
-        tcg_syn = tcg_const_i32(syndrome);
-        tcg_isread = tcg_const_i32(isread);
-        gen_helper_access_check_cp_reg(cpu_env, tmpptr, tcg_syn, tcg_isread);
-        tcg_temp_free_ptr(tmpptr);
-        tcg_temp_free_i32(tcg_syn);
-        tcg_temp_free_i32(tcg_isread);
+        gen_a64_set_pc_im(s->pc_curr);
+        gen_helper_access_check_cp_reg(cpu_env,
+                                       tcg_constant_ptr(ri),
+                                       tcg_constant_i32(syndrome),
+                                       tcg_constant_i32(isread));
     } else if (ri->type & ARM_CP_RAISES_EXC) {
         /*
          * The readfn or writefn might raise an exception;
@@ -1861,17 +1856,15 @@ static void handle_sys(DisasContext *s, uint32_t insn, bool isread,
     case ARM_CP_DC_ZVA:
         /* Writes clear the aligned block of memory which rt points into. */
         if (s->mte_active[0]) {
-            TCGv_i32 t_desc;
             int desc = 0;
 
             desc = FIELD_DP32(desc, MTEDESC, MIDX, get_mem_index(s));
             desc = FIELD_DP32(desc, MTEDESC, TBI, s->tbid);
             desc = FIELD_DP32(desc, MTEDESC, TCMA, s->tcma);
-            t_desc = tcg_const_i32(desc);
 
             tcg_rt = new_tmp_a64(s);
-            gen_helper_mte_check_zva(tcg_rt, cpu_env, t_desc, cpu_reg(s, rt));
-            tcg_temp_free_i32(t_desc);
+            gen_helper_mte_check_zva(tcg_rt, cpu_env,
+                                     tcg_constant_i32(desc), cpu_reg(s, rt));
         } else {
             tcg_rt = clean_data_tbi(s, cpu_reg(s, rt));
         }
@@ -1935,10 +1928,7 @@ static void handle_sys(DisasContext *s, uint32_t insn, bool isread,
         if (ri->type & ARM_CP_CONST) {
             tcg_gen_movi_i64(tcg_rt, ri->resetvalue);
         } else if (ri->readfn) {
-            TCGv_ptr tmpptr;
-            tmpptr = tcg_const_ptr(ri);
-            gen_helper_get_cp_reg64(tcg_rt, cpu_env, tmpptr);
-            tcg_temp_free_ptr(tmpptr);
+            gen_helper_get_cp_reg64(tcg_rt, cpu_env, tcg_constant_ptr(ri));
         } else {
             tcg_gen_ld_i64(tcg_rt, cpu_env, ri->fieldoffset);
         }
@@ -1947,10 +1937,7 @@ static void handle_sys(DisasContext *s, uint32_t insn, bool isread,
             /* If not forbidden by access permissions, treat as WI */
             return;
         } else if (ri->writefn) {
-            TCGv_ptr tmpptr;
-            tmpptr = tcg_const_ptr(ri);
-            gen_helper_set_cp_reg64(cpu_env, tmpptr, tcg_rt);
-            tcg_temp_free_ptr(tmpptr);
+            gen_helper_set_cp_reg64(cpu_env, tcg_constant_ptr(ri), tcg_rt);
         } else {
             tcg_gen_st_i64(tcg_rt, cpu_env, ri->fieldoffset);
         }
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 07/47] target/arm: Use tcg_constant in disas_exc
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (5 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 06/47] target/arm: Use tcg_constant in handle_sys Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28  9:41   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 08/47] target/arm: Use tcg_constant in gen_compare_and_swap_pair Richard Henderson
                   ` (40 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-a64.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index 5d1bccaf46..68e3b5c1f8 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -2015,7 +2015,6 @@ static void disas_exc(DisasContext *s, uint32_t insn)
     int opc = extract32(insn, 21, 3);
     int op2_ll = extract32(insn, 0, 5);
     int imm16 = extract32(insn, 5, 16);
-    TCGv_i32 tmp;
 
     switch (opc) {
     case 0:
@@ -2050,9 +2049,7 @@ static void disas_exc(DisasContext *s, uint32_t insn)
                 break;
             }
             gen_a64_set_pc_im(s->pc_curr);
-            tmp = tcg_const_i32(syn_aa64_smc(imm16));
-            gen_helper_pre_smc(cpu_env, tmp);
-            tcg_temp_free_i32(tmp);
+            gen_helper_pre_smc(cpu_env, tcg_constant_i32(syn_aa64_smc(imm16)));
             gen_ss_advance(s);
             gen_exception_insn(s, s->base.pc_next, EXCP_SMC,
                                syn_aa64_smc(imm16), 3);
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 08/47] target/arm: Use tcg_constant in gen_compare_and_swap_pair
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (6 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 07/47] target/arm: Use tcg_constant in disas_exc Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28  9:43   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 09/47] target/arm: Use tcg_constant in disas_ld_lit Richard Henderson
                   ` (39 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-a64.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index 68e3b5c1f8..af6844b4b6 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -2523,7 +2523,7 @@ static void gen_compare_and_swap_pair(DisasContext *s, int rs, int rt,
         tcg_temp_free_i64(cmp);
     } else if (tb_cflags(s->base.tb) & CF_PARALLEL) {
         if (HAVE_CMPXCHG128) {
-            TCGv_i32 tcg_rs = tcg_const_i32(rs);
+            TCGv_i32 tcg_rs = tcg_constant_i32(rs);
             if (s->be_data == MO_LE) {
                 gen_helper_casp_le_parallel(cpu_env, tcg_rs,
                                             clean_addr, t1, t2);
@@ -2531,7 +2531,6 @@ static void gen_compare_and_swap_pair(DisasContext *s, int rs, int rt,
                 gen_helper_casp_be_parallel(cpu_env, tcg_rs,
                                             clean_addr, t1, t2);
             }
-            tcg_temp_free_i32(tcg_rs);
         } else {
             gen_helper_exit_atomic(cpu_env);
             s->base.is_jmp = DISAS_NORETURN;
@@ -2542,7 +2541,7 @@ static void gen_compare_and_swap_pair(DisasContext *s, int rs, int rt,
         TCGv_i64 a2 = tcg_temp_new_i64();
         TCGv_i64 c1 = tcg_temp_new_i64();
         TCGv_i64 c2 = tcg_temp_new_i64();
-        TCGv_i64 zero = tcg_const_i64(0);
+        TCGv_i64 zero = tcg_constant_i64(0);
 
         /* Load the two words, in memory order.  */
         tcg_gen_qemu_ld_i64(d1, clean_addr, memidx,
@@ -2563,7 +2562,6 @@ static void gen_compare_and_swap_pair(DisasContext *s, int rs, int rt,
         tcg_temp_free_i64(a2);
         tcg_temp_free_i64(c1);
         tcg_temp_free_i64(c2);
-        tcg_temp_free_i64(zero);
 
         /* Write back the data from memory to Rs.  */
         tcg_gen_mov_i64(s1, d1);
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 09/47] target/arm: Use tcg_constant in disas_ld_lit
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (7 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 08/47] target/arm: Use tcg_constant in gen_compare_and_swap_pair Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28  9:45   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 10/47] target/arm: Use tcg_constant in disas_ldst_* Richard Henderson
                   ` (38 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-a64.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index af6844b4b6..1caca38a79 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -2778,7 +2778,7 @@ static void disas_ld_lit(DisasContext *s, uint32_t insn)
 
     tcg_rt = cpu_reg(s, rt);
 
-    clean_addr = tcg_const_i64(s->pc_curr + imm);
+    clean_addr = tcg_constant_i64(s->pc_curr + imm);
     if (is_vector) {
         do_fp_ld(s, rt, clean_addr, size);
     } else {
@@ -2788,7 +2788,6 @@ static void disas_ld_lit(DisasContext *s, uint32_t insn)
         do_gpr_ld(s, tcg_rt, clean_addr, size + is_signed * MO_SIGN,
                   false, true, rt, iss_sf, false);
     }
-    tcg_temp_free_i64(clean_addr);
 }
 
 /*
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 10/47] target/arm: Use tcg_constant in disas_ldst_*
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (8 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 09/47] target/arm: Use tcg_constant in disas_ld_lit Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28  9:45   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 11/47] target/arm: Use tcg_constant in disas_add_sum_imm* Richard Henderson
                   ` (37 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-a64.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index 1caca38a79..4cdc869d52 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -3693,7 +3693,7 @@ static void disas_ldst_multiple_struct(DisasContext *s, uint32_t insn)
     mop = endian | size | align;
 
     elements = (is_q ? 16 : 8) >> size;
-    tcg_ebytes = tcg_const_i64(1 << size);
+    tcg_ebytes = tcg_constant_i64(1 << size);
     for (r = 0; r < rpt; r++) {
         int e;
         for (e = 0; e < elements; e++) {
@@ -3709,7 +3709,6 @@ static void disas_ldst_multiple_struct(DisasContext *s, uint32_t insn)
             }
         }
     }
-    tcg_temp_free_i64(tcg_ebytes);
 
     if (!is_store) {
         /* For non-quad operations, setting a slice of the low
@@ -3839,7 +3838,7 @@ static void disas_ldst_single_struct(DisasContext *s, uint32_t insn)
                                 total);
     mop = finalize_memop(s, scale);
 
-    tcg_ebytes = tcg_const_i64(1 << scale);
+    tcg_ebytes = tcg_constant_i64(1 << scale);
     for (xs = 0; xs < selem; xs++) {
         if (replicate) {
             /* Load and replicate to all elements */
@@ -3861,7 +3860,6 @@ static void disas_ldst_single_struct(DisasContext *s, uint32_t insn)
         tcg_gen_add_i64(clean_addr, clean_addr, tcg_ebytes);
         rt = (rt + 1) % 32;
     }
-    tcg_temp_free_i64(tcg_ebytes);
 
     if (is_postidx) {
         if (rm == 31) {
@@ -4052,7 +4050,7 @@ static void disas_ldst_tag(DisasContext *s, uint32_t insn)
 
     if (is_zero) {
         TCGv_i64 clean_addr = clean_data_tbi(s, addr);
-        TCGv_i64 tcg_zero = tcg_const_i64(0);
+        TCGv_i64 tcg_zero = tcg_constant_i64(0);
         int mem_index = get_mem_index(s);
         int i, n = (1 + is_pair) << LOG2_TAG_GRANULE;
 
@@ -4062,7 +4060,6 @@ static void disas_ldst_tag(DisasContext *s, uint32_t insn)
             tcg_gen_addi_i64(clean_addr, clean_addr, 8);
             tcg_gen_qemu_st_i64(tcg_zero, clean_addr, mem_index, MO_UQ);
         }
-        tcg_temp_free_i64(tcg_zero);
     }
 
     if (index != 0) {
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 11/47] target/arm: Use tcg_constant in disas_add_sum_imm*
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (9 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 10/47] target/arm: Use tcg_constant in disas_ldst_* Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28  9:59   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 12/47] target/arm: Use tcg_constant in disas_movw_imm Richard Henderson
                   ` (36 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-a64.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index 4cdc869d52..6c88772eb3 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -4178,13 +4178,12 @@ static void disas_add_sub_imm(DisasContext *s, uint32_t insn)
             tcg_gen_addi_i64(tcg_result, tcg_rn, imm);
         }
     } else {
-        TCGv_i64 tcg_imm = tcg_const_i64(imm);
+        TCGv_i64 tcg_imm = tcg_constant_i64(imm);
         if (sub_op) {
             gen_sub_CC(is_64bit, tcg_result, tcg_rn, tcg_imm);
         } else {
             gen_add_CC(is_64bit, tcg_result, tcg_rn, tcg_imm);
         }
-        tcg_temp_free_i64(tcg_imm);
     }
 
     if (is_64bit) {
@@ -4232,12 +4231,9 @@ static void disas_add_sub_imm_with_tags(DisasContext *s, uint32_t insn)
     tcg_rd = cpu_reg_sp(s, rd);
 
     if (s->ata) {
-        TCGv_i32 offset = tcg_const_i32(imm);
-        TCGv_i32 tag_offset = tcg_const_i32(uimm4);
-
-        gen_helper_addsubg(tcg_rd, cpu_env, tcg_rn, offset, tag_offset);
-        tcg_temp_free_i32(tag_offset);
-        tcg_temp_free_i32(offset);
+        gen_helper_addsubg(tcg_rd, cpu_env, tcg_rn,
+                           tcg_constant_i32(imm),
+                           tcg_constant_i32(uimm4));
     } else {
         tcg_gen_addi_i64(tcg_rd, tcg_rn, imm);
         gen_address_with_allocation_tag0(tcg_rd, tcg_rd);
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 12/47] target/arm: Use tcg_constant in disas_movw_imm
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (10 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 11/47] target/arm: Use tcg_constant in disas_add_sum_imm* Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28  9:59   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 13/47] target/arm: Use tcg_constant in shift_reg_imm Richard Henderson
                   ` (35 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-a64.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index 6c88772eb3..537eebbf1d 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -4419,7 +4419,6 @@ static void disas_movw_imm(DisasContext *s, uint32_t insn)
     int opc = extract32(insn, 29, 2);
     int pos = extract32(insn, 21, 2) << 4;
     TCGv_i64 tcg_rd = cpu_reg(s, rd);
-    TCGv_i64 tcg_imm;
 
     if (!sf && (pos >= 32)) {
         unallocated_encoding(s);
@@ -4439,9 +4438,7 @@ static void disas_movw_imm(DisasContext *s, uint32_t insn)
         tcg_gen_movi_i64(tcg_rd, imm);
         break;
     case 3: /* MOVK */
-        tcg_imm = tcg_const_i64(imm);
-        tcg_gen_deposit_i64(tcg_rd, tcg_rd, tcg_imm, pos, 16);
-        tcg_temp_free_i64(tcg_imm);
+        tcg_gen_deposit_i64(tcg_rd, tcg_rd, tcg_constant_i64(imm), pos, 16);
         if (!sf) {
             tcg_gen_ext32u_i64(tcg_rd, tcg_rd);
         }
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 13/47] target/arm: Use tcg_constant in shift_reg_imm
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (11 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 12/47] target/arm: Use tcg_constant in disas_movw_imm Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28  9:59   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 14/47] target/arm: Use tcg_constant in disas_cond_select Richard Henderson
                   ` (34 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-a64.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index 537eebbf1d..3de2b27cc7 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -4678,11 +4678,7 @@ static void shift_reg_imm(TCGv_i64 dst, TCGv_i64 src, int sf,
     if (shift_i == 0) {
         tcg_gen_mov_i64(dst, src);
     } else {
-        TCGv_i64 shift_const;
-
-        shift_const = tcg_const_i64(shift_i);
-        shift_reg(dst, src, sf, shift_type, shift_const);
-        tcg_temp_free_i64(shift_const);
+        shift_reg(dst, src, sf, shift_type, tcg_constant_i64(shift_i));
     }
 }
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 14/47] target/arm: Use tcg_constant in disas_cond_select
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (12 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 13/47] target/arm: Use tcg_constant in shift_reg_imm Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28 10:00   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 15/47] target/arm: Use tcg_constant in handle_{rev16,crc32} Richard Henderson
                   ` (33 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-a64.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index 3de2b27cc7..9b678cc5af 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -5255,7 +5255,7 @@ static void disas_cond_select(DisasContext *s, uint32_t insn)
     tcg_rd = cpu_reg(s, rd);
 
     a64_test_cc(&c, cond);
-    zero = tcg_const_i64(0);
+    zero = tcg_constant_i64(0);
 
     if (rn == 31 && rm == 31 && (else_inc ^ else_inv)) {
         /* CSET & CSETM.  */
@@ -5276,7 +5276,6 @@ static void disas_cond_select(DisasContext *s, uint32_t insn)
         tcg_gen_movcond_i64(c.cond, tcg_rd, c.value, zero, t_true, t_false);
     }
 
-    tcg_temp_free_i64(zero);
     a64_free_cc(&c);
 
     if (!sf) {
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 15/47] target/arm: Use tcg_constant in handle_{rev16,crc32}
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (13 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 14/47] target/arm: Use tcg_constant in disas_cond_select Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28 10:00   ` [PATCH 15/47] target/arm: Use tcg_constant in handle_{rev16, crc32} Peter Maydell
  2022-04-26 16:30 ` [PATCH 16/47] target/arm: Use tcg_constant in disas_data_proc_2src Richard Henderson
                   ` (32 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-a64.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index 9b678cc5af..ff08306d2b 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -5372,7 +5372,7 @@ static void handle_rev16(DisasContext *s, unsigned int sf,
     TCGv_i64 tcg_rd = cpu_reg(s, rd);
     TCGv_i64 tcg_tmp = tcg_temp_new_i64();
     TCGv_i64 tcg_rn = read_cpu_reg(s, rn, sf);
-    TCGv_i64 mask = tcg_const_i64(sf ? 0x00ff00ff00ff00ffull : 0x00ff00ff);
+    TCGv_i64 mask = tcg_constant_i64(sf ? 0x00ff00ff00ff00ffull : 0x00ff00ff);
 
     tcg_gen_shri_i64(tcg_tmp, tcg_rn, 8);
     tcg_gen_and_i64(tcg_rd, tcg_rn, mask);
@@ -5380,7 +5380,6 @@ static void handle_rev16(DisasContext *s, unsigned int sf,
     tcg_gen_shli_i64(tcg_rd, tcg_rd, 8);
     tcg_gen_or_i64(tcg_rd, tcg_rd, tcg_tmp);
 
-    tcg_temp_free_i64(mask);
     tcg_temp_free_i64(tcg_tmp);
 }
 
@@ -5663,15 +5662,13 @@ static void handle_crc32(DisasContext *s,
     }
 
     tcg_acc = cpu_reg(s, rn);
-    tcg_bytes = tcg_const_i32(1 << sz);
+    tcg_bytes = tcg_constant_i32(1 << sz);
 
     if (crc32c) {
         gen_helper_crc32c_64(cpu_reg(s, rd), tcg_acc, tcg_val, tcg_bytes);
     } else {
         gen_helper_crc32_64(cpu_reg(s, rd), tcg_acc, tcg_val, tcg_bytes);
     }
-
-    tcg_temp_free_i32(tcg_bytes);
 }
 
 /* Data-processing (2 source)
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 16/47] target/arm: Use tcg_constant in disas_data_proc_2src
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (14 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 15/47] target/arm: Use tcg_constant in handle_{rev16,crc32} Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28 10:01   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 17/47] target/arm: Use tcg_constant in disas_fp* Richard Henderson
                   ` (31 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Existing temp usage treats t1 as both zero and as a
temporary.  Rearrange to only require one temporary,
so remove t1 and rename t2.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-a64.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index ff08306d2b..358f42026c 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -5734,15 +5734,13 @@ static void disas_data_proc_2src(DisasContext *s, uint32_t insn)
         if (sf == 0 || !dc_isar_feature(aa64_mte_insn_reg, s)) {
             goto do_unallocated;
         } else {
-            TCGv_i64 t1 = tcg_const_i64(1);
-            TCGv_i64 t2 = tcg_temp_new_i64();
+            TCGv_i64 t = tcg_temp_new_i64();
 
-            tcg_gen_extract_i64(t2, cpu_reg_sp(s, rn), 56, 4);
-            tcg_gen_shl_i64(t1, t1, t2);
-            tcg_gen_or_i64(cpu_reg(s, rd), cpu_reg(s, rm), t1);
+            tcg_gen_extract_i64(t, cpu_reg_sp(s, rn), 56, 4);
+            tcg_gen_shl_i64(t, tcg_constant_i64(1), t);
+            tcg_gen_or_i64(cpu_reg(s, rd), cpu_reg(s, rm), t);
 
-            tcg_temp_free_i64(t1);
-            tcg_temp_free_i64(t2);
+            tcg_temp_free_i64(t);
         }
         break;
     case 8: /* LSLV */
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 17/47] target/arm: Use tcg_constant in disas_fp*
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (15 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 16/47] target/arm: Use tcg_constant in disas_data_proc_2src Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28 10:06   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 18/47] target/arm: Use tcg_constant in simd shift expanders Richard Henderson
                   ` (30 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-a64.c | 24 +++++++-----------------
 1 file changed, 7 insertions(+), 17 deletions(-)

diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index 358f42026c..847da725ea 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -5875,7 +5875,7 @@ static void handle_fp_compare(DisasContext *s, int size,
 
         tcg_vn = read_fp_dreg(s, rn);
         if (cmp_with_zero) {
-            tcg_vm = tcg_const_i64(0);
+            tcg_vm = tcg_constant_i64(0);
         } else {
             tcg_vm = read_fp_dreg(s, rm);
         }
@@ -5985,7 +5985,6 @@ static void disas_fp_compare(DisasContext *s, uint32_t insn)
 static void disas_fp_ccomp(DisasContext *s, uint32_t insn)
 {
     unsigned int mos, type, rm, cond, rn, op, nzcv;
-    TCGv_i64 tcg_flags;
     TCGLabel *label_continue = NULL;
     int size;
 
@@ -6029,9 +6028,7 @@ static void disas_fp_ccomp(DisasContext *s, uint32_t insn)
         label_continue = gen_new_label();
         arm_gen_test_cc(cond, label_match);
         /* nomatch: */
-        tcg_flags = tcg_const_i64(nzcv << 28);
-        gen_set_nzcv(tcg_flags);
-        tcg_temp_free_i64(tcg_flags);
+        gen_set_nzcv(tcg_constant_i64(nzcv << 28));
         tcg_gen_br(label_continue);
         gen_set_label(label_match);
     }
@@ -6052,7 +6049,7 @@ static void disas_fp_ccomp(DisasContext *s, uint32_t insn)
 static void disas_fp_csel(DisasContext *s, uint32_t insn)
 {
     unsigned int mos, type, rm, cond, rn, rd;
-    TCGv_i64 t_true, t_false, t_zero;
+    TCGv_i64 t_true, t_false;
     DisasCompare64 c;
     MemOp sz;
 
@@ -6097,10 +6094,8 @@ static void disas_fp_csel(DisasContext *s, uint32_t insn)
     read_vec_element(s, t_false, rm, 0, sz);
 
     a64_test_cc(&c, cond);
-    t_zero = tcg_const_i64(0);
-    tcg_gen_movcond_i64(c.cond, t_true, c.value, t_zero, t_true, t_false);
-    tcg_temp_free_i64(t_zero);
-    tcg_temp_free_i64(t_false);
+    tcg_gen_movcond_i64(c.cond, t_true, c.value, tcg_constant_i64(0),
+                        t_true, t_false);
     a64_free_cc(&c);
 
     /* Note that sregs & hregs write back zeros to the high bits,
@@ -6881,7 +6876,6 @@ static void disas_fp_imm(DisasContext *s, uint32_t insn)
     int type = extract32(insn, 22, 2);
     int mos = extract32(insn, 29, 3);
     uint64_t imm;
-    TCGv_i64 tcg_res;
     MemOp sz;
 
     if (mos || imm5) {
@@ -6912,10 +6906,7 @@ static void disas_fp_imm(DisasContext *s, uint32_t insn)
     }
 
     imm = vfp_expand_imm(sz, imm8);
-
-    tcg_res = tcg_const_i64(imm);
-    write_fp_dreg(s, rd, tcg_res);
-    tcg_temp_free_i64(tcg_res);
+    write_fp_dreg(s, rd, tcg_constant_i64(imm));
 }
 
 /* Handle floating point <=> fixed point conversions. Note that we can
@@ -6933,7 +6924,7 @@ static void handle_fpfpcvt(DisasContext *s, int rd, int rn, int opcode,
 
     tcg_fpstatus = fpstatus_ptr(type == 3 ? FPST_FPCR_F16 : FPST_FPCR);
 
-    tcg_shift = tcg_const_i32(64 - scale);
+    tcg_shift = tcg_constant_i32(64 - scale);
 
     if (itof) {
         TCGv_i64 tcg_int = cpu_reg(s, rn);
@@ -7092,7 +7083,6 @@ static void handle_fpfpcvt(DisasContext *s, int rd, int rn, int opcode,
     }
 
     tcg_temp_free_ptr(tcg_fpstatus);
-    tcg_temp_free_i32(tcg_shift);
 }
 
 /* Floating point <-> fixed point conversions
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 18/47] target/arm: Use tcg_constant in simd shift expanders
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (16 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 17/47] target/arm: Use tcg_constant in disas_fp* Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28 10:09   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 19/47] target/arm: Use tcg_constant in simd fp/int conversion Richard Henderson
                   ` (29 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-a64.c | 21 +++++----------------
 1 file changed, 5 insertions(+), 16 deletions(-)

diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index 847da725ea..45abac6892 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -8353,7 +8353,7 @@ static void handle_shri_with_rndacc(TCGv_i64 tcg_res, TCGv_i64 tcg_src,
     /* Deal with the rounding step */
     if (round) {
         if (extended_result) {
-            TCGv_i64 tcg_zero = tcg_const_i64(0);
+            TCGv_i64 tcg_zero = tcg_constant_i64(0);
             if (!is_u) {
                 /* take care of sign extending tcg_res */
                 tcg_gen_sari_i64(tcg_src_hi, tcg_src, 63);
@@ -8365,7 +8365,6 @@ static void handle_shri_with_rndacc(TCGv_i64 tcg_res, TCGv_i64 tcg_src,
                                  tcg_src, tcg_zero,
                                  tcg_rnd, tcg_zero);
             }
-            tcg_temp_free_i64(tcg_zero);
         } else {
             tcg_gen_add_i64(tcg_src, tcg_src, tcg_rnd);
         }
@@ -8451,8 +8450,7 @@ static void handle_scalar_simd_shri(DisasContext *s,
     }
 
     if (round) {
-        uint64_t round_const = 1ULL << (shift - 1);
-        tcg_round = tcg_const_i64(round_const);
+        tcg_round = tcg_constant_i64(1ULL << (shift - 1));
     } else {
         tcg_round = NULL;
     }
@@ -8478,9 +8476,6 @@ static void handle_scalar_simd_shri(DisasContext *s,
 
     tcg_temp_free_i64(tcg_rn);
     tcg_temp_free_i64(tcg_rd);
-    if (round) {
-        tcg_temp_free_i64(tcg_round);
-    }
 }
 
 /* SHL/SLI - Scalar shift left */
@@ -8578,8 +8573,7 @@ static void handle_vec_simd_sqshrn(DisasContext *s, bool is_scalar, bool is_q,
     tcg_final = tcg_const_i64(0);
 
     if (round) {
-        uint64_t round_const = 1ULL << (shift - 1);
-        tcg_round = tcg_const_i64(round_const);
+        tcg_round = tcg_constant_i64(1ULL << (shift - 1));
     } else {
         tcg_round = NULL;
     }
@@ -8599,9 +8593,6 @@ static void handle_vec_simd_sqshrn(DisasContext *s, bool is_scalar, bool is_q,
         write_vec_element(s, tcg_final, rd, 1, MO_64);
     }
 
-    if (round) {
-        tcg_temp_free_i64(tcg_round);
-    }
     tcg_temp_free_i64(tcg_rn);
     tcg_temp_free_i64(tcg_rd);
     tcg_temp_free_i32(tcg_rd_narrowed);
@@ -8653,7 +8644,7 @@ static void handle_simd_qshl(DisasContext *s, bool scalar, bool is_q,
     }
 
     if (size == 3) {
-        TCGv_i64 tcg_shift = tcg_const_i64(shift);
+        TCGv_i64 tcg_shift = tcg_constant_i64(shift);
         static NeonGenTwo64OpEnvFn * const fns[2][2] = {
             { gen_helper_neon_qshl_s64, gen_helper_neon_qshlu_s64 },
             { NULL, gen_helper_neon_qshl_u64 },
@@ -8670,10 +8661,9 @@ static void handle_simd_qshl(DisasContext *s, bool scalar, bool is_q,
 
             tcg_temp_free_i64(tcg_op);
         }
-        tcg_temp_free_i64(tcg_shift);
         clear_vec_high(s, is_q, rd);
     } else {
-        TCGv_i32 tcg_shift = tcg_const_i32(shift);
+        TCGv_i32 tcg_shift = tcg_constant_i32(shift);
         static NeonGenTwoOpEnvFn * const fns[2][2][3] = {
             {
                 { gen_helper_neon_qshl_s8,
@@ -8718,7 +8708,6 @@ static void handle_simd_qshl(DisasContext *s, bool scalar, bool is_q,
 
             tcg_temp_free_i32(tcg_op);
         }
-        tcg_temp_free_i32(tcg_shift);
 
         if (!scalar) {
             clear_vec_high(s, is_q, rd);
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 19/47] target/arm: Use tcg_constant in simd fp/int conversion
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (17 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 18/47] target/arm: Use tcg_constant in simd shift expanders Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28 10:10   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 20/47] target/arm: Use tcg_constant in 2misc expanders Richard Henderson
                   ` (28 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-a64.c | 26 ++++++--------------------
 1 file changed, 6 insertions(+), 20 deletions(-)

diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index 45abac6892..36c714a5ed 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -8727,7 +8727,7 @@ static void handle_simd_intfp_conv(DisasContext *s, int rd, int rn,
     int pass;
 
     if (fracbits || size == MO_64) {
-        tcg_shift = tcg_const_i32(fracbits);
+        tcg_shift = tcg_constant_i32(fracbits);
     }
 
     if (size == MO_64) {
@@ -8812,9 +8812,6 @@ static void handle_simd_intfp_conv(DisasContext *s, int rd, int rn,
     }
 
     tcg_temp_free_ptr(tcg_fpst);
-    if (tcg_shift) {
-        tcg_temp_free_i32(tcg_shift);
-    }
 
     clear_vec_high(s, elements << size == 16, rd);
 }
@@ -8904,7 +8901,7 @@ static void handle_simd_shift_fpint_conv(DisasContext *s, bool is_scalar,
     tcg_fpstatus = fpstatus_ptr(size == MO_16 ? FPST_FPCR_F16 : FPST_FPCR);
     gen_helper_set_rmode(tcg_rmode, tcg_rmode, tcg_fpstatus);
     fracbits = (16 << size) - immhb;
-    tcg_shift = tcg_const_i32(fracbits);
+    tcg_shift = tcg_constant_i32(fracbits);
 
     if (size == MO_64) {
         int maxpass = is_scalar ? 1 : 2;
@@ -8962,7 +8959,6 @@ static void handle_simd_shift_fpint_conv(DisasContext *s, bool is_scalar,
         }
     }
 
-    tcg_temp_free_i32(tcg_shift);
     gen_helper_set_rmode(tcg_rmode, tcg_rmode, tcg_fpstatus);
     tcg_temp_free_ptr(tcg_fpstatus);
     tcg_temp_free_i32(tcg_rmode);
@@ -9834,23 +9830,15 @@ static void handle_2misc_64(DisasContext *s, int opcode, bool u,
     case 0x1c: /* FCVTAS */
     case 0x3a: /* FCVTPS */
     case 0x3b: /* FCVTZS */
-    {
-        TCGv_i32 tcg_shift = tcg_const_i32(0);
-        gen_helper_vfp_tosqd(tcg_rd, tcg_rn, tcg_shift, tcg_fpstatus);
-        tcg_temp_free_i32(tcg_shift);
+        gen_helper_vfp_tosqd(tcg_rd, tcg_rn, tcg_constant_i32(0), tcg_fpstatus);
         break;
-    }
     case 0x5a: /* FCVTNU */
     case 0x5b: /* FCVTMU */
     case 0x5c: /* FCVTAU */
     case 0x7a: /* FCVTPU */
     case 0x7b: /* FCVTZU */
-    {
-        TCGv_i32 tcg_shift = tcg_const_i32(0);
-        gen_helper_vfp_touqd(tcg_rd, tcg_rn, tcg_shift, tcg_fpstatus);
-        tcg_temp_free_i32(tcg_shift);
+        gen_helper_vfp_touqd(tcg_rd, tcg_rn, tcg_constant_i32(0), tcg_fpstatus);
         break;
-    }
     case 0x18: /* FRINTN */
     case 0x19: /* FRINTM */
     case 0x38: /* FRINTP */
@@ -9890,7 +9878,7 @@ static void handle_2misc_fcmp_zero(DisasContext *s, int opcode,
 
     if (is_double) {
         TCGv_i64 tcg_op = tcg_temp_new_i64();
-        TCGv_i64 tcg_zero = tcg_const_i64(0);
+        TCGv_i64 tcg_zero = tcg_constant_i64(0);
         TCGv_i64 tcg_res = tcg_temp_new_i64();
         NeonGenTwoDoubleOpFn *genfn;
         bool swap = false;
@@ -9926,13 +9914,12 @@ static void handle_2misc_fcmp_zero(DisasContext *s, int opcode,
             write_vec_element(s, tcg_res, rd, pass, MO_64);
         }
         tcg_temp_free_i64(tcg_res);
-        tcg_temp_free_i64(tcg_zero);
         tcg_temp_free_i64(tcg_op);
 
         clear_vec_high(s, !is_scalar, rd);
     } else {
         TCGv_i32 tcg_op = tcg_temp_new_i32();
-        TCGv_i32 tcg_zero = tcg_const_i32(0);
+        TCGv_i32 tcg_zero = tcg_constant_i32(0);
         TCGv_i32 tcg_res = tcg_temp_new_i32();
         NeonGenTwoSingleOpFn *genfn;
         bool swap = false;
@@ -10001,7 +9988,6 @@ static void handle_2misc_fcmp_zero(DisasContext *s, int opcode,
             }
         }
         tcg_temp_free_i32(tcg_res);
-        tcg_temp_free_i32(tcg_zero);
         tcg_temp_free_i32(tcg_op);
         if (!is_scalar) {
             clear_vec_high(s, is_q, rd);
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 20/47] target/arm: Use tcg_constant in 2misc expanders
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (18 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 19/47] target/arm: Use tcg_constant in simd fp/int conversion Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28 10:11   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 21/47] target/arm: Use tcg_constant in balance of translate-a64.c Richard Henderson
                   ` (27 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-a64.c | 40 ++++++++++----------------------------
 1 file changed, 10 insertions(+), 30 deletions(-)

diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index 36c714a5ed..35dc21da8f 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -10088,7 +10088,7 @@ static void handle_2misc_narrow(DisasContext *s, bool scalar,
     int passes = scalar ? 1 : 2;
 
     if (scalar) {
-        tcg_res[1] = tcg_const_i32(0);
+        tcg_res[1] = tcg_constant_i32(0);
     }
 
     for (pass = 0; pass < passes; pass++) {
@@ -10266,9 +10266,7 @@ static void handle_2misc_satacc(DisasContext *s, bool is_scalar, bool is_u,
             }
 
             if (is_scalar) {
-                TCGv_i64 tcg_zero = tcg_const_i64(0);
-                write_vec_element(s, tcg_zero, rd, 0, MO_64);
-                tcg_temp_free_i64(tcg_zero);
+                write_vec_element(s, tcg_constant_i64(0), rd, 0, MO_64);
             }
             write_vec_element_i32(s, tcg_rd, rd, pass, MO_32);
         }
@@ -10451,23 +10449,17 @@ static void disas_simd_scalar_two_reg_misc(DisasContext *s, uint32_t insn)
         case 0x1c: /* FCVTAS */
         case 0x3a: /* FCVTPS */
         case 0x3b: /* FCVTZS */
-        {
-            TCGv_i32 tcg_shift = tcg_const_i32(0);
-            gen_helper_vfp_tosls(tcg_rd, tcg_rn, tcg_shift, tcg_fpstatus);
-            tcg_temp_free_i32(tcg_shift);
+            gen_helper_vfp_tosls(tcg_rd, tcg_rn, tcg_constant_i32(0),
+                                 tcg_fpstatus);
             break;
-        }
         case 0x5a: /* FCVTNU */
         case 0x5b: /* FCVTMU */
         case 0x5c: /* FCVTAU */
         case 0x7a: /* FCVTPU */
         case 0x7b: /* FCVTZU */
-        {
-            TCGv_i32 tcg_shift = tcg_const_i32(0);
-            gen_helper_vfp_touls(tcg_rd, tcg_rn, tcg_shift, tcg_fpstatus);
-            tcg_temp_free_i32(tcg_shift);
+            gen_helper_vfp_touls(tcg_rd, tcg_rn, tcg_constant_i32(0),
+                                 tcg_fpstatus);
             break;
-        }
         default:
             g_assert_not_reached();
         }
@@ -10639,8 +10631,7 @@ static void handle_vec_simd_shrn(DisasContext *s, bool is_q,
     read_vec_element(s, tcg_final, rd, is_q ? 1 : 0, MO_64);
 
     if (round) {
-        uint64_t round_const = 1ULL << (shift - 1);
-        tcg_round = tcg_const_i64(round_const);
+        tcg_round = tcg_constant_i64(1ULL << (shift - 1));
     } else {
         tcg_round = NULL;
     }
@@ -10658,9 +10649,6 @@ static void handle_vec_simd_shrn(DisasContext *s, bool is_q,
     } else {
         write_vec_element(s, tcg_final, rd, 1, MO_64);
     }
-    if (round) {
-        tcg_temp_free_i64(tcg_round);
-    }
     tcg_temp_free_i64(tcg_rn);
     tcg_temp_free_i64(tcg_rd);
     tcg_temp_free_i64(tcg_final);
@@ -12364,7 +12352,7 @@ static void handle_2misc_pairwise(DisasContext *s, int opcode, bool u,
         }
     }
     if (!is_q) {
-        tcg_res[1] = tcg_const_i64(0);
+        tcg_res[1] = tcg_constant_i64(0);
     }
     for (pass = 0; pass < 2; pass++) {
         write_vec_element(s, tcg_res[pass], rd, pass, MO_64);
@@ -12797,25 +12785,17 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn)
                 case 0x1c: /* FCVTAS */
                 case 0x3a: /* FCVTPS */
                 case 0x3b: /* FCVTZS */
-                {
-                    TCGv_i32 tcg_shift = tcg_const_i32(0);
                     gen_helper_vfp_tosls(tcg_res, tcg_op,
-                                         tcg_shift, tcg_fpstatus);
-                    tcg_temp_free_i32(tcg_shift);
+                                         tcg_constant_i32(0), tcg_fpstatus);
                     break;
-                }
                 case 0x5a: /* FCVTNU */
                 case 0x5b: /* FCVTMU */
                 case 0x5c: /* FCVTAU */
                 case 0x7a: /* FCVTPU */
                 case 0x7b: /* FCVTZU */
-                {
-                    TCGv_i32 tcg_shift = tcg_const_i32(0);
                     gen_helper_vfp_touls(tcg_res, tcg_op,
-                                         tcg_shift, tcg_fpstatus);
-                    tcg_temp_free_i32(tcg_shift);
+                                         tcg_constant_i32(0), tcg_fpstatus);
                     break;
-                }
                 case 0x18: /* FRINTN */
                 case 0x19: /* FRINTM */
                 case 0x38: /* FRINTP */
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 21/47] target/arm: Use tcg_constant in balance of translate-a64.c
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (19 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 20/47] target/arm: Use tcg_constant in 2misc expanders Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28 10:12   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 22/47] target/arm: Use tcg_constant for aa32 exceptions Richard Henderson
                   ` (26 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Finish conversion of the file to tcg_constant_*.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-a64.c | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index 35dc21da8f..1163ba12a4 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -13893,7 +13893,7 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn)
         }
 
         if (is_scalar) {
-            tcg_res[1] = tcg_const_i64(0);
+            tcg_res[1] = tcg_constant_i64(0);
         }
 
         for (pass = 0; pass < 2; pass++) {
@@ -14297,7 +14297,7 @@ static void disas_crypto_four_reg(DisasContext *s, uint32_t insn)
         tcg_op2 = tcg_temp_new_i32();
         tcg_op3 = tcg_temp_new_i32();
         tcg_res = tcg_temp_new_i32();
-        tcg_zero = tcg_const_i32(0);
+        tcg_zero = tcg_constant_i32(0);
 
         read_vec_element_i32(s, tcg_op1, rn, 3, MO_32);
         read_vec_element_i32(s, tcg_op2, rm, 3, MO_32);
@@ -14317,7 +14317,6 @@ static void disas_crypto_four_reg(DisasContext *s, uint32_t insn)
         tcg_temp_free_i32(tcg_op2);
         tcg_temp_free_i32(tcg_op3);
         tcg_temp_free_i32(tcg_res);
-        tcg_temp_free_i32(tcg_zero);
     }
 }
 
@@ -14825,22 +14824,19 @@ static void aarch64_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu)
             gen_helper_yield(cpu_env);
             break;
         case DISAS_WFI:
-        {
-            /* This is a special case because we don't want to just halt the CPU
-             * if trying to debug across a WFI.
+            /*
+             * This is a special case because we don't want to just halt
+             * the CPU if trying to debug across a WFI.
              */
-            TCGv_i32 tmp = tcg_const_i32(4);
-
             gen_a64_set_pc_im(dc->base.pc_next);
-            gen_helper_wfi(cpu_env, tmp);
-            tcg_temp_free_i32(tmp);
-            /* The helper doesn't necessarily throw an exception, but we
+            gen_helper_wfi(cpu_env, tcg_constant_i32(4));
+            /*
+             * The helper doesn't necessarily throw an exception, but we
              * must go back to the main loop to check for interrupts anyway.
              */
             tcg_gen_exit_tb(NULL, 0);
             break;
         }
-        }
     }
 }
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 22/47] target/arm: Use tcg_constant for aa32 exceptions
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (20 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 21/47] target/arm: Use tcg_constant in balance of translate-a64.c Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28 10:21   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 23/47] target/arm: Use tcg_constant for disas_iwmmxt_insn Richard Henderson
                   ` (25 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate.c | 32 +++++++-------------------------
 1 file changed, 7 insertions(+), 25 deletions(-)

diff --git a/target/arm/translate.c b/target/arm/translate.c
index d09692c125..9bd1b46a52 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -346,9 +346,7 @@ static void store_sp_checked(DisasContext *s, TCGv_i32 var)
 
 void gen_set_cpsr(TCGv_i32 var, uint32_t mask)
 {
-    TCGv_i32 tmp_mask = tcg_const_i32(mask);
-    gen_helper_cpsr_write(cpu_env, var, tmp_mask);
-    tcg_temp_free_i32(tmp_mask);
+    gen_helper_cpsr_write(cpu_env, var, tcg_constant_i32(mask));
 }
 
 static void gen_rebuild_hflags(DisasContext *s, bool new_el)
@@ -373,11 +371,8 @@ static void gen_rebuild_hflags(DisasContext *s, bool new_el)
 
 static void gen_exception_internal(int excp)
 {
-    TCGv_i32 tcg_excp = tcg_const_i32(excp);
-
     assert(excp_is_internal(excp));
-    gen_helper_exception_internal(cpu_env, tcg_excp);
-    tcg_temp_free_i32(tcg_excp);
+    gen_helper_exception_internal(cpu_env, tcg_constant_i32(excp));
 }
 
 static void gen_singlestep_exception(DisasContext *s)
@@ -1078,12 +1073,8 @@ static inline void gen_smc(DisasContext *s)
     /* As with HVC, we may take an exception either before or after
      * the insn executes.
      */
-    TCGv_i32 tmp;
-
     gen_set_pc_im(s, s->pc_curr);
-    tmp = tcg_const_i32(syn_aa32_smc());
-    gen_helper_pre_smc(cpu_env, tmp);
-    tcg_temp_free_i32(tmp);
+    gen_helper_pre_smc(cpu_env, tcg_constant_i32(syn_aa32_smc()));
     gen_set_pc_im(s, s->base.pc_next);
     s->base.is_jmp = DISAS_SMC;
 }
@@ -1111,13 +1102,9 @@ void gen_exception_insn(DisasContext *s, uint64_t pc, int excp,
 
 static void gen_exception_bkpt_insn(DisasContext *s, uint32_t syn)
 {
-    TCGv_i32 tcg_syn;
-
     gen_set_condexec(s);
     gen_set_pc_im(s, s->pc_curr);
-    tcg_syn = tcg_const_i32(syn);
-    gen_helper_exception_bkpt_insn(cpu_env, tcg_syn);
-    tcg_temp_free_i32(tcg_syn);
+    gen_helper_exception_bkpt_insn(cpu_env, tcg_constant_i32(syn));
     s->base.is_jmp = DISAS_NORETURN;
 }
 
@@ -1131,16 +1118,11 @@ void unallocated_encoding(DisasContext *s)
 static void gen_exception_el(DisasContext *s, int excp, uint32_t syn,
                              TCGv_i32 tcg_el)
 {
-    TCGv_i32 tcg_excp;
-    TCGv_i32 tcg_syn;
-
     gen_set_condexec(s);
     gen_set_pc_im(s, s->pc_curr);
-    tcg_excp = tcg_const_i32(excp);
-    tcg_syn = tcg_const_i32(syn);
-    gen_helper_exception_with_syndrome(cpu_env, tcg_excp, tcg_syn, tcg_el);
-    tcg_temp_free_i32(tcg_syn);
-    tcg_temp_free_i32(tcg_excp);
+    gen_helper_exception_with_syndrome(cpu_env,
+                                       tcg_constant_i32(excp),
+                                       tcg_constant_i32(syn), tcg_el);
     s->base.is_jmp = DISAS_NORETURN;
 }
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 23/47] target/arm: Use tcg_constant for disas_iwmmxt_insn
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (21 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 22/47] target/arm: Use tcg_constant for aa32 exceptions Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28 10:23   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 24/47] target/arm: Use tcg_constant for gen_{msr,mrs} Richard Henderson
                   ` (24 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate.c | 25 ++++++++++---------------
 1 file changed, 10 insertions(+), 15 deletions(-)

diff --git a/target/arm/translate.c b/target/arm/translate.c
index 9bd1b46a52..501192ed55 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -1845,24 +1845,21 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn)
         gen_op_iwmmxt_movq_M0_wRn(wrd);
         switch ((insn >> 6) & 3) {
         case 0:
-            tmp2 = tcg_const_i32(0xff);
-            tmp3 = tcg_const_i32((insn & 7) << 3);
+            tmp2 = tcg_constant_i32(0xff);
+            tmp3 = tcg_constant_i32((insn & 7) << 3);
             break;
         case 1:
-            tmp2 = tcg_const_i32(0xffff);
-            tmp3 = tcg_const_i32((insn & 3) << 4);
+            tmp2 = tcg_constant_i32(0xffff);
+            tmp3 = tcg_constant_i32((insn & 3) << 4);
             break;
         case 2:
-            tmp2 = tcg_const_i32(0xffffffff);
-            tmp3 = tcg_const_i32((insn & 1) << 5);
+            tmp2 = tcg_constant_i32(0xffffffff);
+            tmp3 = tcg_constant_i32((insn & 1) << 5);
             break;
         default:
-            tmp2 = NULL;
-            tmp3 = NULL;
+            g_assert_not_reached();
         }
         gen_helper_iwmmxt_insr(cpu_M0, cpu_M0, tmp, tmp2, tmp3);
-        tcg_temp_free_i32(tmp3);
-        tcg_temp_free_i32(tmp2);
         tcg_temp_free_i32(tmp);
         gen_op_iwmmxt_movq_wRn_M0(wrd);
         gen_op_iwmmxt_set_mup();
@@ -2318,10 +2315,9 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn)
         rd0 = (insn >> 16) & 0xf;
         rd1 = (insn >> 0) & 0xf;
         gen_op_iwmmxt_movq_M0_wRn(rd0);
-        tmp = tcg_const_i32((insn >> 20) & 3);
         iwmmxt_load_reg(cpu_V1, rd1);
-        gen_helper_iwmmxt_align(cpu_M0, cpu_M0, cpu_V1, tmp);
-        tcg_temp_free_i32(tmp);
+        gen_helper_iwmmxt_align(cpu_M0, cpu_M0, cpu_V1,
+                                tcg_constant_i32((insn >> 20) & 3));
         gen_op_iwmmxt_movq_wRn_M0(wrd);
         gen_op_iwmmxt_set_mup();
         break;
@@ -2375,9 +2371,8 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn)
         wrd = (insn >> 12) & 0xf;
         rd0 = (insn >> 16) & 0xf;
         gen_op_iwmmxt_movq_M0_wRn(rd0);
-        tmp = tcg_const_i32(((insn >> 16) & 0xf0) | (insn & 0x0f));
+        tmp = tcg_constant_i32(((insn >> 16) & 0xf0) | (insn & 0x0f));
         gen_helper_iwmmxt_shufh(cpu_M0, cpu_env, cpu_M0, tmp);
-        tcg_temp_free_i32(tmp);
         gen_op_iwmmxt_movq_wRn_M0(wrd);
         gen_op_iwmmxt_set_mup();
         gen_op_iwmmxt_set_cup();
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 24/47] target/arm: Use tcg_constant for gen_{msr,mrs}
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (22 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 23/47] target/arm: Use tcg_constant for disas_iwmmxt_insn Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28 10:24   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 25/47] target/arm: Use tcg_constant for vector shift expanders Richard Henderson
                   ` (23 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate.c | 22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)

diff --git a/target/arm/translate.c b/target/arm/translate.c
index 501192ed55..2e4165be3d 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -2845,7 +2845,7 @@ static bool msr_banked_access_decode(DisasContext *s, int r, int sysm, int rn,
                 tcg_gen_sextract_i32(tcg_el, tcg_el, ctz32(SCR_EEL2), 1);
                 tcg_gen_addi_i32(tcg_el, tcg_el, 3);
             } else {
-                tcg_el = tcg_const_i32(3);
+                tcg_el = tcg_constant_i32(3);
             }
 
             gen_exception_el(s, EXCP_UDEF, syn_uncategorized(), tcg_el);
@@ -2880,7 +2880,7 @@ undef:
 
 static void gen_msr_banked(DisasContext *s, int r, int sysm, int rn)
 {
-    TCGv_i32 tcg_reg, tcg_tgtmode, tcg_regno;
+    TCGv_i32 tcg_reg;
     int tgtmode = 0, regno = 0;
 
     if (!msr_banked_access_decode(s, r, sysm, rn, &tgtmode, &regno)) {
@@ -2891,18 +2891,16 @@ static void gen_msr_banked(DisasContext *s, int r, int sysm, int rn)
     gen_set_condexec(s);
     gen_set_pc_im(s, s->pc_curr);
     tcg_reg = load_reg(s, rn);
-    tcg_tgtmode = tcg_const_i32(tgtmode);
-    tcg_regno = tcg_const_i32(regno);
-    gen_helper_msr_banked(cpu_env, tcg_reg, tcg_tgtmode, tcg_regno);
-    tcg_temp_free_i32(tcg_tgtmode);
-    tcg_temp_free_i32(tcg_regno);
+    gen_helper_msr_banked(cpu_env, tcg_reg,
+                          tcg_constant_i32(tgtmode),
+                          tcg_constant_i32(regno));
     tcg_temp_free_i32(tcg_reg);
     s->base.is_jmp = DISAS_UPDATE_EXIT;
 }
 
 static void gen_mrs_banked(DisasContext *s, int r, int sysm, int rn)
 {
-    TCGv_i32 tcg_reg, tcg_tgtmode, tcg_regno;
+    TCGv_i32 tcg_reg;
     int tgtmode = 0, regno = 0;
 
     if (!msr_banked_access_decode(s, r, sysm, rn, &tgtmode, &regno)) {
@@ -2913,11 +2911,9 @@ static void gen_mrs_banked(DisasContext *s, int r, int sysm, int rn)
     gen_set_condexec(s);
     gen_set_pc_im(s, s->pc_curr);
     tcg_reg = tcg_temp_new_i32();
-    tcg_tgtmode = tcg_const_i32(tgtmode);
-    tcg_regno = tcg_const_i32(regno);
-    gen_helper_mrs_banked(tcg_reg, cpu_env, tcg_tgtmode, tcg_regno);
-    tcg_temp_free_i32(tcg_tgtmode);
-    tcg_temp_free_i32(tcg_regno);
+    gen_helper_mrs_banked(tcg_reg, cpu_env,
+                          tcg_constant_i32(tgtmode),
+                          tcg_constant_i32(regno));
     store_reg(s, rn, tcg_reg);
     s->base.is_jmp = DISAS_UPDATE_EXIT;
 }
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 25/47] target/arm: Use tcg_constant for vector shift expanders
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (23 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 24/47] target/arm: Use tcg_constant for gen_{msr,mrs} Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28 10:25   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 26/47] target/arm: Use tcg_constant for do_coproc_insn Richard Henderson
                   ` (22 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate.c | 27 +++++++++------------------
 1 file changed, 9 insertions(+), 18 deletions(-)

diff --git a/target/arm/translate.c b/target/arm/translate.c
index 2e4165be3d..9539d2e8ca 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -2996,9 +2996,8 @@ void gen_gvec_sqrdmlsh_qc(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs,
     }                                                                   \
     static void gen_##NAME##0_vec(unsigned vece, TCGv_vec d, TCGv_vec a) \
     {                                                                   \
-        TCGv_vec zero = tcg_const_zeros_vec_matching(d);                \
+        TCGv_vec zero = tcg_constant_vec_matching(d, vece, 0);          \
         tcg_gen_cmp_vec(COND, vece, d, a, zero);                        \
-        tcg_temp_free_vec(zero);                                        \
     }                                                                   \
     void gen_gvec_##NAME##0(unsigned vece, uint32_t d, uint32_t m,      \
                             uint32_t opr_sz, uint32_t max_sz)           \
@@ -3988,8 +3987,8 @@ void gen_ushl_i32(TCGv_i32 dst, TCGv_i32 src, TCGv_i32 shift)
     TCGv_i32 rval = tcg_temp_new_i32();
     TCGv_i32 lsh = tcg_temp_new_i32();
     TCGv_i32 rsh = tcg_temp_new_i32();
-    TCGv_i32 zero = tcg_const_i32(0);
-    TCGv_i32 max = tcg_const_i32(32);
+    TCGv_i32 zero = tcg_constant_i32(0);
+    TCGv_i32 max = tcg_constant_i32(32);
 
     /*
      * Rely on the TCG guarantee that out of range shifts produce
@@ -4007,8 +4006,6 @@ void gen_ushl_i32(TCGv_i32 dst, TCGv_i32 src, TCGv_i32 shift)
     tcg_temp_free_i32(rval);
     tcg_temp_free_i32(lsh);
     tcg_temp_free_i32(rsh);
-    tcg_temp_free_i32(zero);
-    tcg_temp_free_i32(max);
 }
 
 void gen_ushl_i64(TCGv_i64 dst, TCGv_i64 src, TCGv_i64 shift)
@@ -4017,8 +4014,8 @@ void gen_ushl_i64(TCGv_i64 dst, TCGv_i64 src, TCGv_i64 shift)
     TCGv_i64 rval = tcg_temp_new_i64();
     TCGv_i64 lsh = tcg_temp_new_i64();
     TCGv_i64 rsh = tcg_temp_new_i64();
-    TCGv_i64 zero = tcg_const_i64(0);
-    TCGv_i64 max = tcg_const_i64(64);
+    TCGv_i64 zero = tcg_constant_i64(0);
+    TCGv_i64 max = tcg_constant_i64(64);
 
     /*
      * Rely on the TCG guarantee that out of range shifts produce
@@ -4036,8 +4033,6 @@ void gen_ushl_i64(TCGv_i64 dst, TCGv_i64 src, TCGv_i64 shift)
     tcg_temp_free_i64(rval);
     tcg_temp_free_i64(lsh);
     tcg_temp_free_i64(rsh);
-    tcg_temp_free_i64(zero);
-    tcg_temp_free_i64(max);
 }
 
 static void gen_ushl_vec(unsigned vece, TCGv_vec dst,
@@ -4132,8 +4127,8 @@ void gen_sshl_i32(TCGv_i32 dst, TCGv_i32 src, TCGv_i32 shift)
     TCGv_i32 rval = tcg_temp_new_i32();
     TCGv_i32 lsh = tcg_temp_new_i32();
     TCGv_i32 rsh = tcg_temp_new_i32();
-    TCGv_i32 zero = tcg_const_i32(0);
-    TCGv_i32 max = tcg_const_i32(31);
+    TCGv_i32 zero = tcg_constant_i32(0);
+    TCGv_i32 max = tcg_constant_i32(31);
 
     /*
      * Rely on the TCG guarantee that out of range shifts produce
@@ -4152,8 +4147,6 @@ void gen_sshl_i32(TCGv_i32 dst, TCGv_i32 src, TCGv_i32 shift)
     tcg_temp_free_i32(rval);
     tcg_temp_free_i32(lsh);
     tcg_temp_free_i32(rsh);
-    tcg_temp_free_i32(zero);
-    tcg_temp_free_i32(max);
 }
 
 void gen_sshl_i64(TCGv_i64 dst, TCGv_i64 src, TCGv_i64 shift)
@@ -4162,8 +4155,8 @@ void gen_sshl_i64(TCGv_i64 dst, TCGv_i64 src, TCGv_i64 shift)
     TCGv_i64 rval = tcg_temp_new_i64();
     TCGv_i64 lsh = tcg_temp_new_i64();
     TCGv_i64 rsh = tcg_temp_new_i64();
-    TCGv_i64 zero = tcg_const_i64(0);
-    TCGv_i64 max = tcg_const_i64(63);
+    TCGv_i64 zero = tcg_constant_i64(0);
+    TCGv_i64 max = tcg_constant_i64(63);
 
     /*
      * Rely on the TCG guarantee that out of range shifts produce
@@ -4182,8 +4175,6 @@ void gen_sshl_i64(TCGv_i64 dst, TCGv_i64 src, TCGv_i64 shift)
     tcg_temp_free_i64(rval);
     tcg_temp_free_i64(lsh);
     tcg_temp_free_i64(rsh);
-    tcg_temp_free_i64(zero);
-    tcg_temp_free_i64(max);
 }
 
 static void gen_sshl_vec(unsigned vece, TCGv_vec dst,
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 26/47] target/arm: Use tcg_constant for do_coproc_insn
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (24 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 25/47] target/arm: Use tcg_constant for vector shift expanders Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28 10:27   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 27/47] target/arm: Use tcg_constant for gen_srs Richard Henderson
                   ` (21 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate.c | 43 +++++++++++++-----------------------------
 1 file changed, 13 insertions(+), 30 deletions(-)

diff --git a/target/arm/translate.c b/target/arm/translate.c
index 9539d2e8ca..e4f3db26f6 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -4689,8 +4689,6 @@ static void do_coproc_insn(DisasContext *s, int cpnum, int is64,
              * Note that on XScale all cp0..c13 registers do an access check
              * call in order to handle c15_cpar.
              */
-            TCGv_ptr tmpptr;
-            TCGv_i32 tcg_syn, tcg_isread;
             uint32_t syndrome;
 
             /* Note that since we are an implementation which takes an
@@ -4733,14 +4731,10 @@ static void do_coproc_insn(DisasContext *s, int cpnum, int is64,
 
             gen_set_condexec(s);
             gen_set_pc_im(s, s->pc_curr);
-            tmpptr = tcg_const_ptr(ri);
-            tcg_syn = tcg_const_i32(syndrome);
-            tcg_isread = tcg_const_i32(isread);
-            gen_helper_access_check_cp_reg(cpu_env, tmpptr, tcg_syn,
-                                           tcg_isread);
-            tcg_temp_free_ptr(tmpptr);
-            tcg_temp_free_i32(tcg_syn);
-            tcg_temp_free_i32(tcg_isread);
+            gen_helper_access_check_cp_reg(cpu_env,
+                                           tcg_constant_ptr(ri),
+                                           tcg_constant_i32(syndrome),
+                                           tcg_constant_i32(isread));
         } else if (ri->type & ARM_CP_RAISES_EXC) {
             /*
              * The readfn or writefn might raise an exception;
@@ -4776,13 +4770,11 @@ static void do_coproc_insn(DisasContext *s, int cpnum, int is64,
                 TCGv_i64 tmp64;
                 TCGv_i32 tmp;
                 if (ri->type & ARM_CP_CONST) {
-                    tmp64 = tcg_const_i64(ri->resetvalue);
+                    tmp64 = tcg_constant_i64(ri->resetvalue);
                 } else if (ri->readfn) {
-                    TCGv_ptr tmpptr;
                     tmp64 = tcg_temp_new_i64();
-                    tmpptr = tcg_const_ptr(ri);
-                    gen_helper_get_cp_reg64(tmp64, cpu_env, tmpptr);
-                    tcg_temp_free_ptr(tmpptr);
+                    gen_helper_get_cp_reg64(tmp64, cpu_env,
+                                            tcg_constant_ptr(ri));
                 } else {
                     tmp64 = tcg_temp_new_i64();
                     tcg_gen_ld_i64(tmp64, cpu_env, ri->fieldoffset);
@@ -4797,13 +4789,10 @@ static void do_coproc_insn(DisasContext *s, int cpnum, int is64,
             } else {
                 TCGv_i32 tmp;
                 if (ri->type & ARM_CP_CONST) {
-                    tmp = tcg_const_i32(ri->resetvalue);
+                    tmp = tcg_constant_i32(ri->resetvalue);
                 } else if (ri->readfn) {
-                    TCGv_ptr tmpptr;
                     tmp = tcg_temp_new_i32();
-                    tmpptr = tcg_const_ptr(ri);
-                    gen_helper_get_cp_reg(tmp, cpu_env, tmpptr);
-                    tcg_temp_free_ptr(tmpptr);
+                    gen_helper_get_cp_reg(tmp, cpu_env, tcg_constant_ptr(ri));
                 } else {
                     tmp = load_cpu_offset(ri->fieldoffset);
                 }
@@ -4833,24 +4822,18 @@ static void do_coproc_insn(DisasContext *s, int cpnum, int is64,
                 tcg_temp_free_i32(tmplo);
                 tcg_temp_free_i32(tmphi);
                 if (ri->writefn) {
-                    TCGv_ptr tmpptr = tcg_const_ptr(ri);
-                    gen_helper_set_cp_reg64(cpu_env, tmpptr, tmp64);
-                    tcg_temp_free_ptr(tmpptr);
+                    gen_helper_set_cp_reg64(cpu_env, tcg_constant_ptr(ri),
+                                            tmp64);
                 } else {
                     tcg_gen_st_i64(tmp64, cpu_env, ri->fieldoffset);
                 }
                 tcg_temp_free_i64(tmp64);
             } else {
+                TCGv_i32 tmp = load_reg(s, rt);
                 if (ri->writefn) {
-                    TCGv_i32 tmp;
-                    TCGv_ptr tmpptr;
-                    tmp = load_reg(s, rt);
-                    tmpptr = tcg_const_ptr(ri);
-                    gen_helper_set_cp_reg(cpu_env, tmpptr, tmp);
-                    tcg_temp_free_ptr(tmpptr);
+                    gen_helper_set_cp_reg(cpu_env, tcg_constant_ptr(ri), tmp);
                     tcg_temp_free_i32(tmp);
                 } else {
-                    TCGv_i32 tmp = load_reg(s, rt);
                     store_cpu_offset(tmp, ri->fieldoffset, 4);
                 }
             }
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 27/47] target/arm: Use tcg_constant for gen_srs
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (25 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 26/47] target/arm: Use tcg_constant for do_coproc_insn Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28 10:29   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 28/47] target/arm: Use tcg_constant for op_s_{rri,rxi}_rot Richard Henderson
                   ` (20 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/target/arm/translate.c b/target/arm/translate.c
index e4f3db26f6..8476f259fc 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -5137,12 +5137,10 @@ static void gen_srs(DisasContext *s,
     }
 
     addr = tcg_temp_new_i32();
-    tmp = tcg_const_i32(mode);
     /* get_r13_banked() will raise an exception if called from System mode */
     gen_set_condexec(s);
     gen_set_pc_im(s, s->pc_curr);
-    gen_helper_get_r13_banked(addr, cpu_env, tmp);
-    tcg_temp_free_i32(tmp);
+    gen_helper_get_r13_banked(addr, cpu_env, tcg_constant_i32(mode));
     switch (amode) {
     case 0: /* DA */
         offset = -4;
@@ -5185,9 +5183,7 @@ static void gen_srs(DisasContext *s,
             abort();
         }
         tcg_gen_addi_i32(addr, addr, offset);
-        tmp = tcg_const_i32(mode);
-        gen_helper_set_r13_banked(cpu_env, tmp, addr);
-        tcg_temp_free_i32(tmp);
+        gen_helper_set_r13_banked(cpu_env, tcg_constant_i32(mode), addr);
     }
     tcg_temp_free_i32(addr);
     s->base.is_jmp = DISAS_UPDATE_EXIT;
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 28/47] target/arm: Use tcg_constant for op_s_{rri,rxi}_rot
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (26 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 27/47] target/arm: Use tcg_constant for gen_srs Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28 10:29   ` [PATCH 28/47] target/arm: Use tcg_constant for op_s_{rri, rxi}_rot Peter Maydell
  2022-04-26 16:30 ` [PATCH 29/47] target/arm: Use tcg_constant for MOVW, UMAAL, CRC32 Richard Henderson
                   ` (19 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/target/arm/translate.c b/target/arm/translate.c
index 8476f259fc..223fd5fdfe 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -5495,18 +5495,16 @@ static bool op_s_rri_rot(DisasContext *s, arg_s_rri_rot *a,
                          void (*gen)(TCGv_i32, TCGv_i32, TCGv_i32),
                          int logic_cc, StoreRegKind kind)
 {
-    TCGv_i32 tmp1, tmp2;
+    TCGv_i32 tmp1;
     uint32_t imm;
 
     imm = ror32(a->imm, a->rot);
     if (logic_cc && a->rot) {
         tcg_gen_movi_i32(cpu_CF, imm >> 31);
     }
-    tmp2 = tcg_const_i32(imm);
     tmp1 = load_reg(s, a->rn);
 
-    gen(tmp1, tmp1, tmp2);
-    tcg_temp_free_i32(tmp2);
+    gen(tmp1, tmp1, tcg_constant_i32(imm));
 
     if (logic_cc) {
         gen_logic_CC(tmp1);
@@ -5525,9 +5523,10 @@ static bool op_s_rxi_rot(DisasContext *s, arg_s_rri_rot *a,
     if (logic_cc && a->rot) {
         tcg_gen_movi_i32(cpu_CF, imm >> 31);
     }
-    tmp = tcg_const_i32(imm);
 
-    gen(tmp, tmp);
+    tmp = tcg_temp_new_i32();
+    gen(tmp, tcg_constant_i32(imm));
+
     if (logic_cc) {
         gen_logic_CC(tmp);
     }
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 29/47] target/arm: Use tcg_constant for MOVW, UMAAL, CRC32
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (27 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 28/47] target/arm: Use tcg_constant for op_s_{rri,rxi}_rot Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28 10:30   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 30/47] target/arm: Use tcg_constant for v7m MRS, MSR Richard Henderson
                   ` (18 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/target/arm/translate.c b/target/arm/translate.c
index 223fd5fdfe..cc540f2b47 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -5652,14 +5652,11 @@ static bool trans_ADR(DisasContext *s, arg_ri *a)
 
 static bool trans_MOVW(DisasContext *s, arg_MOVW *a)
 {
-    TCGv_i32 tmp;
-
     if (!ENABLE_ARCH_6T2) {
         return false;
     }
 
-    tmp = tcg_const_i32(a->imm);
-    store_reg(s, a->rd, tmp);
+    store_reg(s, a->rd, tcg_constant_i32(a->imm));
     return true;
 }
 
@@ -6030,14 +6027,13 @@ static bool trans_UMAAL(DisasContext *s, arg_UMAAL *a)
     t0 = load_reg(s, a->rm);
     t1 = load_reg(s, a->rn);
     tcg_gen_mulu2_i32(t0, t1, t0, t1);
-    zero = tcg_const_i32(0);
+    zero = tcg_constant_i32(0);
     t2 = load_reg(s, a->ra);
     tcg_gen_add2_i32(t0, t1, t0, t1, t2, zero);
     tcg_temp_free_i32(t2);
     t2 = load_reg(s, a->rd);
     tcg_gen_add2_i32(t0, t1, t0, t1, t2, zero);
     tcg_temp_free_i32(t2);
-    tcg_temp_free_i32(zero);
     store_reg(s, a->ra, t0);
     store_reg(s, a->rd, t1);
     return true;
@@ -6284,14 +6280,13 @@ static bool op_crc32(DisasContext *s, arg_rrr *a, bool c, MemOp sz)
     default:
         g_assert_not_reached();
     }
-    t3 = tcg_const_i32(1 << sz);
+    t3 = tcg_constant_i32(1 << sz);
     if (c) {
         gen_helper_crc32c(t1, t1, t2, t3);
     } else {
         gen_helper_crc32(t1, t1, t2, t3);
     }
     tcg_temp_free_i32(t2);
-    tcg_temp_free_i32(t3);
     store_reg(s, a->rd, t1);
     return true;
 }
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 30/47] target/arm: Use tcg_constant for v7m MRS, MSR
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (28 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 29/47] target/arm: Use tcg_constant for MOVW, UMAAL, CRC32 Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28 10:31   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 31/47] target/arm: Use tcg_constant for TT, SAT, SMMLA Richard Henderson
                   ` (17 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/target/arm/translate.c b/target/arm/translate.c
index cc540f2b47..b604a820c0 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -6369,8 +6369,8 @@ static bool trans_MRS_v7m(DisasContext *s, arg_MRS_v7m *a)
     if (!arm_dc_feature(s, ARM_FEATURE_M)) {
         return false;
     }
-    tmp = tcg_const_i32(a->sysm);
-    gen_helper_v7m_mrs(tmp, cpu_env, tmp);
+    tmp = tcg_temp_new_i32();
+    gen_helper_v7m_mrs(tmp, cpu_env, tcg_constant_i32(a->sysm));
     store_reg(s, a->rd, tmp);
     return true;
 }
@@ -6382,10 +6382,9 @@ static bool trans_MSR_v7m(DisasContext *s, arg_MSR_v7m *a)
     if (!arm_dc_feature(s, ARM_FEATURE_M)) {
         return false;
     }
-    addr = tcg_const_i32((a->mask << 10) | a->sysm);
+    addr = tcg_constant_i32((a->mask << 10) | a->sysm);
     reg = load_reg(s, a->rn);
     gen_helper_v7m_msr(cpu_env, addr, reg);
-    tcg_temp_free_i32(addr);
     tcg_temp_free_i32(reg);
     /* If we wrote to CONTROL, the EL might have changed */
     gen_rebuild_hflags(s, true);
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 31/47] target/arm: Use tcg_constant for TT, SAT, SMMLA
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (29 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 30/47] target/arm: Use tcg_constant for v7m MRS, MSR Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28 10:37   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 32/47] target/arm: Use tcg_constant in LDM, STM Richard Henderson
                   ` (16 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/target/arm/translate.c b/target/arm/translate.c
index b604a820c0..24e522e1d6 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -6596,8 +6596,8 @@ static bool trans_TT(DisasContext *s, arg_TT *a)
     }
 
     addr = load_reg(s, a->rn);
-    tmp = tcg_const_i32((a->A << 1) | a->T);
-    gen_helper_v7m_tt(tmp, cpu_env, addr, tmp);
+    tmp = tcg_temp_new_i32();
+    gen_helper_v7m_tt(tmp, cpu_env, addr, tcg_constant_i32((a->A << 1) | a->T));
     tcg_temp_free_i32(addr);
     store_reg(s, a->rd, tmp);
     return true;
@@ -7564,7 +7564,7 @@ static bool trans_PKH(DisasContext *s, arg_PKH *a)
 static bool op_sat(DisasContext *s, arg_sat *a,
                    void (*gen)(TCGv_i32, TCGv_env, TCGv_i32, TCGv_i32))
 {
-    TCGv_i32 tmp, satimm;
+    TCGv_i32 tmp;
     int shift = a->imm;
 
     if (!ENABLE_ARCH_6) {
@@ -7578,9 +7578,7 @@ static bool op_sat(DisasContext *s, arg_sat *a,
         tcg_gen_shli_i32(tmp, tmp, shift);
     }
 
-    satimm = tcg_const_i32(a->satimm);
-    gen(tmp, cpu_env, tmp, satimm);
-    tcg_temp_free_i32(satimm);
+    gen(tmp, cpu_env, tmp, tcg_constant_i32(a->satimm));
 
     store_reg(s, a->rd, tmp);
     return true;
@@ -7915,9 +7913,7 @@ static bool op_smmla(DisasContext *s, arg_rrrr *a, bool round, bool sub)
              * a non-zero multiplicand lowpart, and the correct result
              * lowpart for rounding.
              */
-            TCGv_i32 zero = tcg_const_i32(0);
-            tcg_gen_sub2_i32(t2, t1, zero, t3, t2, t1);
-            tcg_temp_free_i32(zero);
+            tcg_gen_sub2_i32(t2, t1, tcg_constant_i32(0), t3, t2, t1);
         } else {
             tcg_gen_add_i32(t1, t1, t3);
         }
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 32/47] target/arm: Use tcg_constant in LDM, STM
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (30 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 31/47] target/arm: Use tcg_constant for TT, SAT, SMMLA Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28 10:37   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 33/47] target/arm: Use tcg_constant in CLRM, DLS, WLS, LE Richard Henderson
                   ` (15 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/target/arm/translate.c b/target/arm/translate.c
index 24e522e1d6..e0469da0a1 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -8050,7 +8050,7 @@ static bool op_stm(DisasContext *s, arg_ldst_block *a, int min_n)
 {
     int i, j, n, list, mem_idx;
     bool user = a->u;
-    TCGv_i32 addr, tmp, tmp2;
+    TCGv_i32 addr, tmp;
 
     if (user) {
         /* STM (user) */
@@ -8080,9 +8080,7 @@ static bool op_stm(DisasContext *s, arg_ldst_block *a, int min_n)
 
         if (user && i != 15) {
             tmp = tcg_temp_new_i32();
-            tmp2 = tcg_const_i32(i);
-            gen_helper_get_user_reg(tmp, cpu_env, tmp2);
-            tcg_temp_free_i32(tmp2);
+            gen_helper_get_user_reg(tmp, cpu_env, tcg_constant_i32(i));
         } else {
             tmp = load_reg(s, i);
         }
@@ -8123,7 +8121,7 @@ static bool do_ldm(DisasContext *s, arg_ldst_block *a, int min_n)
     bool loaded_base;
     bool user = a->u;
     bool exc_return = false;
-    TCGv_i32 addr, tmp, tmp2, loaded_var;
+    TCGv_i32 addr, tmp, loaded_var;
 
     if (user) {
         /* LDM (user), LDM (exception return) */
@@ -8166,9 +8164,7 @@ static bool do_ldm(DisasContext *s, arg_ldst_block *a, int min_n)
         tmp = tcg_temp_new_i32();
         gen_aa32_ld_i32(s, tmp, addr, mem_idx, MO_UL | MO_ALIGN);
         if (user) {
-            tmp2 = tcg_const_i32(i);
-            gen_helper_set_user_reg(cpu_env, tmp2, tmp);
-            tcg_temp_free_i32(tmp2);
+            gen_helper_set_user_reg(cpu_env, tcg_constant_i32(i), tmp);
             tcg_temp_free_i32(tmp);
         } else if (i == a->rn) {
             loaded_var = tmp;
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 33/47] target/arm: Use tcg_constant in CLRM, DLS, WLS, LE
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (31 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 32/47] target/arm: Use tcg_constant in LDM, STM Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28 10:38   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 34/47] target/arm: Use tcg_constant in trans_CPS_v7m Richard Henderson
                   ` (14 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate.c | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/target/arm/translate.c b/target/arm/translate.c
index e0469da0a1..0e9fde2589 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -8257,7 +8257,7 @@ static bool trans_CLRM(DisasContext *s, arg_CLRM *a)
 
     s->eci_handled = true;
 
-    zero = tcg_const_i32(0);
+    zero = tcg_constant_i32(0);
     for (i = 0; i < 15; i++) {
         if (extract32(a->list, i, 1)) {
             /* Clear R[i] */
@@ -8269,11 +8269,8 @@ static bool trans_CLRM(DisasContext *s, arg_CLRM *a)
          * Clear APSR (by calling the MSR helper with the same argument
          * as for "MSR APSR_nzcvqg, Rn": mask = 0b1100, SYSM=0)
          */
-        TCGv_i32 maskreg = tcg_const_i32(0xc << 8);
-        gen_helper_v7m_msr(cpu_env, maskreg, zero);
-        tcg_temp_free_i32(maskreg);
+        gen_helper_v7m_msr(cpu_env, tcg_constant_i32(0xc00), zero);
     }
-    tcg_temp_free_i32(zero);
     clear_eci_state(s);
     return true;
 }
@@ -8416,8 +8413,7 @@ static bool trans_DLS(DisasContext *s, arg_DLS *a)
     store_reg(s, 14, tmp);
     if (a->size != 4) {
         /* DLSTP: set FPSCR.LTPSIZE */
-        tmp = tcg_const_i32(a->size);
-        store_cpu_field(tmp, v7m.ltpsize);
+        store_cpu_field(tcg_constant_i32(a->size), v7m.ltpsize);
         s->base.is_jmp = DISAS_UPDATE_NOCHAIN;
     }
     return true;
@@ -8482,8 +8478,7 @@ static bool trans_WLS(DisasContext *s, arg_WLS *a)
          */
         bool ok = vfp_access_check(s);
         assert(ok);
-        tmp = tcg_const_i32(a->size);
-        store_cpu_field(tmp, v7m.ltpsize);
+        store_cpu_field(tcg_constant_i32(a->size), v7m.ltpsize);
         /*
          * LTPSIZE updated, but MVE_NO_PRED will always be the same thing (0)
          * when we take this upcoming exit from this TB, so gen_jmp_tb() is OK.
@@ -8609,8 +8604,7 @@ static bool trans_LE(DisasContext *s, arg_LE *a)
     gen_set_label(loopend);
     if (a->tp) {
         /* Exits from tail-pred loops must reset LTPSIZE to 4 */
-        tmp = tcg_const_i32(4);
-        store_cpu_field(tmp, v7m.ltpsize);
+        store_cpu_field(tcg_constant_i32(4), v7m.ltpsize);
     }
     /* End TB, continuing to following insn */
     gen_jmp_tb(s, s->base.pc_next, 1);
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 34/47] target/arm: Use tcg_constant in trans_CPS_v7m
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (32 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 33/47] target/arm: Use tcg_constant in CLRM, DLS, WLS, LE Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28 10:39   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 35/47] target/arm: Use tcg_constant in trans_CSEL Richard Henderson
                   ` (13 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/target/arm/translate.c b/target/arm/translate.c
index 0e9fde2589..5ce23947a1 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -8835,21 +8835,18 @@ static bool trans_CPS_v7m(DisasContext *s, arg_CPS_v7m *a)
         return true;
     }
 
-    tmp = tcg_const_i32(a->im);
+    tmp = tcg_constant_i32(a->im);
     /* FAULTMASK */
     if (a->F) {
-        addr = tcg_const_i32(19);
+        addr = tcg_constant_i32(19);
         gen_helper_v7m_msr(cpu_env, addr, tmp);
-        tcg_temp_free_i32(addr);
     }
     /* PRIMASK */
     if (a->I) {
-        addr = tcg_const_i32(16);
+        addr = tcg_constant_i32(16);
         gen_helper_v7m_msr(cpu_env, addr, tmp);
-        tcg_temp_free_i32(addr);
     }
     gen_rebuild_hflags(s, false);
-    tcg_temp_free_i32(tmp);
     gen_lookup_tb(s);
     return true;
 }
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 35/47] target/arm: Use tcg_constant in trans_CSEL
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (33 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 34/47] target/arm: Use tcg_constant in trans_CPS_v7m Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28 10:39   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 36/47] target/arm: Use tcg_constant for trans_INDEX_* Richard Henderson
                   ` (12 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/target/arm/translate.c b/target/arm/translate.c
index 5ce23947a1..37fb17cdaa 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -8982,13 +8982,14 @@ static bool trans_CSEL(DisasContext *s, arg_CSEL *a)
     }
 
     /* In this insn input reg fields of 0b1111 mean "zero", not "PC" */
+    zero = tcg_constant_i32(0);
     if (a->rn == 15) {
-        rn = tcg_const_i32(0);
+        rn = zero;
     } else {
         rn = load_reg(s, a->rn);
     }
     if (a->rm == 15) {
-        rm = tcg_const_i32(0);
+        rm = zero;
     } else {
         rm = load_reg(s, a->rm);
     }
@@ -9010,10 +9011,8 @@ static bool trans_CSEL(DisasContext *s, arg_CSEL *a)
     }
 
     arm_test_cc(&c, a->fcond);
-    zero = tcg_const_i32(0);
     tcg_gen_movcond_i32(c.cond, rn, c.value, zero, rn, rm);
     arm_free_cc(&c);
-    tcg_temp_free_i32(zero);
 
     store_reg(s, a->rd, rn);
     tcg_temp_free_i32(rm);
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 36/47] target/arm: Use tcg_constant for trans_INDEX_*
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (34 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 35/47] target/arm: Use tcg_constant in trans_CSEL Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28 10:40   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 37/47] target/arm: Use tcg_constant in SINCDEC, INCDEC Richard Henderson
                   ` (11 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-sve.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
index 726cf88d7c..8b173f5c4a 100644
--- a/target/arm/translate-sve.c
+++ b/target/arm/translate-sve.c
@@ -1266,11 +1266,9 @@ static void do_index(DisasContext *s, int esz, int rd,
 static bool trans_INDEX_ii(DisasContext *s, arg_INDEX_ii *a)
 {
     if (sve_access_check(s)) {
-        TCGv_i64 start = tcg_const_i64(a->imm1);
-        TCGv_i64 incr = tcg_const_i64(a->imm2);
+        TCGv_i64 start = tcg_constant_i64(a->imm1);
+        TCGv_i64 incr = tcg_constant_i64(a->imm2);
         do_index(s, a->esz, a->rd, start, incr);
-        tcg_temp_free_i64(start);
-        tcg_temp_free_i64(incr);
     }
     return true;
 }
@@ -1278,10 +1276,9 @@ static bool trans_INDEX_ii(DisasContext *s, arg_INDEX_ii *a)
 static bool trans_INDEX_ir(DisasContext *s, arg_INDEX_ir *a)
 {
     if (sve_access_check(s)) {
-        TCGv_i64 start = tcg_const_i64(a->imm);
+        TCGv_i64 start = tcg_constant_i64(a->imm);
         TCGv_i64 incr = cpu_reg(s, a->rm);
         do_index(s, a->esz, a->rd, start, incr);
-        tcg_temp_free_i64(start);
     }
     return true;
 }
@@ -1290,9 +1287,8 @@ static bool trans_INDEX_ri(DisasContext *s, arg_INDEX_ri *a)
 {
     if (sve_access_check(s)) {
         TCGv_i64 start = cpu_reg(s, a->rn);
-        TCGv_i64 incr = tcg_const_i64(a->imm);
+        TCGv_i64 incr = tcg_constant_i64(a->imm);
         do_index(s, a->esz, a->rd, start, incr);
-        tcg_temp_free_i64(incr);
     }
     return true;
 }
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 37/47] target/arm: Use tcg_constant in SINCDEC, INCDEC
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (35 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 36/47] target/arm: Use tcg_constant for trans_INDEX_* Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28 10:41   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 38/47] target/arm: Use tcg_constant in FCPY, CPY Richard Henderson
                   ` (10 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-sve.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
index 8b173f5c4a..9321457f31 100644
--- a/target/arm/translate-sve.c
+++ b/target/arm/translate-sve.c
@@ -2103,9 +2103,7 @@ static bool trans_SINCDEC_r_32(DisasContext *s, arg_incdec_cnt *a)
             tcg_gen_ext32s_i64(reg, reg);
         }
     } else {
-        TCGv_i64 t = tcg_const_i64(inc);
-        do_sat_addsub_32(reg, t, a->u, a->d);
-        tcg_temp_free_i64(t);
+        do_sat_addsub_32(reg, tcg_constant_i64(inc), a->u, a->d);
     }
     return true;
 }
@@ -2122,9 +2120,7 @@ static bool trans_SINCDEC_r_64(DisasContext *s, arg_incdec_cnt *a)
     TCGv_i64 reg = cpu_reg(s, a->rd);
 
     if (inc != 0) {
-        TCGv_i64 t = tcg_const_i64(inc);
-        do_sat_addsub_64(reg, t, a->u, a->d);
-        tcg_temp_free_i64(t);
+        do_sat_addsub_64(reg, tcg_constant_i64(inc), a->u, a->d);
     }
     return true;
 }
@@ -2141,11 +2137,10 @@ static bool trans_INCDEC_v(DisasContext *s, arg_incdec2_cnt *a)
 
     if (inc != 0) {
         if (sve_access_check(s)) {
-            TCGv_i64 t = tcg_const_i64(a->d ? -inc : inc);
             tcg_gen_gvec_adds(a->esz, vec_full_reg_offset(s, a->rd),
                               vec_full_reg_offset(s, a->rn),
-                              t, fullsz, fullsz);
-            tcg_temp_free_i64(t);
+                              tcg_constant_i64(a->d ? -inc : inc),
+                              fullsz, fullsz);
         }
     } else {
         do_mov_z(s, a->rd, a->rn);
@@ -2165,9 +2160,8 @@ static bool trans_SINCDEC_v(DisasContext *s, arg_incdec2_cnt *a)
 
     if (inc != 0) {
         if (sve_access_check(s)) {
-            TCGv_i64 t = tcg_const_i64(inc);
-            do_sat_addsub_vec(s, a->esz, a->rd, a->rn, t, a->u, a->d);
-            tcg_temp_free_i64(t);
+            do_sat_addsub_vec(s, a->esz, a->rd, a->rn,
+                              tcg_constant_i64(inc), a->u, a->d);
         }
     } else {
         do_mov_z(s, a->rd, a->rn);
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 38/47] target/arm: Use tcg_constant in FCPY, CPY
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (36 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 37/47] target/arm: Use tcg_constant in SINCDEC, INCDEC Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28 10:41   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 39/47] target/arm: Use tcg_constant in {incr, wrap}_last_active Richard Henderson
                   ` (9 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-sve.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
index 9321457f31..ef57d3a2b4 100644
--- a/target/arm/translate-sve.c
+++ b/target/arm/translate-sve.c
@@ -2259,9 +2259,7 @@ static bool trans_FCPY(DisasContext *s, arg_FCPY *a)
     if (sve_access_check(s)) {
         /* Decode the VFP immediate.  */
         uint64_t imm = vfp_expand_imm(a->esz, a->imm);
-        TCGv_i64 t_imm = tcg_const_i64(imm);
-        do_cpy_m(s, a->esz, a->rd, a->rn, a->pg, t_imm);
-        tcg_temp_free_i64(t_imm);
+        do_cpy_m(s, a->esz, a->rd, a->rn, a->pg, tcg_constant_i64(imm));
     }
     return true;
 }
@@ -2272,9 +2270,7 @@ static bool trans_CPY_m_i(DisasContext *s, arg_rpri_esz *a)
         return false;
     }
     if (sve_access_check(s)) {
-        TCGv_i64 t_imm = tcg_const_i64(a->imm);
-        do_cpy_m(s, a->esz, a->rd, a->rn, a->pg, t_imm);
-        tcg_temp_free_i64(t_imm);
+        do_cpy_m(s, a->esz, a->rd, a->rn, a->pg, tcg_constant_i64(a->imm));
     }
     return true;
 }
@@ -2291,11 +2287,10 @@ static bool trans_CPY_z_i(DisasContext *s, arg_CPY_z_i *a)
     }
     if (sve_access_check(s)) {
         unsigned vsz = vec_full_reg_size(s);
-        TCGv_i64 t_imm = tcg_const_i64(a->imm);
         tcg_gen_gvec_2i_ool(vec_full_reg_offset(s, a->rd),
                             pred_full_reg_offset(s, a->pg),
-                            t_imm, vsz, vsz, 0, fns[a->esz]);
-        tcg_temp_free_i64(t_imm);
+                            tcg_constant_i64(a->imm),
+                            vsz, vsz, 0, fns[a->esz]);
     }
     return true;
 }
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 39/47] target/arm: Use tcg_constant in {incr, wrap}_last_active
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (37 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 38/47] target/arm: Use tcg_constant in FCPY, CPY Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28 10:42   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 40/47] target/arm: Use tcg_constant in do_clast_scalar Richard Henderson
                   ` (8 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-sve.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
index ef57d3a2b4..c3d3f301c9 100644
--- a/target/arm/translate-sve.c
+++ b/target/arm/translate-sve.c
@@ -2793,11 +2793,9 @@ static void incr_last_active(DisasContext *s, TCGv_i32 last, int esz)
     if (is_power_of_2(vsz)) {
         tcg_gen_andi_i32(last, last, vsz - 1);
     } else {
-        TCGv_i32 max = tcg_const_i32(vsz);
-        TCGv_i32 zero = tcg_const_i32(0);
+        TCGv_i32 max = tcg_constant_i32(vsz);
+        TCGv_i32 zero = tcg_constant_i32(0);
         tcg_gen_movcond_i32(TCG_COND_GEU, last, last, max, zero, last);
-        tcg_temp_free_i32(max);
-        tcg_temp_free_i32(zero);
     }
 }
 
@@ -2809,11 +2807,9 @@ static void wrap_last_active(DisasContext *s, TCGv_i32 last, int esz)
     if (is_power_of_2(vsz)) {
         tcg_gen_andi_i32(last, last, vsz - 1);
     } else {
-        TCGv_i32 max = tcg_const_i32(vsz - (1 << esz));
-        TCGv_i32 zero = tcg_const_i32(0);
+        TCGv_i32 max = tcg_constant_i32(vsz - (1 << esz));
+        TCGv_i32 zero = tcg_constant_i32(0);
         tcg_gen_movcond_i32(TCG_COND_LT, last, last, zero, max, last);
-        tcg_temp_free_i32(max);
-        tcg_temp_free_i32(zero);
     }
 }
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 40/47] target/arm: Use tcg_constant in do_clast_scalar
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (38 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 39/47] target/arm: Use tcg_constant in {incr, wrap}_last_active Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28 10:42   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 41/47] target/arm: Use tcg_constant in WHILE Richard Henderson
                   ` (7 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-sve.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
index c3d3f301c9..7a39ed0c06 100644
--- a/target/arm/translate-sve.c
+++ b/target/arm/translate-sve.c
@@ -2926,7 +2926,7 @@ static void do_clast_scalar(DisasContext *s, int esz, int pg, int rm,
                             bool before, TCGv_i64 reg_val)
 {
     TCGv_i32 last = tcg_temp_new_i32();
-    TCGv_i64 ele, cmp, zero;
+    TCGv_i64 ele, cmp;
 
     find_last_active(s, last, esz, pg);
 
@@ -2946,10 +2946,9 @@ static void do_clast_scalar(DisasContext *s, int esz, int pg, int rm,
     ele = load_last_active(s, last, rm, esz);
     tcg_temp_free_i32(last);
 
-    zero = tcg_const_i64(0);
-    tcg_gen_movcond_i64(TCG_COND_GE, reg_val, cmp, zero, ele, reg_val);
+    tcg_gen_movcond_i64(TCG_COND_GE, reg_val, cmp, tcg_constant_i64(0),
+                        ele, reg_val);
 
-    tcg_temp_free_i64(zero);
     tcg_temp_free_i64(cmp);
     tcg_temp_free_i64(ele);
 }
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 41/47] target/arm: Use tcg_constant in WHILE
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (39 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 40/47] target/arm: Use tcg_constant in do_clast_scalar Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28 10:46   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 42/47] target/arm: Use tcg_constant in LD1, ST1 Richard Henderson
                   ` (6 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-sve.c | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
index 7a39ed0c06..727f5cca36 100644
--- a/target/arm/translate-sve.c
+++ b/target/arm/translate-sve.c
@@ -3568,7 +3568,7 @@ static bool trans_CTERM(DisasContext *s, arg_CTERM *a)
 static bool trans_WHILE(DisasContext *s, arg_WHILE *a)
 {
     TCGv_i64 op0, op1, t0, t1, tmax;
-    TCGv_i32 t2, t3;
+    TCGv_i32 t2;
     TCGv_ptr ptr;
     unsigned vsz = vec_full_reg_size(s);
     unsigned desc = 0;
@@ -3624,7 +3624,7 @@ static bool trans_WHILE(DisasContext *s, arg_WHILE *a)
         }
     }
 
-    tmax = tcg_const_i64(vsz >> a->esz);
+    tmax = tcg_constant_i64(vsz >> a->esz);
     if (eq) {
         /* Equality means one more iteration.  */
         tcg_gen_addi_i64(t0, t0, 1);
@@ -3644,7 +3644,6 @@ static bool trans_WHILE(DisasContext *s, arg_WHILE *a)
 
     /* Bound to the maximum.  */
     tcg_gen_umin_i64(t0, t0, tmax);
-    tcg_temp_free_i64(tmax);
 
     /* Set the count to zero if the condition is false.  */
     tcg_gen_movi_i64(t1, 0);
@@ -3661,28 +3660,26 @@ static bool trans_WHILE(DisasContext *s, arg_WHILE *a)
 
     desc = FIELD_DP32(desc, PREDDESC, OPRSZ, vsz / 8);
     desc = FIELD_DP32(desc, PREDDESC, ESZ, a->esz);
-    t3 = tcg_const_i32(desc);
 
     ptr = tcg_temp_new_ptr();
     tcg_gen_addi_ptr(ptr, cpu_env, pred_full_reg_offset(s, a->rd));
 
     if (a->lt) {
-        gen_helper_sve_whilel(t2, ptr, t2, t3);
+        gen_helper_sve_whilel(t2, ptr, t2, tcg_constant_i32(desc));
     } else {
-        gen_helper_sve_whileg(t2, ptr, t2, t3);
+        gen_helper_sve_whileg(t2, ptr, t2, tcg_constant_i32(desc));
     }
     do_pred_flags(t2);
 
     tcg_temp_free_ptr(ptr);
     tcg_temp_free_i32(t2);
-    tcg_temp_free_i32(t3);
     return true;
 }
 
 static bool trans_WHILE_ptr(DisasContext *s, arg_WHILE_ptr *a)
 {
     TCGv_i64 op0, op1, diff, t1, tmax;
-    TCGv_i32 t2, t3;
+    TCGv_i32 t2;
     TCGv_ptr ptr;
     unsigned vsz = vec_full_reg_size(s);
     unsigned desc = 0;
@@ -3697,7 +3694,7 @@ static bool trans_WHILE_ptr(DisasContext *s, arg_WHILE_ptr *a)
     op0 = read_cpu_reg(s, a->rn, 1);
     op1 = read_cpu_reg(s, a->rm, 1);
 
-    tmax = tcg_const_i64(vsz);
+    tmax = tcg_constant_i64(vsz);
     diff = tcg_temp_new_i64();
 
     if (a->rw) {
@@ -3723,7 +3720,6 @@ static bool trans_WHILE_ptr(DisasContext *s, arg_WHILE_ptr *a)
 
     /* Bound to the maximum.  */
     tcg_gen_umin_i64(diff, diff, tmax);
-    tcg_temp_free_i64(tmax);
 
     /* Since we're bounded, pass as a 32-bit type.  */
     t2 = tcg_temp_new_i32();
@@ -3732,17 +3728,15 @@ static bool trans_WHILE_ptr(DisasContext *s, arg_WHILE_ptr *a)
 
     desc = FIELD_DP32(desc, PREDDESC, OPRSZ, vsz / 8);
     desc = FIELD_DP32(desc, PREDDESC, ESZ, a->esz);
-    t3 = tcg_const_i32(desc);
 
     ptr = tcg_temp_new_ptr();
     tcg_gen_addi_ptr(ptr, cpu_env, pred_full_reg_offset(s, a->rd));
 
-    gen_helper_sve_whilel(t2, ptr, t2, t3);
+    gen_helper_sve_whilel(t2, ptr, t2, tcg_constant_i32(desc));
     do_pred_flags(t2);
 
     tcg_temp_free_ptr(ptr);
     tcg_temp_free_i32(t2);
-    tcg_temp_free_i32(t3);
     return true;
 }
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 42/47] target/arm: Use tcg_constant in LD1, ST1
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (40 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 41/47] target/arm: Use tcg_constant in WHILE Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28 10:46   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 43/47] target/arm: Use tcg_constant in SUBR Richard Henderson
                   ` (5 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-sve.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
index 727f5cca36..fcab15a6ec 100644
--- a/target/arm/translate-sve.c
+++ b/target/arm/translate-sve.c
@@ -6426,7 +6426,6 @@ static bool trans_LD1_zpiz(DisasContext *s, arg_LD1_zpiz *a)
     gen_helper_gvec_mem_scatter *fn = NULL;
     bool be = s->be_data == MO_BE;
     bool mte = s->mte_active[0];
-    TCGv_i64 imm;
 
     if (a->esz < a->msz || (a->esz == a->msz && !a->u)) {
         return false;
@@ -6448,9 +6447,8 @@ static bool trans_LD1_zpiz(DisasContext *s, arg_LD1_zpiz *a)
     /* Treat LD1_zpiz (zn[x] + imm) the same way as LD1_zprz (rn + zm[x])
      * by loading the immediate into the scalar parameter.
      */
-    imm = tcg_const_i64(a->imm << a->msz);
-    do_mem_zpz(s, a->rd, a->pg, a->rn, 0, imm, a->msz, false, fn);
-    tcg_temp_free_i64(imm);
+    do_mem_zpz(s, a->rd, a->pg, a->rn, 0,
+               tcg_constant_i64(a->imm << a->msz), a->msz, false, fn);
     return true;
 }
 
@@ -6609,7 +6607,6 @@ static bool trans_ST1_zpiz(DisasContext *s, arg_ST1_zpiz *a)
     gen_helper_gvec_mem_scatter *fn = NULL;
     bool be = s->be_data == MO_BE;
     bool mte = s->mte_active[0];
-    TCGv_i64 imm;
 
     if (a->esz < a->msz) {
         return false;
@@ -6631,9 +6628,8 @@ static bool trans_ST1_zpiz(DisasContext *s, arg_ST1_zpiz *a)
     /* Treat ST1_zpiz (zn[x] + imm) the same way as ST1_zprz (rn + zm[x])
      * by loading the immediate into the scalar parameter.
      */
-    imm = tcg_const_i64(a->imm << a->msz);
-    do_mem_zpz(s, a->rd, a->pg, a->rn, 0, imm, a->msz, true, fn);
-    tcg_temp_free_i64(imm);
+    do_mem_zpz(s, a->rd, a->pg, a->rn, 0,
+               tcg_constant_i64(a->imm << a->msz), a->msz, true, fn);
     return true;
 }
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 43/47] target/arm: Use tcg_constant in SUBR
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (41 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 42/47] target/arm: Use tcg_constant in LD1, ST1 Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28 10:47   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 44/47] target/arm: Use tcg_constant in do_zzi_{sat, ool}, do_fp_imm Richard Henderson
                   ` (4 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-sve.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
index fcab15a6ec..92339a19e3 100644
--- a/target/arm/translate-sve.c
+++ b/target/arm/translate-sve.c
@@ -3830,11 +3830,9 @@ static bool trans_SUBR_zzi(DisasContext *s, arg_rri_esz *a)
     }
     if (sve_access_check(s)) {
         unsigned vsz = vec_full_reg_size(s);
-        TCGv_i64 c = tcg_const_i64(a->imm);
         tcg_gen_gvec_2s(vec_full_reg_offset(s, a->rd),
                         vec_full_reg_offset(s, a->rn),
-                        vsz, vsz, c, &op[a->esz]);
-        tcg_temp_free_i64(c);
+                        vsz, vsz, tcg_constant_i64(a->imm), &op[a->esz]);
     }
     return true;
 }
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 44/47] target/arm: Use tcg_constant in do_zzi_{sat, ool}, do_fp_imm
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (42 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 43/47] target/arm: Use tcg_constant in SUBR Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28 10:48   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 45/47] target/arm: Use tcg_constant for predicate descriptors Richard Henderson
                   ` (3 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-sve.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
index 92339a19e3..a684d489d2 100644
--- a/target/arm/translate-sve.c
+++ b/target/arm/translate-sve.c
@@ -3853,9 +3853,8 @@ static bool do_zzi_sat(DisasContext *s, arg_rri_esz *a, bool u, bool d)
         return false;
     }
     if (sve_access_check(s)) {
-        TCGv_i64 val = tcg_const_i64(a->imm);
-        do_sat_addsub_vec(s, a->esz, a->rd, a->rn, val, u, d);
-        tcg_temp_free_i64(val);
+        do_sat_addsub_vec(s, a->esz, a->rd, a->rn,
+                          tcg_constant_i64(a->imm), u, d);
     }
     return true;
 }
@@ -3884,12 +3883,9 @@ static bool do_zzi_ool(DisasContext *s, arg_rri_esz *a, gen_helper_gvec_2i *fn)
 {
     if (sve_access_check(s)) {
         unsigned vsz = vec_full_reg_size(s);
-        TCGv_i64 c = tcg_const_i64(a->imm);
-
         tcg_gen_gvec_2i_ool(vec_full_reg_offset(s, a->rd),
                             vec_full_reg_offset(s, a->rn),
-                            c, vsz, vsz, 0, fn);
-        tcg_temp_free_i64(c);
+                            tcg_constant_i64(a->imm), vsz, vsz, 0, fn);
     }
     return true;
 }
@@ -4520,9 +4516,8 @@ static void do_fp_scalar(DisasContext *s, int zd, int zn, int pg, bool is_fp16,
 static void do_fp_imm(DisasContext *s, arg_rpri_esz *a, uint64_t imm,
                       gen_helper_sve_fp2scalar *fn)
 {
-    TCGv_i64 temp = tcg_const_i64(imm);
-    do_fp_scalar(s, a->rd, a->rn, a->pg, a->esz == MO_16, temp, fn);
-    tcg_temp_free_i64(temp);
+    do_fp_scalar(s, a->rd, a->rn, a->pg, a->esz == MO_16,
+                 tcg_constant_i64(imm), fn);
 }
 
 #define DO_FP_IMM(NAME, name, const0, const1) \
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 45/47] target/arm: Use tcg_constant for predicate descriptors
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (43 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 44/47] target/arm: Use tcg_constant in do_zzi_{sat, ool}, do_fp_imm Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28 10:49   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 46/47] target/arm: Use tcg_constant for do_brk{2,3} Richard Henderson
                   ` (2 subsequent siblings)
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

In these cases, 't' did double-duty as zero source and
temporary destination.  Split the two uses.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-sve.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
index a684d489d2..e812f910ce 100644
--- a/target/arm/translate-sve.c
+++ b/target/arm/translate-sve.c
@@ -282,13 +282,12 @@ static void do_predtest(DisasContext *s, int dofs, int gofs, int words)
 {
     TCGv_ptr dptr = tcg_temp_new_ptr();
     TCGv_ptr gptr = tcg_temp_new_ptr();
-    TCGv_i32 t;
+    TCGv_i32 t = tcg_temp_new_i32();
 
     tcg_gen_addi_ptr(dptr, cpu_env, dofs);
     tcg_gen_addi_ptr(gptr, cpu_env, gofs);
-    t = tcg_const_i32(words);
 
-    gen_helper_sve_predtest(t, dptr, gptr, t);
+    gen_helper_sve_predtest(t, dptr, gptr, tcg_constant_i32(words));
     tcg_temp_free_ptr(dptr);
     tcg_temp_free_ptr(gptr);
 
@@ -1880,9 +1879,9 @@ static bool do_pfirst_pnext(DisasContext *s, arg_rr_esz *a,
 
     tcg_gen_addi_ptr(t_pd, cpu_env, pred_full_reg_offset(s, a->rd));
     tcg_gen_addi_ptr(t_pg, cpu_env, pred_full_reg_offset(s, a->rn));
-    t = tcg_const_i32(desc);
+    t = tcg_temp_new_i32();
 
-    gen_fn(t, t_pd, t_pg, t);
+    gen_fn(t, t_pd, t_pg, tcg_constant_i32(desc));
     tcg_temp_free_ptr(t_pd);
     tcg_temp_free_ptr(t_pg);
 
@@ -3176,7 +3175,7 @@ static bool do_ppzz_flags(DisasContext *s, arg_rprr_esz *a,
     }
 
     vsz = vec_full_reg_size(s);
-    t = tcg_const_i32(simd_desc(vsz, vsz, 0));
+    t = tcg_temp_new_i32();
     pd = tcg_temp_new_ptr();
     zn = tcg_temp_new_ptr();
     zm = tcg_temp_new_ptr();
@@ -3187,7 +3186,7 @@ static bool do_ppzz_flags(DisasContext *s, arg_rprr_esz *a,
     tcg_gen_addi_ptr(zm, cpu_env, vec_full_reg_offset(s, a->rm));
     tcg_gen_addi_ptr(pg, cpu_env, pred_full_reg_offset(s, a->pg));
 
-    gen_fn(t, pd, zn, zm, pg, t);
+    gen_fn(t, pd, zn, zm, pg, tcg_constant_i32(simd_desc(vsz, vsz, 0)));
 
     tcg_temp_free_ptr(pd);
     tcg_temp_free_ptr(zn);
@@ -3261,7 +3260,7 @@ static bool do_ppzi_flags(DisasContext *s, arg_rpri_esz *a,
     }
 
     vsz = vec_full_reg_size(s);
-    t = tcg_const_i32(simd_desc(vsz, vsz, a->imm));
+    t = tcg_temp_new_i32();
     pd = tcg_temp_new_ptr();
     zn = tcg_temp_new_ptr();
     pg = tcg_temp_new_ptr();
@@ -3270,7 +3269,7 @@ static bool do_ppzi_flags(DisasContext *s, arg_rpri_esz *a,
     tcg_gen_addi_ptr(zn, cpu_env, vec_full_reg_offset(s, a->rn));
     tcg_gen_addi_ptr(pg, cpu_env, pred_full_reg_offset(s, a->pg));
 
-    gen_fn(t, pd, zn, pg, t);
+    gen_fn(t, pd, zn, pg, tcg_constant_i32(simd_desc(vsz, vsz, a->imm)));
 
     tcg_temp_free_ptr(pd);
     tcg_temp_free_ptr(zn);
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 46/47] target/arm: Use tcg_constant for do_brk{2,3}
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (44 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 45/47] target/arm: Use tcg_constant for predicate descriptors Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28 10:52   ` Peter Maydell
  2022-04-26 16:30 ` [PATCH 47/47] target/arm: Use tcg_constant for vector descriptor Richard Henderson
  2022-04-28 12:38 ` [PATCH 00/47] target/arm: Use tcg_constant Peter Maydell
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

In these cases, 't' did double-duty as zero source and
temporary destination.  Split the two uses and narrow
the scope of the temp.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-sve.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
index e812f910ce..82bf094447 100644
--- a/target/arm/translate-sve.c
+++ b/target/arm/translate-sve.c
@@ -3322,7 +3322,7 @@ static bool do_brk3(DisasContext *s, arg_rprr_s *a,
     TCGv_ptr n = tcg_temp_new_ptr();
     TCGv_ptr m = tcg_temp_new_ptr();
     TCGv_ptr g = tcg_temp_new_ptr();
-    TCGv_i32 t = tcg_const_i32(FIELD_DP32(0, PREDDESC, OPRSZ, vsz));
+    TCGv_i32 desc = tcg_constant_i32(FIELD_DP32(0, PREDDESC, OPRSZ, vsz));
 
     tcg_gen_addi_ptr(d, cpu_env, pred_full_reg_offset(s, a->rd));
     tcg_gen_addi_ptr(n, cpu_env, pred_full_reg_offset(s, a->rn));
@@ -3330,16 +3330,17 @@ static bool do_brk3(DisasContext *s, arg_rprr_s *a,
     tcg_gen_addi_ptr(g, cpu_env, pred_full_reg_offset(s, a->pg));
 
     if (a->s) {
-        fn_s(t, d, n, m, g, t);
+        TCGv_i32 t = tcg_temp_new_i32();
+        fn_s(t, d, n, m, g, desc);
         do_pred_flags(t);
+        tcg_temp_free_i32(t);
     } else {
-        fn(d, n, m, g, t);
+        fn(d, n, m, g, desc);
     }
     tcg_temp_free_ptr(d);
     tcg_temp_free_ptr(n);
     tcg_temp_free_ptr(m);
     tcg_temp_free_ptr(g);
-    tcg_temp_free_i32(t);
     return true;
 }
 
@@ -3356,22 +3357,23 @@ static bool do_brk2(DisasContext *s, arg_rpr_s *a,
     TCGv_ptr d = tcg_temp_new_ptr();
     TCGv_ptr n = tcg_temp_new_ptr();
     TCGv_ptr g = tcg_temp_new_ptr();
-    TCGv_i32 t = tcg_const_i32(FIELD_DP32(0, PREDDESC, OPRSZ, vsz));
+    TCGv_i32 desc = tcg_constant_i32(FIELD_DP32(0, PREDDESC, OPRSZ, vsz));
 
     tcg_gen_addi_ptr(d, cpu_env, pred_full_reg_offset(s, a->rd));
     tcg_gen_addi_ptr(n, cpu_env, pred_full_reg_offset(s, a->rn));
     tcg_gen_addi_ptr(g, cpu_env, pred_full_reg_offset(s, a->pg));
 
     if (a->s) {
-        fn_s(t, d, n, g, t);
+        TCGv_i32 t = tcg_temp_new_i32();
+        fn_s(t, d, n, g, desc);
         do_pred_flags(t);
+        tcg_temp_free_i32(t);
     } else {
-        fn(d, n, g, t);
+        fn(d, n, g, desc);
     }
     tcg_temp_free_ptr(d);
     tcg_temp_free_ptr(n);
     tcg_temp_free_ptr(g);
-    tcg_temp_free_i32(t);
     return true;
 }
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* [PATCH 47/47] target/arm: Use tcg_constant for vector descriptor
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (45 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 46/47] target/arm: Use tcg_constant for do_brk{2,3} Richard Henderson
@ 2022-04-26 16:30 ` Richard Henderson
  2022-04-28 10:54   ` Peter Maydell
  2022-04-28 12:38 ` [PATCH 00/47] target/arm: Use tcg_constant Peter Maydell
  47 siblings, 1 reply; 97+ messages in thread
From: Richard Henderson @ 2022-04-26 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/translate-sve.c | 54 ++++++++++----------------------------
 1 file changed, 14 insertions(+), 40 deletions(-)

diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
index 82bf094447..dd4a5b23ab 100644
--- a/target/arm/translate-sve.c
+++ b/target/arm/translate-sve.c
@@ -888,7 +888,7 @@ static bool do_vpz_ool(DisasContext *s, arg_rpr_esz *a,
         return true;
     }
 
-    desc = tcg_const_i32(simd_desc(vsz, vsz, 0));
+    desc = tcg_constant_i32(simd_desc(vsz, vsz, 0));
     temp = tcg_temp_new_i64();
     t_zn = tcg_temp_new_ptr();
     t_pg = tcg_temp_new_ptr();
@@ -898,7 +898,6 @@ static bool do_vpz_ool(DisasContext *s, arg_rpr_esz *a,
     fn(temp, t_zn, t_pg, desc);
     tcg_temp_free_ptr(t_zn);
     tcg_temp_free_ptr(t_pg);
-    tcg_temp_free_i32(desc);
 
     write_fp_dreg(s, a->rd, temp);
     tcg_temp_free_i64(temp);
@@ -1235,7 +1234,7 @@ static void do_index(DisasContext *s, int esz, int rd,
                      TCGv_i64 start, TCGv_i64 incr)
 {
     unsigned vsz = vec_full_reg_size(s);
-    TCGv_i32 desc = tcg_const_i32(simd_desc(vsz, vsz, 0));
+    TCGv_i32 desc = tcg_constant_i32(simd_desc(vsz, vsz, 0));
     TCGv_ptr t_zd = tcg_temp_new_ptr();
 
     tcg_gen_addi_ptr(t_zd, cpu_env, vec_full_reg_offset(s, rd));
@@ -1259,7 +1258,6 @@ static void do_index(DisasContext *s, int esz, int rd,
         tcg_temp_free_i32(i32);
     }
     tcg_temp_free_ptr(t_zd);
-    tcg_temp_free_i32(desc);
 }
 
 static bool trans_INDEX_ii(DisasContext *s, arg_INDEX_ii *a)
@@ -1988,7 +1986,7 @@ static void do_sat_addsub_vec(DisasContext *s, int esz, int rd, int rn,
     nptr = tcg_temp_new_ptr();
     tcg_gen_addi_ptr(dptr, cpu_env, vec_full_reg_offset(s, rd));
     tcg_gen_addi_ptr(nptr, cpu_env, vec_full_reg_offset(s, rn));
-    desc = tcg_const_i32(simd_desc(vsz, vsz, 0));
+    desc = tcg_constant_i32(simd_desc(vsz, vsz, 0));
 
     switch (esz) {
     case MO_8:
@@ -2057,7 +2055,6 @@ static void do_sat_addsub_vec(DisasContext *s, int esz, int rd, int rn,
 
     tcg_temp_free_ptr(dptr);
     tcg_temp_free_ptr(nptr);
-    tcg_temp_free_i32(desc);
 }
 
 static bool trans_CNT_r(DisasContext *s, arg_CNT_r *a)
@@ -2233,7 +2230,7 @@ static void do_cpy_m(DisasContext *s, int esz, int rd, int rn, int pg,
         gen_helper_sve_cpy_m_s, gen_helper_sve_cpy_m_d,
     };
     unsigned vsz = vec_full_reg_size(s);
-    TCGv_i32 desc = tcg_const_i32(simd_desc(vsz, vsz, 0));
+    TCGv_i32 desc = tcg_constant_i32(simd_desc(vsz, vsz, 0));
     TCGv_ptr t_zd = tcg_temp_new_ptr();
     TCGv_ptr t_zn = tcg_temp_new_ptr();
     TCGv_ptr t_pg = tcg_temp_new_ptr();
@@ -2247,7 +2244,6 @@ static void do_cpy_m(DisasContext *s, int esz, int rd, int rn, int pg,
     tcg_temp_free_ptr(t_zd);
     tcg_temp_free_ptr(t_zn);
     tcg_temp_free_ptr(t_pg);
-    tcg_temp_free_i32(desc);
 }
 
 static bool trans_FCPY(DisasContext *s, arg_FCPY *a)
@@ -2390,7 +2386,7 @@ static void do_insr_i64(DisasContext *s, arg_rrr_esz *a, TCGv_i64 val)
         gen_helper_sve_insr_s, gen_helper_sve_insr_d,
     };
     unsigned vsz = vec_full_reg_size(s);
-    TCGv_i32 desc = tcg_const_i32(simd_desc(vsz, vsz, 0));
+    TCGv_i32 desc = tcg_constant_i32(simd_desc(vsz, vsz, 0));
     TCGv_ptr t_zd = tcg_temp_new_ptr();
     TCGv_ptr t_zn = tcg_temp_new_ptr();
 
@@ -2401,7 +2397,6 @@ static void do_insr_i64(DisasContext *s, arg_rrr_esz *a, TCGv_i64 val)
 
     tcg_temp_free_ptr(t_zd);
     tcg_temp_free_ptr(t_zn);
-    tcg_temp_free_i32(desc);
 }
 
 static bool trans_INSR_f(DisasContext *s, arg_rrr_esz *a)
@@ -2520,7 +2515,6 @@ static bool do_perm_pred3(DisasContext *s, arg_rrr_esz *a, bool high_odd,
     TCGv_ptr t_d = tcg_temp_new_ptr();
     TCGv_ptr t_n = tcg_temp_new_ptr();
     TCGv_ptr t_m = tcg_temp_new_ptr();
-    TCGv_i32 t_desc;
     uint32_t desc = 0;
 
     desc = FIELD_DP32(desc, PREDDESC, OPRSZ, vsz);
@@ -2530,14 +2524,12 @@ static bool do_perm_pred3(DisasContext *s, arg_rrr_esz *a, bool high_odd,
     tcg_gen_addi_ptr(t_d, cpu_env, pred_full_reg_offset(s, a->rd));
     tcg_gen_addi_ptr(t_n, cpu_env, pred_full_reg_offset(s, a->rn));
     tcg_gen_addi_ptr(t_m, cpu_env, pred_full_reg_offset(s, a->rm));
-    t_desc = tcg_const_i32(desc);
 
-    fn(t_d, t_n, t_m, t_desc);
+    fn(t_d, t_n, t_m, tcg_constant_i32(desc));
 
     tcg_temp_free_ptr(t_d);
     tcg_temp_free_ptr(t_n);
     tcg_temp_free_ptr(t_m);
-    tcg_temp_free_i32(t_desc);
     return true;
 }
 
@@ -2551,7 +2543,6 @@ static bool do_perm_pred2(DisasContext *s, arg_rr_esz *a, bool high_odd,
     unsigned vsz = pred_full_reg_size(s);
     TCGv_ptr t_d = tcg_temp_new_ptr();
     TCGv_ptr t_n = tcg_temp_new_ptr();
-    TCGv_i32 t_desc;
     uint32_t desc = 0;
 
     tcg_gen_addi_ptr(t_d, cpu_env, pred_full_reg_offset(s, a->rd));
@@ -2560,11 +2551,9 @@ static bool do_perm_pred2(DisasContext *s, arg_rr_esz *a, bool high_odd,
     desc = FIELD_DP32(desc, PREDDESC, OPRSZ, vsz);
     desc = FIELD_DP32(desc, PREDDESC, ESZ, a->esz);
     desc = FIELD_DP32(desc, PREDDESC, DATA, high_odd);
-    t_desc = tcg_const_i32(desc);
 
-    fn(t_d, t_n, t_desc);
+    fn(t_d, t_n, tcg_constant_i32(desc));
 
-    tcg_temp_free_i32(t_desc);
     tcg_temp_free_ptr(t_d);
     tcg_temp_free_ptr(t_n);
     return true;
@@ -2766,18 +2755,15 @@ static void find_last_active(DisasContext *s, TCGv_i32 ret, int esz, int pg)
      * round up, as we do elsewhere, because we need the exact size.
      */
     TCGv_ptr t_p = tcg_temp_new_ptr();
-    TCGv_i32 t_desc;
     unsigned desc = 0;
 
     desc = FIELD_DP32(desc, PREDDESC, OPRSZ, pred_full_reg_size(s));
     desc = FIELD_DP32(desc, PREDDESC, ESZ, esz);
 
     tcg_gen_addi_ptr(t_p, cpu_env, pred_full_reg_offset(s, pg));
-    t_desc = tcg_const_i32(desc);
 
-    gen_helper_sve_last_active_element(ret, t_p, t_desc);
+    gen_helper_sve_last_active_element(ret, t_p, tcg_constant_i32(desc));
 
-    tcg_temp_free_i32(t_desc);
     tcg_temp_free_ptr(t_p);
 }
 
@@ -3442,19 +3428,16 @@ static void do_cntp(DisasContext *s, TCGv_i64 val, int esz, int pn, int pg)
         TCGv_ptr t_pn = tcg_temp_new_ptr();
         TCGv_ptr t_pg = tcg_temp_new_ptr();
         unsigned desc = 0;
-        TCGv_i32 t_desc;
 
         desc = FIELD_DP32(desc, PREDDESC, OPRSZ, psz);
         desc = FIELD_DP32(desc, PREDDESC, ESZ, esz);
 
         tcg_gen_addi_ptr(t_pn, cpu_env, pred_full_reg_offset(s, pn));
         tcg_gen_addi_ptr(t_pg, cpu_env, pred_full_reg_offset(s, pg));
-        t_desc = tcg_const_i32(desc);
 
-        gen_helper_sve_cntp(val, t_pn, t_pg, t_desc);
+        gen_helper_sve_cntp(val, t_pn, t_pg, tcg_constant_i32(desc));
         tcg_temp_free_ptr(t_pn);
         tcg_temp_free_ptr(t_pg);
-        tcg_temp_free_i32(t_desc);
     }
 }
 
@@ -4190,7 +4173,7 @@ static void do_reduce(DisasContext *s, arg_rpr_esz *a,
 {
     unsigned vsz = vec_full_reg_size(s);
     unsigned p2vsz = pow2ceil(vsz);
-    TCGv_i32 t_desc = tcg_const_i32(simd_desc(vsz, vsz, p2vsz));
+    TCGv_i32 t_desc = tcg_constant_i32(simd_desc(vsz, vsz, p2vsz));
     TCGv_ptr t_zn, t_pg, status;
     TCGv_i64 temp;
 
@@ -4206,7 +4189,6 @@ static void do_reduce(DisasContext *s, arg_rpr_esz *a,
     tcg_temp_free_ptr(t_zn);
     tcg_temp_free_ptr(t_pg);
     tcg_temp_free_ptr(status);
-    tcg_temp_free_i32(t_desc);
 
     write_fp_dreg(s, a->rd, temp);
     tcg_temp_free_i64(temp);
@@ -4383,11 +4365,10 @@ static bool trans_FADDA(DisasContext *s, arg_rprr_esz *a)
     tcg_gen_addi_ptr(t_rm, cpu_env, vec_full_reg_offset(s, a->rm));
     tcg_gen_addi_ptr(t_pg, cpu_env, pred_full_reg_offset(s, a->pg));
     t_fpst = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR);
-    t_desc = tcg_const_i32(simd_desc(vsz, vsz, 0));
+    t_desc = tcg_constant_i32(simd_desc(vsz, vsz, 0));
 
     fns[a->esz - 1](t_val, t_val, t_rm, t_pg, t_fpst, t_desc);
 
-    tcg_temp_free_i32(t_desc);
     tcg_temp_free_ptr(t_fpst);
     tcg_temp_free_ptr(t_pg);
     tcg_temp_free_ptr(t_rm);
@@ -4504,10 +4485,9 @@ static void do_fp_scalar(DisasContext *s, int zd, int zn, int pg, bool is_fp16,
     tcg_gen_addi_ptr(t_pg, cpu_env, pred_full_reg_offset(s, pg));
 
     status = fpstatus_ptr(is_fp16 ? FPST_FPCR_F16 : FPST_FPCR);
-    desc = tcg_const_i32(simd_desc(vsz, vsz, 0));
+    desc = tcg_constant_i32(simd_desc(vsz, vsz, 0));
     fn(t_zd, t_zn, t_pg, scalar, status, desc);
 
-    tcg_temp_free_i32(desc);
     tcg_temp_free_ptr(status);
     tcg_temp_free_ptr(t_pg);
     tcg_temp_free_ptr(t_zn);
@@ -5265,7 +5245,6 @@ static void do_mem_zpa(DisasContext *s, int zt, int pg, TCGv_i64 addr,
 {
     unsigned vsz = vec_full_reg_size(s);
     TCGv_ptr t_pg;
-    TCGv_i32 t_desc;
     int desc = 0;
 
     /*
@@ -5287,14 +5266,12 @@ static void do_mem_zpa(DisasContext *s, int zt, int pg, TCGv_i64 addr,
     }
 
     desc = simd_desc(vsz, vsz, zt | desc);
-    t_desc = tcg_const_i32(desc);
     t_pg = tcg_temp_new_ptr();
 
     tcg_gen_addi_ptr(t_pg, cpu_env, pred_full_reg_offset(s, pg));
-    fn(cpu_env, t_pg, addr, t_desc);
+    fn(cpu_env, t_pg, addr, tcg_constant_i32(desc));
 
     tcg_temp_free_ptr(t_pg);
-    tcg_temp_free_i32(t_desc);
 }
 
 /* Indexed by [mte][be][dtype][nreg] */
@@ -6037,7 +6014,6 @@ static void do_mem_zpz(DisasContext *s, int zt, int pg, int zm,
     TCGv_ptr t_zm = tcg_temp_new_ptr();
     TCGv_ptr t_pg = tcg_temp_new_ptr();
     TCGv_ptr t_zt = tcg_temp_new_ptr();
-    TCGv_i32 t_desc;
     int desc = 0;
 
     if (s->mte_active[0]) {
@@ -6049,17 +6025,15 @@ static void do_mem_zpz(DisasContext *s, int zt, int pg, int zm,
         desc <<= SVE_MTEDESC_SHIFT;
     }
     desc = simd_desc(vsz, vsz, desc | scale);
-    t_desc = tcg_const_i32(desc);
 
     tcg_gen_addi_ptr(t_pg, cpu_env, pred_full_reg_offset(s, pg));
     tcg_gen_addi_ptr(t_zm, cpu_env, vec_full_reg_offset(s, zm));
     tcg_gen_addi_ptr(t_zt, cpu_env, vec_full_reg_offset(s, zt));
-    fn(cpu_env, t_zt, t_pg, t_zm, scalar, t_desc);
+    fn(cpu_env, t_zt, t_pg, t_zm, scalar, tcg_constant_i32(desc));
 
     tcg_temp_free_ptr(t_zt);
     tcg_temp_free_ptr(t_zm);
     tcg_temp_free_ptr(t_pg);
-    tcg_temp_free_i32(t_desc);
 }
 
 /* Indexed by [mte][be][ff][xs][u][msz].  */
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 97+ messages in thread

* Re: [PATCH 01/47] target/arm: Use tcg_constant in gen_probe_access
  2022-04-26 16:29 ` [PATCH 01/47] target/arm: Use tcg_constant in gen_probe_access Richard Henderson
@ 2022-04-28  9:36   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28  9:36 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:33, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate-a64.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 02/47] target/arm: Use tcg_constant in gen_mte_check*
  2022-04-26 16:29 ` [PATCH 02/47] target/arm: Use tcg_constant in gen_mte_check* Richard Henderson
@ 2022-04-28  9:36   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28  9:36 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:32, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate-a64.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 03/47] target/arm: Use tcg_constant in gen_exception*
  2022-04-26 16:29 ` [PATCH 03/47] target/arm: Use tcg_constant in gen_exception* Richard Henderson
@ 2022-04-28  9:37   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28  9:37 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:32, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate-a64.c | 11 ++---------
>  1 file changed, 2 insertions(+), 9 deletions(-)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 04/47] target/arm: Use tcg_constant in gen_adc_CC
  2022-04-26 16:30 ` [PATCH 04/47] target/arm: Use tcg_constant in gen_adc_CC Richard Henderson
@ 2022-04-28  9:39   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28  9:39 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:40, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Note that tmp was doing double-duty as zero
> and then later as a temporary in its own right.
> Split the use of 0 to a new variable 'zero'.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate-a64.c | 26 +++++++++++++-------------
>  1 file changed, 13 insertions(+), 13 deletions(-)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 05/47] target/arm: Use tcg_constant in handle_msr_i
  2022-04-26 16:30 ` [PATCH 05/47] target/arm: Use tcg_constant in handle_msr_i Richard Henderson
@ 2022-04-28  9:39   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28  9:39 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:37, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate-a64.c | 13 +++----------
>  1 file changed, 3 insertions(+), 10 deletions(-)


Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 06/47] target/arm: Use tcg_constant in handle_sys
  2022-04-26 16:30 ` [PATCH 06/47] target/arm: Use tcg_constant in handle_sys Richard Henderson
@ 2022-04-28  9:41   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28  9:41 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:37, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate-a64.c | 31 +++++++++----------------------
>  1 file changed, 9 insertions(+), 22 deletions(-)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 07/47] target/arm: Use tcg_constant in disas_exc
  2022-04-26 16:30 ` [PATCH 07/47] target/arm: Use tcg_constant in disas_exc Richard Henderson
@ 2022-04-28  9:41   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28  9:41 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:32, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate-a64.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 08/47] target/arm: Use tcg_constant in gen_compare_and_swap_pair
  2022-04-26 16:30 ` [PATCH 08/47] target/arm: Use tcg_constant in gen_compare_and_swap_pair Richard Henderson
@ 2022-04-28  9:43   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28  9:43 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:44, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate-a64.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 09/47] target/arm: Use tcg_constant in disas_ld_lit
  2022-04-26 16:30 ` [PATCH 09/47] target/arm: Use tcg_constant in disas_ld_lit Richard Henderson
@ 2022-04-28  9:45   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28  9:45 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:38, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate-a64.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 10/47] target/arm: Use tcg_constant in disas_ldst_*
  2022-04-26 16:30 ` [PATCH 10/47] target/arm: Use tcg_constant in disas_ldst_* Richard Henderson
@ 2022-04-28  9:45   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28  9:45 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:41, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 11/47] target/arm: Use tcg_constant in disas_add_sum_imm*
  2022-04-26 16:30 ` [PATCH 11/47] target/arm: Use tcg_constant in disas_add_sum_imm* Richard Henderson
@ 2022-04-28  9:59   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28  9:59 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:37, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate-a64.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 12/47] target/arm: Use tcg_constant in disas_movw_imm
  2022-04-26 16:30 ` [PATCH 12/47] target/arm: Use tcg_constant in disas_movw_imm Richard Henderson
@ 2022-04-28  9:59   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28  9:59 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:40, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate-a64.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 13/47] target/arm: Use tcg_constant in shift_reg_imm
  2022-04-26 16:30 ` [PATCH 13/47] target/arm: Use tcg_constant in shift_reg_imm Richard Henderson
@ 2022-04-28  9:59   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28  9:59 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:34, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate-a64.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 14/47] target/arm: Use tcg_constant in disas_cond_select
  2022-04-26 16:30 ` [PATCH 14/47] target/arm: Use tcg_constant in disas_cond_select Richard Henderson
@ 2022-04-28 10:00   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 10:00 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:46, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate-a64.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 15/47] target/arm: Use tcg_constant in handle_{rev16, crc32}
  2022-04-26 16:30 ` [PATCH 15/47] target/arm: Use tcg_constant in handle_{rev16,crc32} Richard Henderson
@ 2022-04-28 10:00   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 10:00 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:48, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate-a64.c | 7 ++-----

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 16/47] target/arm: Use tcg_constant in disas_data_proc_2src
  2022-04-26 16:30 ` [PATCH 16/47] target/arm: Use tcg_constant in disas_data_proc_2src Richard Henderson
@ 2022-04-28 10:01   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 10:01 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:43, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Existing temp usage treats t1 as both zero and as a
> temporary.  Rearrange to only require one temporary,
> so remove t1 and rename t2.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate-a64.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 17/47] target/arm: Use tcg_constant in disas_fp*
  2022-04-26 16:30 ` [PATCH 17/47] target/arm: Use tcg_constant in disas_fp* Richard Henderson
@ 2022-04-28 10:06   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 10:06 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:40, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate-a64.c | 24 +++++++-----------------
>  1 file changed, 7 insertions(+), 17 deletions(-)

> @@ -6052,7 +6049,7 @@ static void disas_fp_ccomp(DisasContext *s, uint32_t insn)
>  static void disas_fp_csel(DisasContext *s, uint32_t insn)
>  {
>      unsigned int mos, type, rm, cond, rn, rd;
> -    TCGv_i64 t_true, t_false, t_zero;
> +    TCGv_i64 t_true, t_false;
>      DisasCompare64 c;
>      MemOp sz;
>
> @@ -6097,10 +6094,8 @@ static void disas_fp_csel(DisasContext *s, uint32_t insn)
>      read_vec_element(s, t_false, rm, 0, sz);
>
>      a64_test_cc(&c, cond);
> -    t_zero = tcg_const_i64(0);
> -    tcg_gen_movcond_i64(c.cond, t_true, c.value, t_zero, t_true, t_false);
> -    tcg_temp_free_i64(t_zero);
> -    tcg_temp_free_i64(t_false);
> +    tcg_gen_movcond_i64(c.cond, t_true, c.value, tcg_constant_i64(0),
> +                        t_true, t_false);
>      a64_free_cc(&c);
>
>      /* Note that sregs & hregs write back zeros to the high bits,

This incorrectly drops the free of t_false, which isn't a
tcg_constant_*.

Otherwise
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 18/47] target/arm: Use tcg_constant in simd shift expanders
  2022-04-26 16:30 ` [PATCH 18/47] target/arm: Use tcg_constant in simd shift expanders Richard Henderson
@ 2022-04-28 10:09   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 10:09 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:44, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate-a64.c | 21 +++++----------------
>  1 file changed, 5 insertions(+), 16 deletions(-)
>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 19/47] target/arm: Use tcg_constant in simd fp/int conversion
  2022-04-26 16:30 ` [PATCH 19/47] target/arm: Use tcg_constant in simd fp/int conversion Richard Henderson
@ 2022-04-28 10:10   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 10:10 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:43, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate-a64.c | 26 ++++++--------------------
>  1 file changed, 6 insertions(+), 20 deletions(-)
>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 20/47] target/arm: Use tcg_constant in 2misc expanders
  2022-04-26 16:30 ` [PATCH 20/47] target/arm: Use tcg_constant in 2misc expanders Richard Henderson
@ 2022-04-28 10:11   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 10:11 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:49, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate-a64.c | 40 ++++++++++----------------------------
>  1 file changed, 10 insertions(+), 30 deletions(-)
>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 21/47] target/arm: Use tcg_constant in balance of translate-a64.c
  2022-04-26 16:30 ` [PATCH 21/47] target/arm: Use tcg_constant in balance of translate-a64.c Richard Henderson
@ 2022-04-28 10:12   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 10:12 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:47, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Finish conversion of the file to tcg_constant_*.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate-a64.c | 20 ++++++++------------
>  1 file changed, 8 insertions(+), 12 deletions(-)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 22/47] target/arm: Use tcg_constant for aa32 exceptions
  2022-04-26 16:30 ` [PATCH 22/47] target/arm: Use tcg_constant for aa32 exceptions Richard Henderson
@ 2022-04-28 10:21   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 10:21 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:49, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 23/47] target/arm: Use tcg_constant for disas_iwmmxt_insn
  2022-04-26 16:30 ` [PATCH 23/47] target/arm: Use tcg_constant for disas_iwmmxt_insn Richard Henderson
@ 2022-04-28 10:23   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 10:23 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:46, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate.c | 25 ++++++++++---------------
>  1 file changed, 10 insertions(+), 15 deletions(-)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 24/47] target/arm: Use tcg_constant for gen_{msr,mrs}
  2022-04-26 16:30 ` [PATCH 24/47] target/arm: Use tcg_constant for gen_{msr,mrs} Richard Henderson
@ 2022-04-28 10:24   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 10:24 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:57, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate.c | 22 +++++++++-------------
>  1 file changed, 9 insertions(+), 13 deletions(-)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 25/47] target/arm: Use tcg_constant for vector shift expanders
  2022-04-26 16:30 ` [PATCH 25/47] target/arm: Use tcg_constant for vector shift expanders Richard Henderson
@ 2022-04-28 10:25   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 10:25 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:50, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 26/47] target/arm: Use tcg_constant for do_coproc_insn
  2022-04-26 16:30 ` [PATCH 26/47] target/arm: Use tcg_constant for do_coproc_insn Richard Henderson
@ 2022-04-28 10:27   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 10:27 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 18:00, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate.c | 43 +++++++++++++-----------------------------
>  1 file changed, 13 insertions(+), 30 deletions(-)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 27/47] target/arm: Use tcg_constant for gen_srs
  2022-04-26 16:30 ` [PATCH 27/47] target/arm: Use tcg_constant for gen_srs Richard Henderson
@ 2022-04-28 10:29   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 10:29 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:43, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 28/47] target/arm: Use tcg_constant for op_s_{rri, rxi}_rot
  2022-04-26 16:30 ` [PATCH 28/47] target/arm: Use tcg_constant for op_s_{rri,rxi}_rot Richard Henderson
@ 2022-04-28 10:29   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 10:29 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:52, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 29/47] target/arm: Use tcg_constant for MOVW, UMAAL, CRC32
  2022-04-26 16:30 ` [PATCH 29/47] target/arm: Use tcg_constant for MOVW, UMAAL, CRC32 Richard Henderson
@ 2022-04-28 10:30   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 10:30 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 18:05, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate.c | 11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)
>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 30/47] target/arm: Use tcg_constant for v7m MRS, MSR
  2022-04-26 16:30 ` [PATCH 30/47] target/arm: Use tcg_constant for v7m MRS, MSR Richard Henderson
@ 2022-04-28 10:31   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 10:31 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 18:05, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 31/47] target/arm: Use tcg_constant for TT, SAT, SMMLA
  2022-04-26 16:30 ` [PATCH 31/47] target/arm: Use tcg_constant for TT, SAT, SMMLA Richard Henderson
@ 2022-04-28 10:37   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 10:37 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:56, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate.c | 14 +++++---------
>  1 file changed, 5 insertions(+), 9 deletions(-)
>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 32/47] target/arm: Use tcg_constant in LDM, STM
  2022-04-26 16:30 ` [PATCH 32/47] target/arm: Use tcg_constant in LDM, STM Richard Henderson
@ 2022-04-28 10:37   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 10:37 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:46, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 33/47] target/arm: Use tcg_constant in CLRM, DLS, WLS, LE
  2022-04-26 16:30 ` [PATCH 33/47] target/arm: Use tcg_constant in CLRM, DLS, WLS, LE Richard Henderson
@ 2022-04-28 10:38   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 10:38 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:46, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 34/47] target/arm: Use tcg_constant in trans_CPS_v7m
  2022-04-26 16:30 ` [PATCH 34/47] target/arm: Use tcg_constant in trans_CPS_v7m Richard Henderson
@ 2022-04-28 10:39   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 10:39 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 18:07, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 35/47] target/arm: Use tcg_constant in trans_CSEL
  2022-04-26 16:30 ` [PATCH 35/47] target/arm: Use tcg_constant in trans_CSEL Richard Henderson
@ 2022-04-28 10:39   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 10:39 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:52, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 36/47] target/arm: Use tcg_constant for trans_INDEX_*
  2022-04-26 16:30 ` [PATCH 36/47] target/arm: Use tcg_constant for trans_INDEX_* Richard Henderson
@ 2022-04-28 10:40   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 10:40 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:59, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate-sve.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 37/47] target/arm: Use tcg_constant in SINCDEC, INCDEC
  2022-04-26 16:30 ` [PATCH 37/47] target/arm: Use tcg_constant in SINCDEC, INCDEC Richard Henderson
@ 2022-04-28 10:41   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 10:41 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:56, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 38/47] target/arm: Use tcg_constant in FCPY, CPY
  2022-04-26 16:30 ` [PATCH 38/47] target/arm: Use tcg_constant in FCPY, CPY Richard Henderson
@ 2022-04-28 10:41   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 10:41 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 18:04, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate-sve.c | 13 ++++---------
>  1 file changed, 4 insertions(+), 9 deletions(-)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 39/47] target/arm: Use tcg_constant in {incr, wrap}_last_active
  2022-04-26 16:30 ` [PATCH 39/47] target/arm: Use tcg_constant in {incr, wrap}_last_active Richard Henderson
@ 2022-04-28 10:42   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 10:42 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:48, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate-sve.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 40/47] target/arm: Use tcg_constant in do_clast_scalar
  2022-04-26 16:30 ` [PATCH 40/47] target/arm: Use tcg_constant in do_clast_scalar Richard Henderson
@ 2022-04-28 10:42   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 10:42 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 18:07, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate-sve.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 41/47] target/arm: Use tcg_constant in WHILE
  2022-04-26 16:30 ` [PATCH 41/47] target/arm: Use tcg_constant in WHILE Richard Henderson
@ 2022-04-28 10:46   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 10:46 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 18:00, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 42/47] target/arm: Use tcg_constant in LD1, ST1
  2022-04-26 16:30 ` [PATCH 42/47] target/arm: Use tcg_constant in LD1, ST1 Richard Henderson
@ 2022-04-28 10:46   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 10:46 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 18:18, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 43/47] target/arm: Use tcg_constant in SUBR
  2022-04-26 16:30 ` [PATCH 43/47] target/arm: Use tcg_constant in SUBR Richard Henderson
@ 2022-04-28 10:47   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 10:47 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 18:12, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate-sve.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 44/47] target/arm: Use tcg_constant in do_zzi_{sat, ool}, do_fp_imm
  2022-04-26 16:30 ` [PATCH 44/47] target/arm: Use tcg_constant in do_zzi_{sat, ool}, do_fp_imm Richard Henderson
@ 2022-04-28 10:48   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 10:48 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 18:04, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate-sve.c | 15 +++++----------
>  1 file changed, 5 insertions(+), 10 deletions(-)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 45/47] target/arm: Use tcg_constant for predicate descriptors
  2022-04-26 16:30 ` [PATCH 45/47] target/arm: Use tcg_constant for predicate descriptors Richard Henderson
@ 2022-04-28 10:49   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 10:49 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 18:16, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> In these cases, 't' did double-duty as zero source and
> temporary destination.  Split the two uses.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 46/47] target/arm: Use tcg_constant for do_brk{2,3}
  2022-04-26 16:30 ` [PATCH 46/47] target/arm: Use tcg_constant for do_brk{2,3} Richard Henderson
@ 2022-04-28 10:52   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 10:52 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 18:19, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> In these cases, 't' did double-duty as zero source and
> temporary destination.  Split the two uses and narrow
> the scope of the temp.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 47/47] target/arm: Use tcg_constant for vector descriptor
  2022-04-26 16:30 ` [PATCH 47/47] target/arm: Use tcg_constant for vector descriptor Richard Henderson
@ 2022-04-28 10:54   ` Peter Maydell
  0 siblings, 0 replies; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 10:54 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 18:19, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/translate-sve.c | 54 ++++++++++----------------------------
>  1 file changed, 14 insertions(+), 40 deletions(-)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 00/47] target/arm: Use tcg_constant
  2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
                   ` (46 preceding siblings ...)
  2022-04-26 16:30 ` [PATCH 47/47] target/arm: Use tcg_constant for vector descriptor Richard Henderson
@ 2022-04-28 12:38 ` Peter Maydell
  2022-04-28 15:20   ` Richard Henderson
  47 siblings, 1 reply; 97+ messages in thread
From: Peter Maydell @ 2022-04-28 12:38 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-arm, qemu-devel

On Tue, 26 Apr 2022 at 17:33, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Split the tcg_constant patches out of my larger v3 cleanups
> patch set, and then split the 5 patches into tiny bites.

Since there was only one issue with this patchset (in patch 17),
I'm going to fix that and apply this series to target-arm.next.

thanks
-- PMM


^ permalink raw reply	[flat|nested] 97+ messages in thread

* Re: [PATCH 00/47] target/arm: Use tcg_constant
  2022-04-28 12:38 ` [PATCH 00/47] target/arm: Use tcg_constant Peter Maydell
@ 2022-04-28 15:20   ` Richard Henderson
  0 siblings, 0 replies; 97+ messages in thread
From: Richard Henderson @ 2022-04-28 15:20 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-arm, qemu-devel

On 4/28/22 05:38, Peter Maydell wrote:
> On Tue, 26 Apr 2022 at 17:33, Richard Henderson
> <richard.henderson@linaro.org> wrote:
>>
>> Split the tcg_constant patches out of my larger v3 cleanups
>> patch set, and then split the 5 patches into tiny bites.
> 
> Since there was only one issue with this patchset (in patch 17),
> I'm going to fix that and apply this series to target-arm.next.

Thanks for the careful eye.


r~


^ permalink raw reply	[flat|nested] 97+ messages in thread

end of thread, other threads:[~2022-04-28 16:20 UTC | newest]

Thread overview: 97+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-26 16:29 [PATCH 00/47] target/arm: Use tcg_constant Richard Henderson
2022-04-26 16:29 ` [PATCH 01/47] target/arm: Use tcg_constant in gen_probe_access Richard Henderson
2022-04-28  9:36   ` Peter Maydell
2022-04-26 16:29 ` [PATCH 02/47] target/arm: Use tcg_constant in gen_mte_check* Richard Henderson
2022-04-28  9:36   ` Peter Maydell
2022-04-26 16:29 ` [PATCH 03/47] target/arm: Use tcg_constant in gen_exception* Richard Henderson
2022-04-28  9:37   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 04/47] target/arm: Use tcg_constant in gen_adc_CC Richard Henderson
2022-04-28  9:39   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 05/47] target/arm: Use tcg_constant in handle_msr_i Richard Henderson
2022-04-28  9:39   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 06/47] target/arm: Use tcg_constant in handle_sys Richard Henderson
2022-04-28  9:41   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 07/47] target/arm: Use tcg_constant in disas_exc Richard Henderson
2022-04-28  9:41   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 08/47] target/arm: Use tcg_constant in gen_compare_and_swap_pair Richard Henderson
2022-04-28  9:43   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 09/47] target/arm: Use tcg_constant in disas_ld_lit Richard Henderson
2022-04-28  9:45   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 10/47] target/arm: Use tcg_constant in disas_ldst_* Richard Henderson
2022-04-28  9:45   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 11/47] target/arm: Use tcg_constant in disas_add_sum_imm* Richard Henderson
2022-04-28  9:59   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 12/47] target/arm: Use tcg_constant in disas_movw_imm Richard Henderson
2022-04-28  9:59   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 13/47] target/arm: Use tcg_constant in shift_reg_imm Richard Henderson
2022-04-28  9:59   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 14/47] target/arm: Use tcg_constant in disas_cond_select Richard Henderson
2022-04-28 10:00   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 15/47] target/arm: Use tcg_constant in handle_{rev16,crc32} Richard Henderson
2022-04-28 10:00   ` [PATCH 15/47] target/arm: Use tcg_constant in handle_{rev16, crc32} Peter Maydell
2022-04-26 16:30 ` [PATCH 16/47] target/arm: Use tcg_constant in disas_data_proc_2src Richard Henderson
2022-04-28 10:01   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 17/47] target/arm: Use tcg_constant in disas_fp* Richard Henderson
2022-04-28 10:06   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 18/47] target/arm: Use tcg_constant in simd shift expanders Richard Henderson
2022-04-28 10:09   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 19/47] target/arm: Use tcg_constant in simd fp/int conversion Richard Henderson
2022-04-28 10:10   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 20/47] target/arm: Use tcg_constant in 2misc expanders Richard Henderson
2022-04-28 10:11   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 21/47] target/arm: Use tcg_constant in balance of translate-a64.c Richard Henderson
2022-04-28 10:12   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 22/47] target/arm: Use tcg_constant for aa32 exceptions Richard Henderson
2022-04-28 10:21   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 23/47] target/arm: Use tcg_constant for disas_iwmmxt_insn Richard Henderson
2022-04-28 10:23   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 24/47] target/arm: Use tcg_constant for gen_{msr,mrs} Richard Henderson
2022-04-28 10:24   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 25/47] target/arm: Use tcg_constant for vector shift expanders Richard Henderson
2022-04-28 10:25   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 26/47] target/arm: Use tcg_constant for do_coproc_insn Richard Henderson
2022-04-28 10:27   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 27/47] target/arm: Use tcg_constant for gen_srs Richard Henderson
2022-04-28 10:29   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 28/47] target/arm: Use tcg_constant for op_s_{rri,rxi}_rot Richard Henderson
2022-04-28 10:29   ` [PATCH 28/47] target/arm: Use tcg_constant for op_s_{rri, rxi}_rot Peter Maydell
2022-04-26 16:30 ` [PATCH 29/47] target/arm: Use tcg_constant for MOVW, UMAAL, CRC32 Richard Henderson
2022-04-28 10:30   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 30/47] target/arm: Use tcg_constant for v7m MRS, MSR Richard Henderson
2022-04-28 10:31   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 31/47] target/arm: Use tcg_constant for TT, SAT, SMMLA Richard Henderson
2022-04-28 10:37   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 32/47] target/arm: Use tcg_constant in LDM, STM Richard Henderson
2022-04-28 10:37   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 33/47] target/arm: Use tcg_constant in CLRM, DLS, WLS, LE Richard Henderson
2022-04-28 10:38   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 34/47] target/arm: Use tcg_constant in trans_CPS_v7m Richard Henderson
2022-04-28 10:39   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 35/47] target/arm: Use tcg_constant in trans_CSEL Richard Henderson
2022-04-28 10:39   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 36/47] target/arm: Use tcg_constant for trans_INDEX_* Richard Henderson
2022-04-28 10:40   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 37/47] target/arm: Use tcg_constant in SINCDEC, INCDEC Richard Henderson
2022-04-28 10:41   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 38/47] target/arm: Use tcg_constant in FCPY, CPY Richard Henderson
2022-04-28 10:41   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 39/47] target/arm: Use tcg_constant in {incr, wrap}_last_active Richard Henderson
2022-04-28 10:42   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 40/47] target/arm: Use tcg_constant in do_clast_scalar Richard Henderson
2022-04-28 10:42   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 41/47] target/arm: Use tcg_constant in WHILE Richard Henderson
2022-04-28 10:46   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 42/47] target/arm: Use tcg_constant in LD1, ST1 Richard Henderson
2022-04-28 10:46   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 43/47] target/arm: Use tcg_constant in SUBR Richard Henderson
2022-04-28 10:47   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 44/47] target/arm: Use tcg_constant in do_zzi_{sat, ool}, do_fp_imm Richard Henderson
2022-04-28 10:48   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 45/47] target/arm: Use tcg_constant for predicate descriptors Richard Henderson
2022-04-28 10:49   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 46/47] target/arm: Use tcg_constant for do_brk{2,3} Richard Henderson
2022-04-28 10:52   ` Peter Maydell
2022-04-26 16:30 ` [PATCH 47/47] target/arm: Use tcg_constant for vector descriptor Richard Henderson
2022-04-28 10:54   ` Peter Maydell
2022-04-28 12:38 ` [PATCH 00/47] target/arm: Use tcg_constant Peter Maydell
2022-04-28 15:20   ` Richard Henderson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.