projects
/
postgresql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
80f8eb7
)
For ppc gcc, implement 64-bit compare_exchange and fetch_add with asm.
author
Noah Misch
<
[email protected]
>
Mon, 12 Oct 2020 04:31:37 +0000
(21:31 -0700)
committer
Noah Misch
<
[email protected]
>
Mon, 12 Oct 2020 04:31:37 +0000
(21:31 -0700)
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/
20201011051043
[email protected]
src/include/port/atomics/arch-ppc.h
patch
|
blob
|
blame
|
history
diff --git
a/src/include/port/atomics/arch-ppc.h
b/src/include/port/atomics/arch-ppc.h
index fdfe0d0cd5f44aaae333f3503831c1ff3ef70335..68e66033ad7addb6e8839ba60ce113aee78e29d4 100644
(file)
--- 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 */
-#if
def __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