public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Satish Vasudeva <satish.vasudeva@cohesity.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: Xi Ruoyao <xry111@mengyan1223.wang>, gcc-help@gcc.gnu.org
Subject: Re: Libatomic 16B
Date: Thu, 24 Feb 2022 12:38:46 -0800	[thread overview]
Message-ID: <CABp-VvKvZ9sgA_ageQSDA7Bcd7kGa=dO8y4=R6MPpGobVWDUbw@mail.gmail.com> (raw)
In-Reply-To: <20220224201334.GQ614@gate.crashing.org>

Thanks for the comments.

Please let into this intel architecture manual , section 8.1.1

https://cdrdv2.intel.com/v1/dl/getContent/671190

I think Intel claims 16B operations are atomic , unless I am missing
something.

On Thu, Feb 24, 2022 at 12:16 PM Segher Boessenkool <
segher@kernel.crashing.org> wrote:

> On Fri, Feb 25, 2022 at 04:05:28AM +0800, Xi Ruoyao via Gcc-help wrote:
> > On Thu, 2022-02-24 at 11:35 -0800, Satish Vasudeva wrote:
> > > Thanks for the response.
> > >
> > > Looking further into libatomic library code, I do see 16B move
> > > instructions have been used for atomic_exchange code like below. Just
> > > wondering why it is not generating a intrinsic __atomic_load_16 using
> > > this instruction.
> > >
> > > movdqa0x0(%rbp),%xmm0
> >
> > Because both Intel and AMD have not claimed "this is atomic".   In
> > __atomic_exchange movdqa is used as a normal data move instruction
> > (actually, GCC optimized memcpy calls in libatomic code to this).
>
> Yup.  Even on cores where this is atomic internally it is not atomic
> when used on a system with a 64-bit (or 72-bit) memory bus.
>
>
> Segher
>

  reply	other threads:[~2022-02-24 20:38 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-23 16:42 Satish Vasudeva
2022-02-24 16:42 ` Satish Vasudeva
2022-02-25 13:53   ` Florian Weimer
2022-02-24 19:09 ` Xi Ruoyao
2022-02-24 19:35   ` Satish Vasudeva
2022-02-24 20:05     ` Xi Ruoyao
2022-02-24 20:13       ` Segher Boessenkool
2022-02-24 20:38         ` Satish Vasudeva [this message]
2022-02-25  8:35           ` Stefan Ring
2022-02-25  8:48             ` Xi Ruoyao
2022-02-25 14:01               ` Florian Weimer
2022-02-25 14:10                 ` Alexander Monakov
2022-02-25 14:16                   ` Xi Ruoyao
2022-02-25 14:25                 ` Xi Ruoyao
2022-02-25 17:05                   ` Satish Vasudeva
2022-02-25 17:16                     ` Xi Ruoyao
2022-02-25 17:25                       ` Satish Vasudeva
2022-03-02  0:16                         ` Satish Vasudeva
2022-03-02  5:55                           ` Florian Weimer

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='CABp-VvKvZ9sgA_ageQSDA7Bcd7kGa=dO8y4=R6MPpGobVWDUbw@mail.gmail.com' \
    --to=satish.vasudeva@cohesity.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=segher@kernel.crashing.org \
    --cc=xry111@mengyan1223.wang \
    /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).