diff mbox series

C-SKY: Define HAVE_sync_compare_and_swap*.

Message ID 20210528100712.47453-1-xianmiao_qu@c-sky.com
State New
Headers show
Series C-SKY: Define HAVE_sync_compare_and_swap*. | expand

Commit Message

Xianmiao Qu May 28, 2021, 10:07 a.m. UTC
From: Cooper Qu <cooper.qu@linux.alibaba.com>

Tested and pushed.

The SYNC operations are implemented as library functions, not
NSN 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.

gcc/
	* config/csky/csky-linux-elf.h (HAVE_sync_compare_and_swapqi):
	Defined.
	(HAVE_sync_compare_and_swaphi): Likewise.
	(HAVE_sync_compare_and_swapsi): Likewise.
---
 gcc/config/csky/csky-linux-elf.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/gcc/config/csky/csky-linux-elf.h b/gcc/config/csky/csky-linux-elf.h
index 58a1f3978b1..e94eb8c579e 100644
--- a/gcc/config/csky/csky-linux-elf.h
+++ b/gcc/config/csky/csky-linux-elf.h
@@ -133,3 +133,13 @@ 
 #ifdef IN_LIBGCC2
 extern int cacheflush (void *__addr, const int __nbytes, const int __op);
 #endif
+
+/* 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