qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Aurelien Jarno <aurelien@aurel32.net>
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>,
	qemu-devel@nongnu.org, Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH] target-sh4: add atomic tas
Date: Thu, 3 Nov 2016 14:32:10 +0100	[thread overview]
Message-ID: <3e5a59f3-e084-b772-b36e-041505053c7f@vivier.eu> (raw)
In-Reply-To: <2906e69f-b54d-aaa4-c728-c1c750eb1072@redhat.com>



Le 03/11/2016 à 14:29, Paolo Bonzini a écrit :
> 
> 
> On 03/11/2016 14:12, Laurent Vivier wrote:
>> Implement real atomic tas.
>>
>> As tas is:
>>
>>     When (Rn) = 0, 1 -> T
>>     Otherwise, 0 -> T
>>     In both cases, 1 -> MSB of (Rn)
>>
>> It can't be implemented using cmpxchg().
> 
> Why not?

Only because I don't know :)

> This is essentially
> 
>     movi		temp0, 0x80
>     atomic_fetch_or_i32 temp1, Rn, temp0, ctx->memidx, MO_UB
>     setcondi_i32	cpu_sr_t, TCG_COND_EQ, temp1, 0
> 
> But the patch looks good anyway.

I'm going to rewrite it as you say...

Thanks,
Laurent

      reply	other threads:[~2016-11-03 13:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-03 13:12 [Qemu-devel] [PATCH] target-sh4: add atomic tas Laurent Vivier
2016-11-03 13:29 ` Paolo Bonzini
2016-11-03 13:32   ` Laurent Vivier [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=3e5a59f3-e084-b772-b36e-041505053c7f@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=aurelien@aurel32.net \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=pbonzini@redhat.com \
    --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 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).