]> git.proxmox.com Git - mirror_qemu.git/commitdiff
tcg/aarch64: Generate CBNZ for TSTNE of UINT32_MAX
authorRichard Henderson <richard.henderson@linaro.org>
Sat, 28 Oct 2023 03:37:23 +0000 (03:37 +0000)
committerRichard Henderson <richard.henderson@linaro.org>
Sat, 3 Feb 2024 23:53:49 +0000 (23:53 +0000)
... 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>
tcg/aarch64/tcg-target.c.inc

index 36fc46ae93e11c21c2771420e3aadb3bda0effe5..dec8ecc1b6524cbe41b0ee37097f4bbc51f81c81 100644 (file)
@@ -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);