__sync_lock_test_and_set on ARM

Phil Endecott spam_from_gcc_help_2@chezphil.org
Wed Sep 12 20:53:00 GMT 2007


David Daney wrote:
>>>>> The proper symbol to test would be something like: 
>>>>> __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 or 
>>>>> __GCC_HAVE_SYNC_LOCK_TEST_AND_SET_4  they are automatically set by 
>>>>> GCC when the builtin functions are available.

>>> $ /home/daney/gccsvn/mips64-trunk/gcc/xgcc 
>>> -B/home/daney/gccsvn/mips64-trunk/gcc/ -E -dM st.c | grep SYNC
>>> #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
>>> #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1

Looking at http://gcc.gnu.org/viewcvs/trunk/gcc/c-cppbuiltin.c?revision=128218&view=markup
it seems that the __GCC_HAVE_SYNC_COMPARE_AND_SWAP_n macros are 
explicitly defined if the machine supports them, but not any of the 
other __SYNC_something builtins.  Unless they come from somewhere else.

It's a shame that the viewcvs web thing doesn't have a "grep -R" 
feature!  Could someone with a source tree handly perhaps do a grep -R 
HAVE_SYNC and see whether it finds anything else?


Regards,

Phil.






More information about the Gcc-help mailing list