[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 19/47] target/arm: Use tcg_constant in simd fp/int conversion
From: |
Richard Henderson |
Subject: |
[PATCH 19/47] target/arm: Use tcg_constant in simd fp/int conversion |
Date: |
Tue, 26 Apr 2022 09:30:15 -0700 |
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
- [PATCH 07/47] target/arm: Use tcg_constant in disas_exc, (continued)
- [PATCH 07/47] target/arm: Use tcg_constant in disas_exc, Richard Henderson, 2022/04/26
- [PATCH 02/47] target/arm: Use tcg_constant in gen_mte_check*, Richard Henderson, 2022/04/26
- [PATCH 04/47] target/arm: Use tcg_constant in gen_adc_CC, Richard Henderson, 2022/04/26
- [PATCH 14/47] target/arm: Use tcg_constant in disas_cond_select, Richard Henderson, 2022/04/26
- [PATCH 11/47] target/arm: Use tcg_constant in disas_add_sum_imm*, Richard Henderson, 2022/04/26
- [PATCH 19/47] target/arm: Use tcg_constant in simd fp/int conversion,
Richard Henderson <=
- [PATCH 18/47] target/arm: Use tcg_constant in simd shift expanders, Richard Henderson, 2022/04/26
- [PATCH 06/47] target/arm: Use tcg_constant in handle_sys, Richard Henderson, 2022/04/26
- [PATCH 09/47] target/arm: Use tcg_constant in disas_ld_lit, Richard Henderson, 2022/04/26
- [PATCH 03/47] target/arm: Use tcg_constant in gen_exception*, Richard Henderson, 2022/04/26
- [PATCH 01/47] target/arm: Use tcg_constant in gen_probe_access, Richard Henderson, 2022/04/26