All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Alrae <leon.alrae@imgtec.com>
To: Richard Henderson <rth@twiddle.net>
Cc: qemu-devel@nongnu.org, aurelien@aurel32.net
Subject: Re: [Qemu-devel] [PATCH 2/2] target-mips: reimplement SC instruction and use cmpxchg
Date: Tue, 27 Sep 2016 08:02:26 +0100	[thread overview]
Message-ID: <20160927070226.GA30955@hhmipssw201.hh.imgtec.org> (raw)
In-Reply-To: <7bcb606f-d86c-3213-4d97-e0541eeb4c89@twiddle.net>

On Wed, Sep 21, 2016 at 01:16:28PM -0700, Richard Henderson wrote:
> On 09/21/2016 01:07 AM, Leon Alrae wrote:
> >+    tcg_gen_brcond_tl(TCG_COND_EQ, addr, cpu_lladdr, l1);
> >+    tcg_temp_free(addr);
> >+    tcg_gen_movi_tl(t0, 0);
> >+    tcg_gen_br(done);
> >+
> >+    gen_set_label(l1);
> >+    /* generate cmpxchg */
> >+    val = tcg_temp_new();
> >+    gen_load_gpr(val, rt);
> >+    tcg_gen_atomic_cmpxchg_tl(t0, cpu_lladdr, cpu_llval, val,
> >+                              ctx->mem_idx, tcg_mo);
> >+    tcg_gen_setcond_tl(TCG_COND_EQ, t0, t0, cpu_llval);
> >+    tcg_temp_free(val);
> >+
> >+    gen_set_label(done);
> >+    /* store the result into the register */
> >+    gen_store_gpr(t0, rt);
> >     tcg_temp_free(t0);
> 
> The only thing I would change is to duplicate the gen_store_gpr into
> both branches, so that we don't have to store t0 into the stack
> across the blocks.

Done in v3.

> 
> Otherwise,
> 
> Reviewed-by: Richard Henderson <rth@twiddle.net>

Thanks for reviewing.

Leon

  reply	other threads:[~2016-09-27  7:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-21  8:07 [Qemu-devel] [PATCH 0/2] target-mips: rework conditional stores for mttcg Leon Alrae
2016-09-21  8:07 ` [Qemu-devel] [PATCH 1/2] target-mips: compare virtual addresses in LL/SC sequence Leon Alrae
2016-09-21  8:07 ` [Qemu-devel] [PATCH 2/2] target-mips: reimplement SC instruction and use cmpxchg Leon Alrae
2016-09-21 20:16   ` Richard Henderson
2016-09-27  7:02     ` Leon Alrae [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-09-15  8:44 [Qemu-devel] [PATCH 0/2] target-mips: rework conditional stores for mttcg Leon Alrae
2016-09-15  8:44 ` [Qemu-devel] [PATCH 2/2] target-mips: reimplement SC instruction and use cmpxchg Leon Alrae
2016-09-16 16:48   ` Richard Henderson
2016-09-19 11:35     ` Leon Alrae

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=20160927070226.GA30955@hhmipssw201.hh.imgtec.org \
    --to=leon.alrae@imgtec.com \
    --cc=aurelien@aurel32.net \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.