Commit a8687b8632 for qemu.org
commit a8687b8632a9dfe6dff094615e030480a950ffd0
Author: Richard Henderson <richard.henderson@linaro.org>
Date: Thu Jul 30 22:59:22 2026 +0000
tcg/aarch64: Implement revbit{32,64}
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
diff --git a/tcg/aarch64/tcg-target.c.inc b/tcg/aarch64/tcg-target.c.inc
index 0afa988087..80995403e4 100644
--- a/tcg/aarch64/tcg-target.c.inc
+++ b/tcg/aarch64/tcg-target.c.inc
@@ -2656,12 +2656,28 @@ static const TCGOutOpUnary outop_revbit8 = {
.base.static_constraint = C_NotImplemented,
};
+static void tgen_revbit32(TCGContext *s, TCGType type,
+ TCGReg a0, TCGReg a1, unsigned flags)
+{
+ tcg_out_insn(s, rr_sf, RBIT, TCG_TYPE_I32, a0, a1);
+ if (flags & TCG_BSWAP_OS) {
+ tcg_out_ext32s(s, a0, a0);
+ }
+}
+
static const TCGOutOpBswap outop_revbit32 = {
- .base.static_constraint = C_NotImplemented,
+ .base.static_constraint = C_O1_I1(r, r),
+ .out_rr = tgen_revbit32,
};
+static void tgen_revbit64(TCGContext *s, TCGType type, TCGReg a0, TCGReg a1)
+{
+ tcg_out_insn(s, rr_sf, RBIT, TCG_TYPE_I64, a0, a1);
+}
+
static const TCGOutOpUnary outop_revbit64 = {
- .base.static_constraint = C_NotImplemented,
+ .base.static_constraint = C_O1_I1(r, r),
+ .out_rr = tgen_revbit64,
};
static void tgen_neg(TCGContext *s, TCGType type, TCGReg a0, TCGReg a1)