[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 10/25] target/arm: Avoid tcg_const_ptr in handle_vec_simd_sqsh
From: |
Richard Henderson |
Subject: |
[PATCH v2 10/25] target/arm: Avoid tcg_const_ptr in handle_vec_simd_sqshrn |
Date: |
Tue, 7 Mar 2023 10:34:48 -0800 |
It is easy enough to use mov instead of or-with-zero
and relying on the optimizer to fold away the or.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/tcg/translate-a64.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c
index 2ad7c48901..082a8b82dd 100644
--- a/target/arm/tcg/translate-a64.c
+++ b/target/arm/tcg/translate-a64.c
@@ -8459,7 +8459,7 @@ static void handle_vec_simd_sqshrn(DisasContext *s, bool
is_scalar, bool is_q,
tcg_rn = tcg_temp_new_i64();
tcg_rd = tcg_temp_new_i64();
tcg_rd_narrowed = tcg_temp_new_i32();
- tcg_final = tcg_const_i64(0);
+ tcg_final = tcg_temp_new_i64();
if (round) {
tcg_round = tcg_constant_i64(1ULL << (shift - 1));
@@ -8473,7 +8473,11 @@ static void handle_vec_simd_sqshrn(DisasContext *s, bool
is_scalar, bool is_q,
false, is_u_shift, size+1, shift);
narrowfn(tcg_rd_narrowed, cpu_env, tcg_rd);
tcg_gen_extu_i32_i64(tcg_rd, tcg_rd_narrowed);
- tcg_gen_deposit_i64(tcg_final, tcg_final, tcg_rd, esize * i, esize);
+ if (i == 0) {
+ tcg_gen_mov_i64(tcg_final, tcg_rd);
+ } else {
+ tcg_gen_deposit_i64(tcg_final, tcg_final, tcg_rd, esize * i,
esize);
+ }
}
if (!is_q) {
--
2.34.1
- [PATCH v2 09/25] target/arm: Avoid tcg_const_ptr in disas_simd_zip_trn, (continued)
- [PATCH v2 09/25] target/arm: Avoid tcg_const_ptr in disas_simd_zip_trn, Richard Henderson, 2023/03/07
- [PATCH v2 11/25] target/arm: Avoid tcg_const_ptr in handle_rev, Richard Henderson, 2023/03/07
- [PATCH v2 13/25] target/m68k: Use tcg_constant_i32 in gen_ea_mode, Richard Henderson, 2023/03/07
- [PATCH v2 14/25] target/ppc: Avoid tcg_const_i64 in do_vcntmb, Richard Henderson, 2023/03/07
- [PATCH v2 15/25] target/ppc: Avoid tcg_const_* in vmx-impl.c.inc, Richard Henderson, 2023/03/07
- [PATCH v2 10/25] target/arm: Avoid tcg_const_ptr in handle_vec_simd_sqshrn,
Richard Henderson <=
- [PATCH v2 12/25] target/m68k: Reject immediate as destination in gen_ea_mode, Richard Henderson, 2023/03/07
- [PATCH v2 16/25] target/ppc: Avoid tcg_const_* in xxeval, Richard Henderson, 2023/03/07
- [PATCH v2 17/25] target/ppc: Avoid tcg_const_* in vsx-impl.c.inc, Richard Henderson, 2023/03/07
- [PATCH v2 18/25] target/ppc: Avoid tcg_const_* in fp-impl.c.inc, Richard Henderson, 2023/03/07