diff options
Diffstat (limited to 'src/include/storage/s_lock.h')
-rw-r--r-- | src/include/storage/s_lock.h | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h index 1e1eb324b43..c4a19b2f433 100644 --- a/src/include/storage/s_lock.h +++ b/src/include/storage/s_lock.h @@ -250,71 +250,6 @@ spin_delay(void) #endif /* __x86_64__ */ -#if defined(__ia64__) || defined(__ia64) -/* - * Intel Itanium, gcc or Intel's compiler. - * - * Itanium has weak memory ordering, but we rely on the compiler to enforce - * strict ordering of accesses to volatile data. In particular, while the - * xchg instruction implicitly acts as a memory barrier with 'acquire' - * semantics, we do not have an explicit memory fence instruction in the - * S_UNLOCK macro. We use a regular assignment to clear the spinlock, and - * trust that the compiler marks the generated store instruction with the - * ".rel" opcode. - * - * Testing shows that assumption to hold on gcc, although I could not find - * any explicit statement on that in the gcc manual. In Intel's compiler, - * the -m[no-]serialize-volatile option controls that, and testing shows that - * it is enabled by default. - * - * While icc accepts gcc asm blocks on x86[_64], this is not true on ia64 - * (at least not in icc versions before 12.x). So we have to carry a separate - * compiler-intrinsic-based implementation for it. - */ -#define HAS_TEST_AND_SET - -typedef unsigned int slock_t; - -#define TAS(lock) tas(lock) - -/* On IA64, it's a win to use a non-locking test before the xchg proper */ -#define TAS_SPIN(lock) (*(lock) ? 1 : TAS(lock)) - -#ifndef __INTEL_COMPILER - -static __inline__ int -tas(volatile slock_t *lock) -{ - long int ret; - - __asm__ __volatile__( - " xchg4 %0=%1,%2 \n" -: "=r"(ret), "+m"(*lock) -: "r"(1) -: "memory"); - return (int) ret; -} - -#else /* __INTEL_COMPILER */ - -static __inline__ int -tas(volatile slock_t *lock) -{ - int ret; - - ret = _InterlockedExchange(lock,1); /* this is a xchg asm macro */ - - return ret; -} - -/* icc can't use the regular gcc S_UNLOCK() macro either in this case */ -#define S_UNLOCK(lock) \ - do { __memory_barrier(); *(lock) = 0; } while (0) - -#endif /* __INTEL_COMPILER */ -#endif /* __ia64__ || __ia64 */ - - /* * On ARM and ARM64, we use __sync_lock_test_and_set(int *, int) if available. * |