From: Richard Henderson <richard.henderson@linaro.org>
To: Pavel Dovgalyuk <pavel.dovgalyuk@ispras.ru>, qemu-devel@nongnu.org
Cc: mrolnik@gmail.com, philmd@linaro.org
Subject: Re: [PATCH] target/avr: fix long address calculation
Date: Thu, 17 Nov 2022 17:23:38 -0800 [thread overview]
Message-ID: <c5374c91-79f7-580e-431f-41dc222f3cbd@linaro.org> (raw)
In-Reply-To: <166870147452.1401333.9619815077606562766.stgit@pasha-ThinkPad-X280>
On 11/17/22 08:11, Pavel Dovgalyuk wrote:
> AVR ELPMX instruction (and some others) use three registers to
> form long 24-bit address from RAMPZ and two 8-bit registers.
> RAMPZ stores shifted 8 bits like ff0000 to simplify address calculation.
> This patch fixes full address calculation in function gen_get_addr
> by changing the mess in offsets of deposit tcg instructions.
>
> Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
> ---
> target/avr/translate.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/target/avr/translate.c b/target/avr/translate.c
> index e65b6008c0..c9a0a39c2d 100644
> --- a/target/avr/translate.c
> +++ b/target/avr/translate.c
> @@ -1572,8 +1572,8 @@ static TCGv gen_get_addr(TCGv H, TCGv M, TCGv L)
> {
> TCGv addr = tcg_temp_new_i32();
>
> - tcg_gen_deposit_tl(addr, M, H, 8, 8);
> - tcg_gen_deposit_tl(addr, L, addr, 8, 16);
> + tcg_gen_deposit_tl(addr, H, M, 8, 8);
> + tcg_gen_deposit_tl(addr, addr, L, 0, 8);
>
> return addr;
> }
>
>
prev parent reply other threads:[~2022-11-18 1:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-17 16:11 [PATCH] target/avr: fix long address calculation Pavel Dovgalyuk
2022-11-18 1:23 ` 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=c5374c91-79f7-580e-431f-41dc222f3cbd@linaro.org \
--to=richard.henderson@linaro.org \
--cc=mrolnik@gmail.com \
--cc=pavel.dovgalyuk@ispras.ru \
--cc=philmd@linaro.org \
--cc=qemu-devel@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).