From 1b159c5602737076356b862a8d2205bb13b34909 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Tue, 26 Jul 2011 17:46:13 +0400 Subject: gc6.3alpha4 tarball import --- include/private/gc_locks.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include/private/gc_locks.h') 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 +# 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 -- cgit v1.2.1