From: Richard Henderson <richard.henderson@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>,
qemu-arm@nongnu.org, qemu-devel@nongnu.org
Cc: qemu-stable@nongnu.org
Subject: Re: [PATCH] target/arm: Fix A64 scalar SQSHRN and SQRSHRN
Date: Wed, 24 Jan 2024 02:17:49 +1000 [thread overview]
Message-ID: <20117cb1-b167-425d-ae7c-a5e149264f70@linaro.org> (raw)
In-Reply-To: <20240123153416.877308-1-peter.maydell@linaro.org>
On 1/24/24 01:34, Peter Maydell wrote:
> In commit 1b7bc9b5c8bf374dd we changed handle_vec_simd_sqshrn() so
> that instead of starting with a 0 value and depositing in each new
> element from the narrowing operation, it instead started with the raw
> result of the narrowing operation of the first element.
>
> This is fine in the vector case, because the deposit operations for
> the second and subsequent elements will always overwrite any higher
> bits that might have been in the first element's result value in
> tcg_rd. However in the scalar case we only go through this loop
> once. The effect is that for a signed narrowing operation, if the
> result is negative then we will now return a value where the bits
> above the first element are incorrectly 1 (because the narrowfn
> returns a sign-extended result, not one that is truncated to the
> element size).
>
> Fix this by using an extract operation to get exactly the correct
> bits of the output of the narrowfn for element 1, instead of a
> plain move.
>
> Cc:qemu-stable@nongnu.org
> Fixes: 1b7bc9b5c8bf374dd3 ("target/arm: Avoid tcg_const_ptr in handle_vec_simd_sqshrn")
> Resolves:https://gitlab.com/qemu-project/qemu/-/issues/2089
> Signed-off-by: Peter Maydell<peter.maydell@linaro.org>
> ---
> target/arm/tcg/translate-a64.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
prev parent reply other threads:[~2024-01-23 16:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-23 15:34 [PATCH] target/arm: Fix A64 scalar SQSHRN and SQRSHRN Peter Maydell
2024-01-23 16:17 ` Richard Henderson [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=20117cb1-b167-425d-ae7c-a5e149264f70@linaro.org \
--to=richard.henderson@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.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).