summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--ChangeLog5
-rw-r--r--lib/asyncsafe-spin.c5
-rw-r--r--lib/simple-atomic.c5
3 files changed, 15 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index b915b7d..9f6818c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
12021-03-03 Bruno Haible <bruno@clisp.org> 12021-03-03 Bruno Haible <bruno@clisp.org>
2 2
3 asyncsafe-spin, simple-atomic: Add support for tcc/x86.
4 * lib/asyncsafe-spin.c (memory_barrier): With tcc/x86, don't use the
5 'mfence' instruction.
6 * lib/simple-atomic.c (memory_barrier): Likewise.
7
3 asyncsafe-spin, simple-atomic: Add support for tcc. 8 asyncsafe-spin, simple-atomic: Add support for tcc.
4 * lib/asyncsafe-spin.c (memory_barrier, atomic_compare_and_swap): On 9 * lib/asyncsafe-spin.c (memory_barrier, atomic_compare_and_swap): On
5 i386 and x86_64, treat tcc like older GCC or clang. 10 i386 and x86_64, treat tcc like older GCC or clang.
diff --git a/lib/asyncsafe-spin.c b/lib/asyncsafe-spin.c
index cece623..d0cdb39 100644
--- a/lib/asyncsafe-spin.c
+++ b/lib/asyncsafe-spin.c
@@ -202,7 +202,12 @@ memory_barrier (void)
202{ 202{
203# if defined __GNUC__ || defined __clang__ || __SUNPRO_C >= 0x590 || defined __TINYC__ 203# if defined __GNUC__ || defined __clang__ || __SUNPRO_C >= 0x590 || defined __TINYC__
204# if defined __i386 || defined __x86_64__ 204# if defined __i386 || defined __x86_64__
205# if defined __TINYC__ && defined __i386
206 /* Cannot use the SSE instruction "mfence" with this compiler. */
207 asm volatile ("lock orl $0,(%esp)");
208# else
205 asm volatile ("mfence"); 209 asm volatile ("mfence");
210# endif
206# endif 211# endif
207# if defined __sparc 212# if defined __sparc
208 asm volatile ("membar 2"); 213 asm volatile ("membar 2");
diff --git a/lib/simple-atomic.c b/lib/simple-atomic.c
index 4d5a0d8..7c4f7e9 100644
--- a/lib/simple-atomic.c
+++ b/lib/simple-atomic.c
@@ -197,7 +197,12 @@ memory_barrier (void)
197{ 197{
198# if defined __GNUC__ || defined __clang__ || __SUNPRO_C >= 0x590 || defined __TINYC__ 198# if defined __GNUC__ || defined __clang__ || __SUNPRO_C >= 0x590 || defined __TINYC__
199# if defined __i386 || defined __x86_64__ 199# if defined __i386 || defined __x86_64__
200# if defined __TINYC__ && defined __i386
201 /* Cannot use the SSE instruction "mfence" with this compiler. */
202 asm volatile ("lock orl $0,(%esp)");
203# else
200 asm volatile ("mfence"); 204 asm volatile ("mfence");
205# endif
201# endif 206# endif
202# if defined __sparc 207# if defined __sparc
203 asm volatile ("membar 2"); 208 asm volatile ("membar 2");

Return to:

Send suggestions and report system problems to the System administrator.