public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Noah Goldstein <goldstein.w.n@gmail.com>
To: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
Cc: GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH 3/7] Remove atomic_bit_set/bit_test_set
Date: Wed, 6 Jul 2022 12:51:46 -0700	[thread overview]
Message-ID: <CAFUsyf+H5A1NqTBxwvvfVd7TzXJ8-J8HtUmUg8P9KVwEQYk9SQ@mail.gmail.com> (raw)
In-Reply-To: <AM5PR0801MB1668B2BB6C6560CCA3BA5E3083809@AM5PR0801MB1668.eurprd08.prod.outlook.com>

On Wed, Jul 6, 2022 at 12:37 PM Wilco Dijkstra <Wilco.Dijkstra@arm.com> wrote:
>
> Hi Noah,
>
> > For non-constant shift values it needs to be like atomic_or4/atomic_or5.
> >
> > Since this needs to be set up in a particular way it seems worth it to
> > keep it as a macro that will do it properly. Fine with replacing the underlying
> > atomic op with a compiler intrinsic.
>
> This was only one use in GLIBC so how does adding a private macro help other
> software? This idiom doesn't appear common, particularly with a non-constant bit,
> but in principle the compiler could be fixed so that it optimizes do_atomic_or2/3
> as well.

The usage in this patch is fine. Just seems having an internal API for
it provides
value given that in the future there may be a need for atomic_bit_set
w.o a constant
bit and there are non-obvious tricks necessary for doing it right.


>
> Cheers,
> Wilco

  reply	other threads:[~2022-07-06 19:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-06 15:14 Wilco Dijkstra
2022-07-06 16:14 ` Noah Goldstein
2022-07-06 18:25   ` Noah Goldstein
2022-07-06 18:59     ` Wilco Dijkstra
2022-07-06 19:14       ` Noah Goldstein
2022-07-06 19:30         ` H.J. Lu
2022-07-06 19:36         ` Wilco Dijkstra
2022-07-06 19:51           ` Noah Goldstein [this message]
2022-07-06 19:56             ` Noah Goldstein
2022-07-06 20:14               ` Wilco Dijkstra
2022-07-06 20:30                 ` Noah Goldstein
2022-07-06 20:56                   ` H.J. Lu
2022-07-12 17:47                     ` Adhemerval Zanella Netto
2022-07-12 18:09                       ` H.J. Lu
2022-07-12 18:44                         ` Wilco Dijkstra
2022-07-12 19:11                           ` H.J. Lu
2022-07-12 19:18                             ` Noah Goldstein
2022-07-12 20:39                               ` Wilco Dijkstra

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=CAFUsyf+H5A1NqTBxwvvfVd7TzXJ8-J8HtUmUg8P9KVwEQYk9SQ@mail.gmail.com \
    --to=goldstein.w.n@gmail.com \
    --cc=Wilco.Dijkstra@arm.com \
    --cc=libc-alpha@sourceware.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).