[PATCH 3/7] Remove atomic_bit_set/bit_test_set
Noah Goldstein
goldstein.w.n@gmail.com
Wed Jul 6 19:51:46 GMT 2022
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
More information about the Libc-alpha
mailing list