changeset 52980:6ee9500fe653

8211387: [Zero] atomic_copy64: Use ldrexd for atomic reads on ARMv7 Reviewed-by: dholmes, aph Contributed-by: Andrew Haley <aph@redhat.com>
author sgehwolf
date Tue, 02 Oct 2018 17:17:43 +0200
parents a42c378b6f01
children e25291a90cba
files src/hotspot/os_cpu/linux_zero/os_linux_zero.hpp
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/os_cpu/linux_zero/os_linux_zero.hpp	Tue Oct 09 07:06:32 2018 +0100
+++ b/src/hotspot/os_cpu/linux_zero/os_linux_zero.hpp	Tue Oct 02 17:17:43 2018 +0200
@@ -54,6 +54,16 @@
                   "std %0, %1\n"
                   : "=&f"(tmp), "=Q"(*(volatile double*)dst)
                   : "Q"(*(volatile double*)src));
+#elif defined(__ARM_ARCH_7A__)
+    // Note that a ldrexd + clrex combination is only needed for
+    // correctness on the OS level (context-switches). In this
+    // case, clrex *may* be beneficial for performance. For now
+    // don't bother with clrex as this is Zero.
+    jlong tmp;
+    asm volatile ("ldrexd  %0, [%1]\n"
+                  : "=r"(tmp)
+                  : "r"(src), "m"(src));
+    *(jlong *) dst = tmp;
 #else
     *(jlong *) dst = *(const jlong *) src;
 #endif