Use intrinsics for RWSpinLock when on MSVC.
authorOrvid King <blah38621@gmail.com>
Tue, 28 Jul 2015 21:26:48 +0000 (14:26 -0700)
committerfacebook-github-bot-1 <folly-bot@fb.com>
Tue, 28 Jul 2015 22:22:25 +0000 (15:22 -0700)
Summary: Closes #261

Reviewed By: @yfeldblum

Differential Revision: D2283554

Pulled By: @sgolemon

folly/RWSpinLock.h

index 6cb331cf4d2552c8b95db9fd35c138d82b63d2ad..359343f80c1536d6c310d8f21cb6a10fc246aef4 100644 (file)
@@ -123,10 +123,12 @@ pthread_rwlock_t Read        728698     24us       101ns     7.28ms     194us
 #if defined(__GNUC__) && \
   (defined(__i386) || FOLLY_X64 || \
    defined(ARCH_K8))
-#define RW_SPINLOCK_USE_X86_INTRINSIC_
-#include <x86intrin.h>
+# define RW_SPINLOCK_USE_X86_INTRINSIC_
+# include <x86intrin.h>
+#elif defined(_MSC_VER) && defined(FOLLY_X64)
+# define RW_SPINLOCK_USE_X86_INTRINSIC_
 #else
-#undef RW_SPINLOCK_USE_X86_INTRINSIC_
+# undef RW_SPINLOCK_USE_X86_INTRINSIC_
 #endif
 
 // iOS doesn't define _mm_cvtsi64_si128 and friends