This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Hi David,$ /home/daney/gccsvn/mips64-trunk/gcc/xgcc -B/home/daney/gccsvn/mips64-trunk/gcc/ --version
David Daney wrote:Phil Endecott wrote:This raises another issue, which is whether there is any way for code to determine which of the atomic builtins are provided, i.e. I'd like to write:
#if HAS__sync_lock_test_and_set .. locking code using __sync_lock_test_and_set #elseif HAS__sync_something_else .. locking code using builtins that expand to LDREX and STREX #else #warn "no atomic ops, falling back to pthread mutex" ... #endif
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.
Really? I don't see anything like that in the output of
gcc -dM -E - < /dev/null|grep -i sync or grep -R HAVE_SYNC /usr/include/
on my x86 system, which does have a selection of atomic builtins.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |