summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoah Misch2020-10-12 04:31:37 +0000
committerNoah Misch2020-10-12 04:31:37 +0000
commitf5c1167b173d6e7a5d4c938fe716f0d29ae7228d (patch)
tree377ddd8d4a6af5912322d0fa7562af50889faf91
parent80f8eb79e24d9b7963eaf17ce846667e2c6b6e6f (diff)
For ppc gcc, implement 64-bit compare_exchange and fetch_add with asm.
While xlc defines __64BIT__, gcc does not. Due to this oversight in commit 30ee5d17c20dbb282a9952b3048d6ad52d56c371, gcc builds continued implementing 64-bit atomics by way of intrinsics. Back-patch to v13, where that commit first appeared. Reviewed by Tom Lane. Discussion: https://postgr.es/m/[email protected]
-rw-r--r--src/include/port/atomics/arch-ppc.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/include/port/atomics/arch-ppc.h b/src/include/port/atomics/arch-ppc.h
index fdfe0d0cd5f..68e66033ad7 100644
--- a/src/include/port/atomics/arch-ppc.h
+++ b/src/include/port/atomics/arch-ppc.h
@@ -32,14 +32,14 @@ typedef struct pg_atomic_uint32
} pg_atomic_uint32;
/* 64bit atomics are only supported in 64bit mode */
-#ifdef __64BIT__
+#if SIZEOF_VOID_P >= 8
#define PG_HAVE_ATOMIC_U64_SUPPORT
typedef struct pg_atomic_uint64
{
volatile uint64 value pg_attribute_aligned(8);
} pg_atomic_uint64;
-#endif /* __64BIT__ */
+#endif
/*
* This mimics gcc __atomic_compare_exchange_n(..., __ATOMIC_SEQ_CST), but