Re: [PATCH 09/11] tcg/aarch64: Implement revbit{32,64}

Philippe Mathieu-Daudé <[email protected]> Fri, 31 Jul 2026 09:12:00 +0200
Newsgroups org.nongnu.qemu-arm,org.nongnu.qemu-devel
Message-ID <[email protected]>
On 31/7/26 02:05, Richard Henderson wrote:
> Signed-off-by: Richard Henderson <[email protected]>
> ---
>   tcg/aarch64/tcg-target.c.inc | 20 ++++++++++++++++++--
>   1 file changed, 18 insertions(+), 2 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <[email protected]>

> +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);

Back to my comment in patch #1 about having bswap flags defined once
per target, that would allow that kind of change to be done once in
common code, not per-target once. In the lines of:

   if (backend_default_flag & TCG_BSWAP_OZ
           && frontend_requested_flag & TCG_BSWAP_OS) {
      tcg_out_ext32s(s, a0, a0);
   } ...

> +    }
> +}