qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] tcg/aarch64: fix assertion failure on TSTxx of UINT32_MAX


From: Paolo Bonzini
Subject: [PATCH] tcg/aarch64: fix assertion failure on TSTxx of UINT32_MAX
Date: Mon, 11 Mar 2024 09:26:32 +0100

These are translated to CBZ and CBNZ instructions, and the code generation part
of tcg_out_brcond checks that c is one of TCG_COND_EQ or TCG_COND_NE.

Fixes: 34aff3c2e06 ("tcg/aarch64: Generate CBNZ for TSTNE of UINT32_MAX", 
2024-02-03)
Cc: Philippe Mathieu-Daudé <philmd@linaro.org>
Cc: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 tcg/aarch64/tcg-target.c.inc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tcg/aarch64/tcg-target.c.inc b/tcg/aarch64/tcg-target.c.inc
index dec8ecc1b65..6ed174bd172 100644
--- a/tcg/aarch64/tcg-target.c.inc
+++ b/tcg/aarch64/tcg-target.c.inc
@@ -1465,6 +1465,7 @@ static void tcg_out_brcond(TCGContext *s, TCGType ext, 
TCGCond c, TCGArg a,
     case TCG_COND_TSTNE:
         /* tst xN,0xffffffff; b.ne L -> cbnz wN,L */
         if (b_const && b == UINT32_MAX) {
+            c = (c == TCG_COND_TSTEQ ? TCG_COND_EQ : TCG_COND_NE);
             ext = TCG_TYPE_I32;
             need_cmp = false;
             break;
-- 
2.43.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]