[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 02/12] target/arm: Use generic hrev32_i32() in ARM REV16 and VREV
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 02/12] target/arm: Use generic hrev32_i32() in ARM REV16 and VREV16 opcodes |
Date: |
Tue, 22 Aug 2023 14:40:32 +0200 |
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/arm/tcg/translate-a32.h | 1 -
target/arm/tcg/translate-neon.c | 2 +-
target/arm/tcg/translate.c | 14 +-------------
3 files changed, 2 insertions(+), 15 deletions(-)
diff --git a/target/arm/tcg/translate-a32.h b/target/arm/tcg/translate-a32.h
index 0c8f408eea..6cc02c83b9 100644
--- a/target/arm/tcg/translate-a32.h
+++ b/target/arm/tcg/translate-a32.h
@@ -45,7 +45,6 @@ void gen_lookup_tb(DisasContext *s);
long vfp_reg_offset(bool dp, unsigned reg);
long neon_full_reg_offset(unsigned reg);
long neon_element_offset(int reg, int element, MemOp memop);
-void gen_rev16(TCGv_i32 dest, TCGv_i32 var);
void clear_eci_state(DisasContext *s);
bool mve_eci_check(DisasContext *s);
void mve_update_eci(DisasContext *s);
diff --git a/target/arm/tcg/translate-neon.c b/target/arm/tcg/translate-neon.c
index 0e59b03ff9..9489dc0b3e 100644
--- a/target/arm/tcg/translate-neon.c
+++ b/target/arm/tcg/translate-neon.c
@@ -3528,7 +3528,7 @@ static bool trans_VREV16(DisasContext *s, arg_2misc *a)
if (a->size != 0) {
return false;
}
- return do_2misc(s, a, gen_rev16);
+ return do_2misc(s, a, tcg_gen_hrev32_i32);
}
static bool trans_VCLS(DisasContext *s, arg_2misc *a)
diff --git a/target/arm/tcg/translate.c b/target/arm/tcg/translate.c
index 39a42611c6..4ebf04f4de 100644
--- a/target/arm/tcg/translate.c
+++ b/target/arm/tcg/translate.c
@@ -416,18 +416,6 @@ static void gen_smul_dual(TCGv_i32 a, TCGv_i32 b)
tcg_gen_mov_i32(a, tmp1);
}
-/* Byteswap each halfword. */
-void gen_rev16(TCGv_i32 dest, TCGv_i32 var)
-{
- TCGv_i32 tmp = tcg_temp_new_i32();
- TCGv_i32 mask = tcg_constant_i32(0x00ff00ff);
- tcg_gen_shri_i32(tmp, var, 8);
- tcg_gen_and_i32(tmp, tmp, mask);
- tcg_gen_and_i32(var, var, mask);
- tcg_gen_shli_i32(var, var, 8);
- tcg_gen_or_i32(dest, var, tmp);
-}
-
/* Byteswap low halfword and sign extend. */
static void gen_revsh(TCGv_i32 dest, TCGv_i32 var)
{
@@ -7578,7 +7566,7 @@ static bool trans_REV16(DisasContext *s, arg_rr *a)
if (!ENABLE_ARCH_6) {
return false;
}
- return op_rr(s, a, gen_rev16);
+ return op_rr(s, a, tcg_gen_hrev32_i32);
}
static bool trans_REVSH(DisasContext *s, arg_rr *a)
--
2.41.0
- [PATCH 00/12] tcg: Factor hrev{32,64}_{i32,i64,tl} out, Philippe Mathieu-Daudé, 2023/08/22
- [PATCH 01/12] tcg/tcg-op: Factor tcg_gen_hrev32_i32() out, Philippe Mathieu-Daudé, 2023/08/22
- [PATCH 02/12] target/arm: Use generic hrev32_i32() in ARM REV16 and VREV16 opcodes,
Philippe Mathieu-Daudé <=
- [PATCH 03/12] target/cris: Use generic hrev32_i32() in SWAPB opcode, Philippe Mathieu-Daudé, 2023/08/22
- [PATCH 04/12] target/rx: Use generic hrev32_i32() in REVW opcode, Philippe Mathieu-Daudé, 2023/08/22
- [PATCH 05/12] tcg/tcg-op: Factor tcg_gen_hrev64_i64() out, Philippe Mathieu-Daudé, 2023/08/22
- [PATCH 10/12] target/arm: Use generic hrev_i64() in Aarch64 REV16 opcode, Philippe Mathieu-Daudé, 2023/08/22
- [PATCH 09/12] tcg/tcg-op: Add tcg_gen_hrev32_i64() and tcg_gen_hrev_i64(), Philippe Mathieu-Daudé, 2023/08/22
- [PATCH 08/12] target/loongarch: Use generic hrev64_i64() in REVB.4H opcode, Philippe Mathieu-Daudé, 2023/08/22
- [PATCH 11/12] target/loongarch: Use generic hrev64_i32() in REVB.2H opcode, Philippe Mathieu-Daudé, 2023/08/22