From: Richard Henderson <richard.henderson@linaro.org>
To: Yasuo Kuwahara <kwhr00@gmail.com>,
qemu-trivial@nongnu.org, qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [PATCH] tcg/aarch64/tcg-target.c.inc: correction of rotate bit number
Date: Tue, 25 May 2021 17:00:08 -0700 [thread overview]
Message-ID: <216dd18c-ebf9-e97c-5950-3acf44121e18@linaro.org> (raw)
In-Reply-To: <CAHfJ0vSXnmnTLmT0kR=a8ACRdw_UsLYOhStzUzgVEHoH8U-7sA@mail.gmail.com>
On 5/25/21 2:46 AM, Yasuo Kuwahara wrote:
> The last argument of tcg_out_extr() must be in the range 0-31 if ext==0.
>
> Before the fix, when m==0 it becomes 32 and it crashes with an Illegal
> instruction in Apple Silicon.
>
> After the fix, it will be 0. If m is in the range 1-31, it is the same as before.
>
>
> Signed-off-by: Yasuo Kuwahara <kwhr00@gmail.com <mailto:kwhr00@gmail.com>>
>
> ---
>
> tcg/aarch64/tcg-target.c.inc | 5 ++---
>
> 1 file changed, 2 insertions(+), 3 deletions(-)
(1) All patches go to qemu-devel, as per
https://wiki.qemu.org/Contribute/SubmitAPatch
Many maintainers including myself don't monitor qemu-trivial.
(2) Something is wrong with your mailer and it is adding extra
newlines, which means the patch does not apply. However,
because the patch is so simple, I have applied it by hand.
Queued to tcg-next, thanks.
r~
>
>
> diff --git a/tcg/aarch64/tcg-target.c.inc b/tcg/aarch64/tcg-target.c.inc
>
> index f07ba98aa4..5bd366f2d4 100644
>
> --- a/tcg/aarch64/tcg-target.c.inc
>
> +++ b/tcg/aarch64/tcg-target.c.inc
>
> @@ -1291,9 +1291,8 @@ static inline void tcg_out_rotr(TCGContext *s, TCGType ext,
>
> static inline void tcg_out_rotl(TCGContext *s, TCGType ext,
>
> TCGReg rd, TCGReg rn, unsigned int m)
>
> {
>
> -int bits = ext ? 64 : 32;
>
> -int max = bits - 1;
>
> -tcg_out_extr(s, ext, rd, rn, rn, bits - (m & max));
>
> +int max = ext ? 63 : 31;
>
> +tcg_out_extr(s, ext, rd, rn, rn, -m & max);
>
> }
>
> static inline void tcg_out_dep(TCGContext *s, TCGType ext, TCGReg rd,
>
> --
>
> 2.24.3
>
>
parent reply other threads:[~2021-05-26 0:01 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <CAHfJ0vSXnmnTLmT0kR=a8ACRdw_UsLYOhStzUzgVEHoH8U-7sA@mail.gmail.com>]
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=216dd18c-ebf9-e97c-5950-3acf44121e18@linaro.org \
--to=richard.henderson@linaro.org \
--cc=kwhr00@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@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).