summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
ff18dea)
Summary:
While trying to build folly on aarch64 found that the SharedMutexTest
wouldn't build because it uses RWTicketSpinLock which was only available
on x86 platforms. Updated to allow build on aarch64 after suggestion by Orvid
Reviewed By: yfeldblum
Differential Revision:
D6611609
fbshipit-source-id:
8ec477cdedac0f0a705608bbac42dd63b3efb919
#include <x86intrin.h>
#elif defined(_MSC_VER) && defined(FOLLY_X64)
#define RW_SPINLOCK_USE_X86_INTRINSIC_
#include <x86intrin.h>
#elif defined(_MSC_VER) && defined(FOLLY_X64)
#define RW_SPINLOCK_USE_X86_INTRINSIC_
+#elif FOLLY_AARCH64
+#define RW_SPINLOCK_USE_X86_INTRINSIC_
#else
#undef RW_SPINLOCK_USE_X86_INTRINSIC_
#endif
#else
#undef RW_SPINLOCK_USE_X86_INTRINSIC_
#endif
void unlock() {
RWTicket t;
t.whole = load_acquire(&ticket.whole);
void unlock() {
RWTicket t;
t.whole = load_acquire(&ticket.whole);
#ifdef RW_SPINLOCK_USE_SSE_INSTRUCTIONS_
#ifdef RW_SPINLOCK_USE_SSE_INSTRUCTIONS_
// SSE2 can reduce the lock and unlock overhead by 10%
static const QuarterInt kDeltaBuf[4] = { 1, 1, 0, 0 }; // write/read/user
static const __m128i kDelta = IntTraitType::make128(kDeltaBuf);
// SSE2 can reduce the lock and unlock overhead by 10%
static const QuarterInt kDeltaBuf[4] = { 1, 1, 0, 0 }; // write/read/user
static const __m128i kDelta = IntTraitType::make128(kDeltaBuf);