Linux-sh Archive mirror
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "D. Jeff Dionne" <djeffdionne@gmail.com>,
	"Paul E. McKenney" <paulmck@kernel.org>
Cc: "John Paul Adrian Glaubitz" <glaubitz@physik.fu-berlin.de>,
	Linux-Arch <linux-arch@vger.kernel.org>,
	linux-kernel@vger.kernel.org, "Marco Elver" <elver@google.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Doug Anderson" <dianders@chromium.org>,
	"Petr Mladek" <pmladek@suse.com>,
	"Linus Torvalds" <torvalds@linux-foundation.org>,
	kernel-team@meta.com, "Andi Shyti" <andi.shyti@linux.intel.com>,
	"Palmer Dabbelt" <palmer@rivosinc.com>,
	"Masami Hiramatsu" <mhiramat@kernel.org>,
	linux-sh@vger.kernel.org
Subject: Re: [PATCH v2 cmpxchg 12/13] sh: Emulate one-byte cmpxchg
Date: Thu, 02 May 2024 13:30:58 +0200	[thread overview]
Message-ID: <31ed4654-094a-4e1e-9182-973b43ae3464@app.fastmail.com> (raw)
In-Reply-To: <23A87C03-EB55-49A1-BB55-B6136117F0B6@gmail.com>

On Thu, May 2, 2024, at 07:42, D. Jeff Dionne wrote:
> On May 2, 2024, at 14:07, Paul E. McKenney <paulmck@kernel.org> wrote:
>
>> That would be 8-bit xchg() rather than 8-byte cmpxchg(), correct?
>> 
>> Or am I missing something subtle here that makes sh also support one-byte
>> (8-bit) cmpxchg()?
>
> The native SH atomic operation is test and set TAS.B.  J2 adds a 
> compare and swap CAS.L instruction, carefully chosen for patent free 
> prior art (s360, IIRC).
>
> The (relatively expensive) encoding space we allocated for CAS.L does 
> not contain size bits.
>
> Not all SH4 patents had expired when J2 was under development, but now 
> have (watch this space).  Not sure (me myself) if there are more atomic 
> operations in sh4.

SH4A supports MIPS R4000 style LL/SC instructions, but it looks like
the older SH4 does not.

      Arnd

      reply	other threads:[~2024-05-02 11:31 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <b67e79d4-06cb-4a45-a906-b9e0fbae22c5@paulmck-laptop>
2024-05-01 23:01 ` [PATCH v2 cmpxchg 12/13] sh: Emulate one-byte cmpxchg Paul E. McKenney
2024-05-02  4:52   ` John Paul Adrian Glaubitz
2024-05-02  5:06     ` Paul E. McKenney
2024-05-02  5:11       ` John Paul Adrian Glaubitz
2024-05-02 13:33         ` Paul E. McKenney
2024-05-02 20:53           ` Al Viro
2024-05-02 21:01             ` alpha cmpxchg.h (was Re: [PATCH v2 cmpxchg 12/13] sh: Emulate one-byte cmpxchg) Al Viro
2024-05-02 22:16               ` Linus Torvalds
2024-05-02 21:18             ` [PATCH v2 cmpxchg 12/13] sh: Emulate one-byte cmpxchg Paul E. McKenney
2024-05-02 22:07               ` Al Viro
2024-05-02 23:12                 ` Paul E. McKenney
2024-05-02 23:24                   ` Al Viro
2024-05-02 23:45                     ` Paul E. McKenney
2024-05-02 23:32                   ` Linus Torvalds
2024-05-03  0:16                     ` Paul E. McKenney
2024-05-02 21:50           ` Arnd Bergmann
2024-05-02  5:42       ` D. Jeff Dionne
2024-05-02 11:30         ` Arnd Bergmann [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=31ed4654-094a-4e1e-9182-973b43ae3464@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=akpm@linux-foundation.org \
    --cc=andi.shyti@linux.intel.com \
    --cc=dianders@chromium.org \
    --cc=djeffdionne@gmail.com \
    --cc=elver@google.com \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=kernel-team@meta.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=palmer@rivosinc.com \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=pmladek@suse.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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 read-only IMAP folder(s) and NNTP newsgroup(s).