* [committed] Define HAVE_sync_compare_and_swap* on hppa-linux
@ 2014-07-18 1:02 John David Anglin
0 siblings, 0 replies; only message in thread
From: John David Anglin @ 2014-07-18 1:02 UTC (permalink / raw)
To: GCC Patches; +Cc: libstdc++
[-- Attachment #1: Type: text/plain, Size: 297 bytes --]
The attached change enables future support using the kernel assisted
atomic support. It's a bit
of a fudge since the libcall routines are not lock free, but
everything appears to work.
Tested on hppa-unknown-linux-gnu. Committed to trunk.
Dave
--
John David Anglin dave.anglin@bell.net
[-- Attachment #2: pa-linux.h.d.txt --]
[-- Type: text/plain, Size: 1396 bytes --]
2014-07-17 John David Anglin <danglin@gcc.gnu.org>
* config/pa/pa-linux.h (TARGET_OS_CPP_BUILTINS): Remove defines for
__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1, __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2
and __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4.
(HAVE_sync_compare_and_swapqi): Define.
(HAVE_sync_compare_and_swaphi): Likewise.
(HAVE_sync_compare_and_swapsi): Likewise.
Index: config/pa/pa-linux.h
===================================================================
--- config/pa/pa-linux.h (revision 212767)
+++ config/pa/pa-linux.h (working copy)
@@ -22,9 +22,6 @@
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
- builtin_define ("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1"); \
- builtin_define ("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2"); \
- builtin_define ("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4"); \
GNU_USER_TARGET_OS_CPP_BUILTINS(); \
builtin_assert ("machine=bigendian"); \
} \
@@ -133,3 +130,13 @@
#undef TARGET_SYNC_LIBCALL
#define TARGET_SYNC_LIBCALL 1
+
+/* The SYNC operations are implemented as library functions, not
+ INSN patterns. As a result, the HAVE defines for the patterns are
+ not defined. We need to define them to generate the corresponding
+ __GCC_HAVE_SYNC_COMPARE_AND_SWAP_* and __GCC_ATOMIC_*_LOCK_FREE
+ defines. */
+
+#define HAVE_sync_compare_and_swapqi 1
+#define HAVE_sync_compare_and_swaphi 1
+#define HAVE_sync_compare_and_swapsi 1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-07-17 23:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-18 1:02 [committed] Define HAVE_sync_compare_and_swap* on hppa-linux John David Anglin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).