r239176 - Revert accidental commit
David Majnemer
david.majnemer at gmail.com
Fri Jun 5 11:24:55 PDT 2015
Author: majnemer
Date: Fri Jun 5 13:24:55 2015
New Revision: 239176
URL: http://llvm.org/viewvc/llvm-project?rev=239176&view=rev
Log:
Revert accidental commit
This change was unrelated to r239170.
Modified:
cfe/trunk/lib/Headers/Intrin.h
Modified: cfe/trunk/lib/Headers/Intrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/Intrin.h?rev=239176&r1=239175&r2=239176&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/Intrin.h (original)
+++ cfe/trunk/lib/Headers/Intrin.h Fri Jun 5 13:24:55 2015
@@ -546,8 +546,13 @@ _bittestandset(long *a, long b) {
#if defined(__i386__) || defined(__x86_64__)
static __inline__ unsigned char __attribute__((__always_inline__, __nodebug__))
_interlockedbittestandset(long volatile *__BitBase, long __BitPos) {
- long __OldVal = __atomic_fetch_or(__BitBase, 1 << __BitPos, 5);
- return (__OldVal >> __BitPos) & 1;
+ unsigned char __Res;
+ __asm__ ("xor %0, %0\n"
+ "lock bts %2, %1\n"
+ "setc %0\n"
+ : "=r" (__Res), "+m"(*__BitBase)
+ : "Ir"(__BitPos));
+ return __Res;
}
#endif
#ifdef __x86_64__
More information about the cfe-commits
mailing list