All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Subject: [PULL 47/54] target/arm: Use tcg_constant for vector descriptor
Date: Thu, 28 Apr 2022 15:39:51 +0100	[thread overview]
Message-ID: <20220428143958.2451229-48-peter.maydell@linaro.org> (raw)
In-Reply-To: <20220428143958.2451229-1-peter.maydell@linaro.org>

From: Richard Henderson <richard.henderson@linaro.org>

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20220426163043.100432-48-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@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 82bf094447b..dd4a5b23ab6 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.25.1



  parent reply	other threads:[~2022-04-28 15:50 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-28 14:39 [PULL 00/54] target-arm queue Peter Maydell
2022-04-28 14:39 ` [PULL 01/54] target/arm: Use tcg_constant in gen_probe_access Peter Maydell
2022-04-28 14:39 ` [PULL 02/54] target/arm: Use tcg_constant in gen_mte_check* Peter Maydell
2022-04-28 14:39 ` [PULL 03/54] target/arm: Use tcg_constant in gen_exception* Peter Maydell
2022-04-28 14:39 ` [PULL 04/54] target/arm: Use tcg_constant in gen_adc_CC Peter Maydell
2022-04-28 14:39 ` [PULL 05/54] target/arm: Use tcg_constant in handle_msr_i Peter Maydell
2022-04-28 14:39 ` [PULL 06/54] target/arm: Use tcg_constant in handle_sys Peter Maydell
2022-04-28 14:39 ` [PULL 07/54] target/arm: Use tcg_constant in disas_exc Peter Maydell
2022-04-28 14:39 ` [PULL 08/54] target/arm: Use tcg_constant in gen_compare_and_swap_pair Peter Maydell
2022-04-28 14:39 ` [PULL 09/54] target/arm: Use tcg_constant in disas_ld_lit Peter Maydell
2022-04-28 14:39 ` [PULL 10/54] target/arm: Use tcg_constant in disas_ldst_* Peter Maydell
2022-04-28 14:39 ` [PULL 11/54] target/arm: Use tcg_constant in disas_add_sum_imm* Peter Maydell
2022-04-28 14:39 ` [PULL 12/54] target/arm: Use tcg_constant in disas_movw_imm Peter Maydell
2022-04-28 14:39 ` [PULL 13/54] target/arm: Use tcg_constant in shift_reg_imm Peter Maydell
2022-04-28 14:39 ` [PULL 14/54] target/arm: Use tcg_constant in disas_cond_select Peter Maydell
2022-04-28 14:39 ` [PULL 15/54] target/arm: Use tcg_constant in handle_{rev16,crc32} Peter Maydell
2022-04-28 14:39 ` [PULL 16/54] target/arm: Use tcg_constant in disas_data_proc_2src Peter Maydell
2022-04-28 14:39 ` [PULL 17/54] target/arm: Use tcg_constant in disas_fp* Peter Maydell
2022-04-28 14:39 ` [PULL 18/54] target/arm: Use tcg_constant in simd shift expanders Peter Maydell
2022-04-28 14:39 ` [PULL 19/54] target/arm: Use tcg_constant in simd fp/int conversion Peter Maydell
2022-04-28 14:39 ` [PULL 20/54] target/arm: Use tcg_constant in 2misc expanders Peter Maydell
2022-04-28 14:39 ` [PULL 21/54] target/arm: Use tcg_constant in balance of translate-a64.c Peter Maydell
2022-04-28 14:39 ` [PULL 22/54] target/arm: Use tcg_constant for aa32 exceptions Peter Maydell
2022-04-28 14:39 ` [PULL 23/54] target/arm: Use tcg_constant for disas_iwmmxt_insn Peter Maydell
2022-04-28 14:39 ` [PULL 24/54] target/arm: Use tcg_constant for gen_{msr,mrs} Peter Maydell
2022-04-28 14:39 ` [PULL 25/54] target/arm: Use tcg_constant for vector shift expanders Peter Maydell
2022-04-28 14:39 ` [PULL 26/54] target/arm: Use tcg_constant for do_coproc_insn Peter Maydell
2022-04-28 14:39 ` [PULL 27/54] target/arm: Use tcg_constant for gen_srs Peter Maydell
2022-04-28 14:39 ` [PULL 28/54] target/arm: Use tcg_constant for op_s_{rri,rxi}_rot Peter Maydell
2022-04-28 14:39 ` [PULL 29/54] target/arm: Use tcg_constant for MOVW, UMAAL, CRC32 Peter Maydell
2022-04-28 14:39 ` [PULL 30/54] target/arm: Use tcg_constant for v7m MRS, MSR Peter Maydell
2022-04-28 14:39 ` [PULL 31/54] target/arm: Use tcg_constant for TT, SAT, SMMLA Peter Maydell
2022-04-28 14:39 ` [PULL 32/54] target/arm: Use tcg_constant in LDM, STM Peter Maydell
2022-04-28 14:39 ` [PULL 33/54] target/arm: Use tcg_constant in CLRM, DLS, WLS, LE Peter Maydell
2022-04-28 14:39 ` [PULL 34/54] target/arm: Use tcg_constant in trans_CPS_v7m Peter Maydell
2022-04-28 14:39 ` [PULL 35/54] target/arm: Use tcg_constant in trans_CSEL Peter Maydell
2022-04-28 14:39 ` [PULL 36/54] target/arm: Use tcg_constant for trans_INDEX_* Peter Maydell
2022-04-28 14:39 ` [PULL 37/54] target/arm: Use tcg_constant in SINCDEC, INCDEC Peter Maydell
2022-04-28 14:39 ` [PULL 38/54] target/arm: Use tcg_constant in FCPY, CPY Peter Maydell
2022-04-28 14:39 ` [PULL 39/54] target/arm: Use tcg_constant in {incr, wrap}_last_active Peter Maydell
2022-04-28 14:39 ` [PULL 40/54] target/arm: Use tcg_constant in do_clast_scalar Peter Maydell
2022-04-28 14:39 ` [PULL 41/54] target/arm: Use tcg_constant in WHILE Peter Maydell
2022-04-28 14:39 ` [PULL 42/54] target/arm: Use tcg_constant in LD1, ST1 Peter Maydell
2022-04-28 14:39 ` [PULL 43/54] target/arm: Use tcg_constant in SUBR Peter Maydell
2022-04-28 14:39 ` [PULL 44/54] target/arm: Use tcg_constant in do_zzi_{sat, ool}, do_fp_imm Peter Maydell
2022-04-28 14:39 ` [PULL 45/54] target/arm: Use tcg_constant for predicate descriptors Peter Maydell
2022-04-28 14:39 ` [PULL 46/54] target/arm: Use tcg_constant for do_brk{2,3} Peter Maydell
2022-04-28 14:39 ` Peter Maydell [this message]
2022-04-28 14:39 ` [PULL 48/54] target/arm: Disable cryptographic instructions when neon is disabled Peter Maydell
2022-04-28 14:39 ` [PULL 49/54] target/arm: Use field names for accessing DBGWCRn Peter Maydell
2022-04-28 14:39 ` [PULL 50/54] hw/arm/smmuv3: Cache event fault record Peter Maydell
2022-04-28 14:39 ` [PULL 51/54] hw/arm/smmuv3: Add space in guest error message Peter Maydell
2022-04-28 14:39 ` [PULL 52/54] target/arm: Advertise support for FEAT_TTL Peter Maydell
2022-04-28 14:39 ` [PULL 53/54] target/arm: Advertise support for FEAT_BBM level 2 Peter Maydell
2022-04-28 14:39 ` [PULL 54/54] hw/arm/smmuv3: Advertise support for SMMUv3.2-BBML2 Peter Maydell
2022-04-28 17:10 ` [PULL 00/54] target-arm queue Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220428143958.2451229-48-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.