From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Cc: Richard Henderson <richard.henderson@linaro.org>
Subject: Re: [PATCH] tcg/aarch64: fix assertion failure on TSTxx of UINT32_MAX
Date: Mon, 11 Mar 2024 13:06:13 +0100 [thread overview]
Message-ID: <513f4a87-d7b9-4973-aa59-48aabd673fb4@linaro.org> (raw)
In-Reply-To: <20240311082632.671163-1-pbonzini@redhat.com>
On 11/3/24 09:26, Paolo Bonzini wrote:
> 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);
Correct. Richard posted the same fix but using tcg_tst_eqne_cond:
https://lore.kernel.org/qemu-devel/20240309175102.726332-3-richard.henderson@linaro.org/
> ext = TCG_TYPE_I32;
> need_cmp = false;
> break;
prev parent reply other threads:[~2024-03-11 12:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-11 8:26 [PATCH] tcg/aarch64: fix assertion failure on TSTxx of UINT32_MAX Paolo Bonzini
2024-03-11 12:06 ` Philippe Mathieu-Daudé [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=513f4a87-d7b9-4973-aa59-48aabd673fb4@linaro.org \
--to=philmd@linaro.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).