summaryrefslogtreecommitdiff
path: root/gcc/c-cppbuiltin.c
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2007-05-21 22:48:38 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2007-05-21 22:48:38 +0000
commit893358f78aabd274a5f60b825899945ae3ea15f3 (patch)
tree4f20e8ac3ee34a06b520c092b3071efa0f505105 /gcc/c-cppbuiltin.c
parent18f801dd3e5e4a1e4e372f5ccce6a41331a32c55 (diff)
downloadgcc-893358f78aabd274a5f60b825899945ae3ea15f3.tar.gz
2007-05-21 Paolo Bonzini <bonzini@gnu.org>
Paolo Carlini <pcarlini@suse.de> Uros Bizjak <ubizjak@gmail.com> * c-cppbuiltin.c (c_cpp_builtins): Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1, __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2, __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4, __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8, __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16, if appropriate. * doc/cpp.texi ([Standard Predefined Macros]): Document. 2007-05-21 Paolo Bonzini <bonzini@gnu.org> Paolo Carlini <pcarlini@suse.de> Uros Bizjak <ubizjak@gmail.com> * gcc.dg/gcc-have-sync-compare-and-swap.c, gcc.target/i386/gcc-have-sync-compare-and-swap-1.c, gcc.target/i386/gcc-have-sync-compare-and-swap-2.c, gcc.target/i386/gcc-have-sync-compare-and-swap-3.c, gcc.target/i386/gcc-have-sync-compare-and-swap-4.c, New testcases. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124926 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-cppbuiltin.c')
-rw-r--r--gcc/c-cppbuiltin.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/c-cppbuiltin.c b/gcc/c-cppbuiltin.c
index 544050a4878..1b52da02975 100644
--- a/gcc/c-cppbuiltin.c
+++ b/gcc/c-cppbuiltin.c
@@ -547,6 +547,33 @@ c_cpp_builtins (cpp_reader *pfile)
if (c_dialect_cxx () && TYPE_UNSIGNED (wchar_type_node))
cpp_define (pfile, "__WCHAR_UNSIGNED__");
+ /* Tell source code if the compiler makes sync_compare_and_swap
+ builtins available. */
+#ifdef HAVE_sync_compare_and_swapqi
+ if (HAVE_sync_compare_and_swapqi)
+ cpp_define (pfile, "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1");
+#endif
+
+#ifdef HAVE_sync_compare_and_swaphi
+ if (HAVE_sync_compare_and_swaphi)
+ cpp_define (pfile, "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2");
+#endif
+
+#ifdef HAVE_sync_compare_and_swapsi
+ if (HAVE_sync_compare_and_swapsi)
+ cpp_define (pfile, "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4");
+#endif
+
+#ifdef HAVE_sync_compare_and_swapdi
+ if (HAVE_sync_compare_and_swapdi)
+ cpp_define (pfile, "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8");
+#endif
+
+#ifdef HAVE_sync_compare_and_swapti
+ if (HAVE_sync_compare_and_swapti)
+ cpp_define (pfile, "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16");
+#endif
+
/* Make the choice of ObjC runtime visible to source code. */
if (c_dialect_objc () && flag_next_runtime)
cpp_define (pfile, "__NEXT_RUNTIME__");