qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: Sarah Harris <S.E.Harris@kent.ac.uk>,
	Thomas Huth <huth@tuxfamily.org>,
	Joaquin de Andres <me@xcancerberox.com.ar>,
	Richard Henderson <richard.henderson@linaro.org>,
	qemu-devel@nongnu.org, Michael Rolnik <mrolnik@gmail.com>
Subject: Re: [RFC PATCH 3/3] target/avr: Fix SBRC/SBRS instructions
Date: Tue, 07 Jul 2020 09:56:58 +0100	[thread overview]
Message-ID: <877dvfpusl.fsf@linaro.org> (raw)
In-Reply-To: <20200707064646.7603-4-f4bug@amsat.org>


Philippe Mathieu-Daudé <f4bug@amsat.org> writes:

> SBRC/SBRS instructions seem to be inverted.

I'm having trouble following exactly how the skip logic is meant to
work. Intuitively I would expect a skip if clear to be TCG_COND_EQ
because that is true if bit & mask is compared to 0 but it's not clear
that what happens.

It would be easier if we actually had some instruction tests. I see
gcc-avr is a thing.

>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  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 fe03e676df..2f77fe3ba7 100644
> --- a/target/avr/translate.c
> +++ b/target/avr/translate.c
> @@ -1385,7 +1385,7 @@ static bool trans_SBRC(DisasContext *ctx, arg_SBRC *a)
>  {
>      TCGv Rr = cpu_r[a->rr];
>  
> -    ctx->skip_cond = TCG_COND_EQ;
> +    ctx->skip_cond = TCG_COND_NE;
>      ctx->skip_var0 = tcg_temp_new();
>      ctx->free_skip_var0 = true;
>  
> @@ -1401,7 +1401,7 @@ static bool trans_SBRS(DisasContext *ctx, arg_SBRS *a)
>  {
>      TCGv Rr = cpu_r[a->rr];
>  
> -    ctx->skip_cond = TCG_COND_NE;
> +    ctx->skip_cond = TCG_COND_EQ;
>      ctx->skip_var0 = tcg_temp_new();
>      ctx->free_skip_var0 = true;


-- 
Alex Bennée


      reply	other threads:[~2020-07-07  8:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-07  6:46 [PATCH 0/3] target/avr: Few fixes Philippe Mathieu-Daudé
2020-07-07  6:46 ` [PATCH 1/3] target/avr: Drop tlb_flush() in avr_cpu_reset() Philippe Mathieu-Daudé
2020-07-07  8:27   ` Alex Bennée
2020-07-07  6:46 ` [PATCH 2/3] target/avr: Fix $PC displayed address Philippe Mathieu-Daudé
2020-07-07  8:33   ` Alex Bennée
2020-07-07  6:46 ` [RFC PATCH 3/3] target/avr: Fix SBRC/SBRS instructions Philippe Mathieu-Daudé
2020-07-07  8:56   ` Alex Bennée [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=877dvfpusl.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=S.E.Harris@kent.ac.uk \
    --cc=f4bug@amsat.org \
    --cc=huth@tuxfamily.org \
    --cc=me@xcancerberox.com.ar \
    --cc=mrolnik@gmail.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).