[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 6/6] target/loongarch: Use hswap_i64() in REVH.D opcode
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 6/6] target/loongarch: Use hswap_i64() in REVH.D opcode |
Date: |
Tue, 22 Aug 2023 13:01:29 +0200 |
Commit 46be8425ff ("tcg: Implement tcg_gen_{h,w}swap_{i32,i64}")
introduced the generic hswap_i32(). Use it instead of open-coding
it as gen_revh_d().
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/loongarch/insn_trans/trans_bit.c.inc | 16 +---------------
1 file changed, 1 insertion(+), 15 deletions(-)
diff --git a/target/loongarch/insn_trans/trans_bit.c.inc
b/target/loongarch/insn_trans/trans_bit.c.inc
index 25b4d7858b..95b4ee5bc8 100644
--- a/target/loongarch/insn_trans/trans_bit.c.inc
+++ b/target/loongarch/insn_trans/trans_bit.c.inc
@@ -150,20 +150,6 @@ static void gen_revh_2w(TCGv dest, TCGv src1)
tcg_gen_or_i64(dest, t1, t0);
}
-static void gen_revh_d(TCGv dest, TCGv src1)
-{
- TCGv t0 = tcg_temp_new();
- TCGv t1 = tcg_temp_new();
- TCGv mask = tcg_constant_tl(0x0000FFFF0000FFFFULL);
-
- tcg_gen_shri_tl(t1, src1, 16);
- tcg_gen_and_tl(t1, t1, mask);
- tcg_gen_and_tl(t0, src1, mask);
- tcg_gen_shli_tl(t0, t0, 16);
- tcg_gen_or_tl(t0, t0, t1);
- tcg_gen_rotri_tl(dest, t0, 32);
-}
-
static void gen_maskeqz(TCGv dest, TCGv src1, TCGv src2)
{
TCGv zero = tcg_constant_tl(0);
@@ -193,7 +179,7 @@ TRANS(revb_4h, gen_rr, EXT_NONE, EXT_NONE, gen_revb_4h)
TRANS(revb_2w, gen_rr, EXT_NONE, EXT_NONE, gen_revb_2w)
TRANS(revb_d, gen_rr, EXT_NONE, EXT_NONE, tcg_gen_bswap64_i64)
TRANS(revh_2w, gen_rr, EXT_NONE, EXT_NONE, gen_revh_2w)
-TRANS(revh_d, gen_rr, EXT_NONE, EXT_NONE, gen_revh_d)
+TRANS(revh_d, gen_rr, EXT_NONE, EXT_NONE, tcg_gen_hswap_i64)
TRANS(bitrev_4b, gen_rr, EXT_ZERO, EXT_SIGN, gen_helper_bitswap)
TRANS(bitrev_8b, gen_rr, EXT_NONE, EXT_NONE, gen_helper_bitswap)
TRANS(bitrev_w, gen_rr, EXT_NONE, EXT_SIGN, gen_helper_bitrev_w)
--
2.41.0
[PATCH 5/6] target/mips: Use hswap_i64() in DSHD opcode, Philippe Mathieu-Daudé, 2023/08/22
[PATCH 3/6] target/microblaze: Use hswap_i32() in SWAPH opcode, Philippe Mathieu-Daudé, 2023/08/22
[PATCH 6/6] target/loongarch: Use hswap_i64() in REVH.D opcode,
Philippe Mathieu-Daudé <=
[PATCH 1/6] target/arm: Use hswap_i32() in VREV/SMLAD opcodes, Philippe Mathieu-Daudé, 2023/08/22
[PATCH 4/6] target/sh4: Use hswap_i32() in SWAP.W opcode, Philippe Mathieu-Daudé, 2023/08/22