Skip to content

Commit f5c1167

Browse files
committed
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 30ee5d1, 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.GA1724101@rfd.leadboat.com
1 parent 80f8eb7 commit f5c1167

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/include/port/atomics/arch-ppc.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ typedef struct pg_atomic_uint32
3232
} pg_atomic_uint32;
3333

3434
/* 64bit atomics are only supported in 64bit mode */
35-
#ifdef __64BIT__
35+
#if SIZEOF_VOID_P >= 8
3636
#define PG_HAVE_ATOMIC_U64_SUPPORT
3737
typedef struct pg_atomic_uint64
3838
{
3939
volatile uint64 value pg_attribute_aligned(8);
4040
} pg_atomic_uint64;
4141

42-
#endif /* __64BIT__ */
42+
#endif
4343

4444
/*
4545
* This mimics gcc __atomic_compare_exchange_n(..., __ATOMIC_SEQ_CST), but

0 commit comments

Comments
 (0)