target/riscv: Use generic tcg_gen_revbit8
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Richard Henderson committed
Aug 10, 2026 at 09:42 UTC
0a897b9c0c7e745a32ebfa363ebe9cc0218fb6cc
3 files changed
+1
-17
target/riscv/helper.h
-1
@@ -79,7 +79,6 @@ DEF_HELPER_FLAGS_2(froundnx_d, TCG_CALL_NO_RWG_SE, i64, env, i64)
79
/* Bitmanip */
80
DEF_HELPER_FLAGS_2(clmul, TCG_CALL_NO_RWG_SE, tl, tl, tl)
81
DEF_HELPER_FLAGS_2(clmulr, TCG_CALL_NO_RWG_SE, tl, tl, tl)
82
-DEF_HELPER_FLAGS_1(brev8, TCG_CALL_NO_RWG_SE, tl, tl)
82
DEF_HELPER_FLAGS_1(unzip, TCG_CALL_NO_RWG_SE, tl, tl)
83
DEF_HELPER_FLAGS_1(zip, TCG_CALL_NO_RWG_SE, tl, tl)
84
DEF_HELPER_FLAGS_2(xperm4, TCG_CALL_NO_RWG_SE, tl, tl, tl)
target/riscv/tcg/bitmanip_helper.c
-15
@@ -52,21 +52,6 @@ target_ulong HELPER(clmulr)(target_ulong rs1, target_ulong rs2)
52
return result;
53
}
54
55
-static inline target_ulong do_swap(target_ulong x, uint64_t mask, int shift)
56
-{
57
- return ((x & mask) << shift) | ((x & ~mask) >> shift);
58
-}
59
-
60
-target_ulong HELPER(brev8)(target_ulong rs1)
61
-{
62
- target_ulong x = rs1;
63
-
64
- x = do_swap(x, 0x5555555555555555ull, 1);
65
- x = do_swap(x, 0x3333333333333333ull, 2);
66
- x = do_swap(x, 0x0f0f0f0f0f0f0f0full, 4);
67
- return x;
68
-}
69
-
55
static const uint64_t shuf_masks[] = {
56
dup_const(MO_8, 0x44),
57
dup_const(MO_8, 0x30),
target/riscv/tcg/insn_trans/trans_rvb.c.inc
+1
-1
@@ -522,7 +522,7 @@ static void gen_packw(TCGv ret, TCGv src1, TCGv src2)
522
static bool trans_brev8(DisasContext *ctx, arg_brev8 *a)
523
{
524
REQUIRE_ZBKB(ctx);
525
- return gen_unary(ctx, a, EXT_NONE, gen_helper_brev8);
525
+ return gen_unary(ctx, a, EXT_NONE, tcg_gen_revbit8_tl);
526
}
527
528
static bool trans_pack(DisasContext *ctx, arg_pack *a)