Hi,

Andres mentioned in passing that he'd defined
PG_HAVE_8BYTE_SINGLE_COPY_ATOMICITY only on Itanium, PPC and x86 but
not ARM.

I took a look at https://developer.arm.com/documentation/ddi0487/gb/
under "B2.2.1 Requirements for single-copy atomicity" and it seemed
like we should turn this on for __aarch64__.  It goes back to the
original ARMv8-A so should cover all 64 bit ARM systems.
From 1721c7b15b132c2aa16b18cf0b3eea054247833d Mon Sep 17 00:00:00 2001
From: Thomas Munro <thomas.mu...@gmail.com>
Date: Wed, 3 Nov 2021 10:23:33 +1300
Subject: [PATCH] AArch64 has single-copy 64 bit atomicity.

This avoids using more expensive atomic operations when plain loads and
stores would do.
---
 src/include/port/atomics/arch-arm.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/include/port/atomics/arch-arm.h b/src/include/port/atomics/arch-arm.h
index efa385321e..a5b84baa71 100644
--- a/src/include/port/atomics/arch-arm.h
+++ b/src/include/port/atomics/arch-arm.h
@@ -24,3 +24,8 @@
 #if !defined(__aarch64__) && !defined(__aarch64)
 #define PG_DISABLE_64_BIT_ATOMICS
 #endif  /* __aarch64__ || __aarch64 */
+
+#if defined(__aarch64__)
+/* per architecture manual doubleword accesses have single copy atomicity */
+#define PG_HAVE_8BYTE_SINGLE_COPY_ATOMICITY
+#endif
-- 
2.25.1

Reply via email to