summaryrefslogtreecommitdiff
path: root/include/private/gc_locks.h
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2011-07-26 17:46:13 +0400
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 17:46:13 +0400
commit1b159c5602737076356b862a8d2205bb13b34909 (patch)
tree5f2cfffa8f8ab056fdd895285801a006519be135 /include/private/gc_locks.h
parent8c9e394bc270dbaa121f3f0af5a68c2876ab3fff (diff)
downloadbdwgc-1b159c5602737076356b862a8d2205bb13b34909.tar.gz
gc6.3alpha4 tarball importgc6_3alpha4
Diffstat (limited to 'include/private/gc_locks.h')
-rw-r--r--include/private/gc_locks.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/private/gc_locks.h b/include/private/gc_locks.h
index a079ebf8..df8043b6 100644
--- a/include/private/gc_locks.h
+++ b/include/private/gc_locks.h
@@ -100,17 +100,29 @@
# define GC_TEST_AND_SET_DEFINED
# endif
# if defined(IA64)
+# if defined(__INTEL_COMPILER)
+# include <ia64intrin.h>
+# endif
inline static int GC_test_and_set(volatile unsigned int *addr) {
long oldval, n = 1;
+# ifndef __INTEL_COMPILER
__asm__ __volatile__("xchg4 %0=%1,%2"
: "=r"(oldval), "=m"(*addr)
: "r"(n), "1"(*addr) : "memory");
+# else
+ oldval = _InterlockedExchange(addr, n);
+# endif
return oldval;
}
# define GC_TEST_AND_SET_DEFINED
/* Should this handle post-increment addressing?? */
inline static void GC_clear(volatile unsigned int *addr) {
+# ifndef __INTEL_COMPILER
__asm__ __volatile__("st4.rel %0=r0" : "=m" (*addr) : : "memory");
+# else
+ // there is no st4 but I can use xchg I hope
+ _InterlockedExchange(addr, 0);
+# endif
}
# define GC_CLEAR_DEFINED
# endif