diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2023-10-28 03:37:23 +0000 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2024-02-03 23:53:49 +0000 |
commit | 34aff3c2e065dc19fbd83eb7b4766776f73378ab (patch) | |
tree | ca3efb58c5cc31b26caf4b5276e138187f9bec29 /tcg/aarch64/tcg-target.c.inc | |
parent | 92a11b935df24829cac30510196c6d07b36891ea (diff) | |
download | qemu-34aff3c2e065dc19fbd83eb7b4766776f73378ab.zip qemu-34aff3c2e065dc19fbd83eb7b4766776f73378ab.tar.gz qemu-34aff3c2e065dc19fbd83eb7b4766776f73378ab.tar.bz2 |
tcg/aarch64: Generate CBNZ for TSTNE of UINT32_MAX
... and the inverse, CBZ for TSTEQ.
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tcg/aarch64/tcg-target.c.inc')
-rw-r--r-- | tcg/aarch64/tcg-target.c.inc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tcg/aarch64/tcg-target.c.inc b/tcg/aarch64/tcg-target.c.inc index 36fc46a..dec8ecc 100644 --- a/tcg/aarch64/tcg-target.c.inc +++ b/tcg/aarch64/tcg-target.c.inc @@ -1463,6 +1463,12 @@ static void tcg_out_brcond(TCGContext *s, TCGType ext, TCGCond c, TCGArg a, break; case TCG_COND_TSTEQ: case TCG_COND_TSTNE: + /* tst xN,0xffffffff; b.ne L -> cbnz wN,L */ + if (b_const && b == UINT32_MAX) { + ext = TCG_TYPE_I32; + need_cmp = false; + break; + } /* tst xN,1<<B; b.ne L -> tbnz xN,B,L */ if (b_const && is_power_of_2(b)) { tbit = ctz64(b); |