From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org
Cc: laurent.desnogues@gmail.com, peter.maydell@linaro.org
Subject: Re: [Qemu-devel] [PATCH] target/arm: Fix sign-extension for SMLAL*
Date: Fri, 13 Sep 2019 13:01:56 +0200 [thread overview]
Message-ID: <cdabfdcd-a7e2-fefb-3e35-a05c3b593dcf@redhat.com> (raw)
In-Reply-To: <20190912183058.17947-1-richard.henderson@linaro.org>
On 9/12/19 8:30 PM, Richard Henderson wrote:
> The 32-bit product should be sign-extended, not zero-extended.
>
> Fixes: ea96b374641b
> Reported-by: Laurent Desnogues <laurent.desnogues@gmail.com>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> target/arm/translate.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/target/arm/translate.c b/target/arm/translate.c
> index 34bb280e3d..fd2f0e3048 100644
> --- a/target/arm/translate.c
> +++ b/target/arm/translate.c
> @@ -8045,7 +8045,9 @@ static bool op_smlaxxx(DisasContext *s, arg_rrrr *a,
> case 2:
> tl = load_reg(s, a->ra);
> th = load_reg(s, a->rd);
> - t1 = tcg_const_i32(0);
> + /* Sign-extend the 32-bit product to 64 bits. */
> + t1 = tcg_temp_new_i32();
> + tcg_gen_sari_i32(t1, t0, 31);
> tcg_gen_add2_i32(tl, th, tl, th, t0, t1);
> tcg_temp_free_i32(t0);
> tcg_temp_free_i32(t1);
>
next prev parent reply other threads:[~2019-09-13 11:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-12 18:30 [Qemu-devel] [PATCH] target/arm: Fix sign-extension for SMLAL* Richard Henderson
2019-09-13 6:03 ` Laurent Desnogues
2019-09-13 11:01 ` Philippe Mathieu-Daudé [this message]
2019-10-14 23:42 ` Richard Henderson
2019-10-17 13:52 ` Peter Maydell
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=cdabfdcd-a7e2-fefb-3e35-a05c3b593dcf@redhat.com \
--to=philmd@redhat.com \
--cc=laurent.desnogues@gmail.com \
--cc=peter.maydell@linaro.org \
--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).