[aarch64-port-dev ] Remove cruft. Replace with a portable definition of atomic_copy64().

Andrew Haley aph at redhat.com
Wed Oct 1 18:18:39 UTC 2014


We now have a portable way to do atomic_copy64; no need for random bits
of assembler.

Andrew.


# HG changeset patch
# User aph
# Date 1412182305 14400
#      Wed Oct 01 12:51:45 2014 -0400
# Node ID b43b612fe37291952d164b7e3dcee6ae760ade42
# Parent  a451588d3506f985bd2e83748c33331d8d6cb391
Remove cruft.  Replace with a portable definition of atomic_copy64().

diff -r a451588d3506 -r b43b612fe372 src/os_cpu/linux_aarch64/vm/os_linux_aarch64.hpp
--- a/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.hpp	Wed Oct 01 12:47:06 2014 -0400
+++ b/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.hpp	Wed Oct 01 12:51:45 2014 -0400
@@ -38,21 +38,9 @@

   // Atomically copy 64 bits of data
   static void atomic_copy64(volatile void *src, volatile void *dst) {
-#if defined(PPC) && !defined(_LP64)
-    double tmp;
-    asm volatile ("lfd  %0, 0(%1)\n"
-                  "stfd %0, 0(%2)\n"
-                  : "=f"(tmp)
-                  : "b"(src), "b"(dst));
-#elif defined(S390) && !defined(_LP64)
-    double tmp;
-    asm volatile ("ld  %0, 0(%1)\n"
-                  "std %0, 0(%2)\n"
-                  : "=r"(tmp)
-                  : "a"(src), "a"(dst));
-#else
-    *(jlong *) dst = *(jlong *) src;
-#endif
+    jlong data;
+    __atomic_load((jlong*)src, &data, __ATOMIC_RELAXED);
+    __atomic_store((jlong*)dst, &data, __ATOMIC_RELAXED);
   }

 #endif // OS_CPU_LINUX_AARCH64_VM_OS_LINUX_AARCH64_HPP


More information about the aarch64-port-dev mailing list