[llvm-commits] [compiler-rt] r159447 - /compiler-rt/trunk/lib/sanitizer_common/sanitizer_atomic_msvc.h

Dmitry Vyukov dvyukov at google.com
Fri Jun 29 11:28:02 PDT 2012


Author: dvyukov
Date: Fri Jun 29 13:28:02 2012
New Revision: 159447

URL: http://llvm.org/viewvc/llvm-project?rev=159447&view=rev
Log:
tsan/asan: second attemp on msvc atomics

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_atomic_msvc.h

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_atomic_msvc.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_atomic_msvc.h?rev=159447&r1=159446&r2=159447&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_atomic_msvc.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_atomic_msvc.h Fri Jun 29 13:28:02 2012
@@ -15,7 +15,14 @@
 #ifndef SANITIZER_ATOMIC_MSVC_H
 #define SANITIZER_ATOMIC_MSVC_H
 
-#include <intrin.h>
+void _ReadWriteBarrier();
+#pragma intrinsic(_ReadWriteBarrier)
+void _mm_mfence();
+#pragma intrinsic(_mm_mfence)
+void _mm_pause();
+#pragma intrinsic(_mm_pause)
+long _InterlockedExchangeAdd(long volatile * Addend, long Value);  // NOLINT
+#pragma intrinsic(_InterlockedExchangeAdd)
 
 namespace __sanitizer {
 
@@ -79,9 +86,9 @@
   DCHECK(!((uptr)a % sizeof(*a)));
   __asm {
     mov eax, a
-    mov cx, v
-    xchg [eax], cx  // NOLINT
-    mov v, cx
+    mov cl, v
+    xchg [eax], cl  // NOLINT
+    mov v, cl
   }
   return v;
 }
@@ -92,9 +99,9 @@
   DCHECK(!((uptr)a % sizeof(*a)));
   __asm {
     mov eax, a
-    mov cl, v
-    xchg [eax], cl  // NOLINT
-    mov v, cl
+    mov cx, v
+    xchg [eax], cx  // NOLINT
+    mov v, cx
   }
   return v;
 }





More information about the llvm-commits mailing list