Re: __sync_lock_test_and_set on ARM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



David Daney wrote:
Andrew Haley wrote:
Phil Endecott writes:
 > Andrew Haley wrote:
> > this stuff really should be done by the compiler. > > Yes. I've filed a bug asking for a __sync_lock_test_and_set builtin: > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33413

Surer, but the problem is that for most of the things we want to do
(lightweight locks, for example) __sync_lock_test_and_set() doesn't
really do what we need: we need compare_and_swap().  That's why the
kernel helper is so useful, because it's robust even if we are on
pre-ARMv6 hardware.

Probably the enhancement request should be expanded to include *all* the __sync_* atomic memory primitives which includes compare_and_swap.

No, because none of the others can be implemented without kernel support or other magic.

Gcc should implement those __sync primitives that the hardware provides, and perhaps those that cane be synthesized directly from them, but it shouldn't try to provide more.


Phil.





[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux