From 4b019355d99d1ddcc80c0d77da4e1f7540ae6ec0 Mon Sep 17 00:00:00 2001 From: Orvid King Date: Tue, 28 Jul 2015 14:26:48 -0700 Subject: [PATCH] Use intrinsics for RWSpinLock when on MSVC. Summary: Closes #261 Reviewed By: @yfeldblum Differential Revision: D2283554 Pulled By: @sgolemon --- folly/RWSpinLock.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/folly/RWSpinLock.h b/folly/RWSpinLock.h index 6cb331cf..359343f8 100644 --- a/folly/RWSpinLock.h +++ b/folly/RWSpinLock.h @@ -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 +# define RW_SPINLOCK_USE_X86_INTRINSIC_ +# include +#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 -- 2.34.1