This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: How to use __sync_bool_compare_and_swap_16 on x86_64
- From: Ian Lance Taylor <iant at google dot com>
- To: Jeff Donner <jeffrey dot donner at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Wed, 01 Jul 2009 19:35:05 -0700
- Subject: Re: How to use __sync_bool_compare_and_swap_16 on x86_64
- References: <9b10496c0907011915i40555702y887b2779936cc918@mail.gmail.com>
Jeff Donner <jeffrey.donner@gmail.com> writes:
> __sync_bool_compare_and_swap(int64_t*, int64_t, int64_t) and the
> equivalent __sync_bool_compare_and_swap_8(...) work with 4.4.0 (and
> trunk),
> and __sync_bool_compare_and_swap_16 will /compile/ when you pass
> 128-byte structs by value, strangely. However, this won't link.
> Is it possible to use __sync_bool_compare_and_swap_16 from GCC 4.4.+
> at all? And if not, could it be added? I can see where the lack of any
> 128-byte native type to put in the signature makes a problem.
You have to write the function yourself. When a sync function is not
supported natively, gcc generates a call to a support function, which
you have to provide. I agree that this is not ideal.
Ian