changeset 8866:615bfd32b82d

8186461: Zero's atomic_copy64() should use SPE instructions on linux-powerpcspe Reviewed-by: aph
author glaubitz
date Fri, 24 Nov 2017 12:16:25 +0100
parents 282043788706
children b2fa3e69edc9
files src/os_cpu/linux_zero/vm/os_linux_zero.hpp
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/os_cpu/linux_zero/vm/os_linux_zero.hpp	Wed Aug 02 17:22:40 2017 +0100
+++ b/src/os_cpu/linux_zero/vm/os_linux_zero.hpp	Fri Nov 24 12:16:25 2017 +0100
@@ -36,12 +36,18 @@
 
   // Atomically copy 64 bits of data
   static void atomic_copy64(volatile void *src, volatile void *dst) {
-#if defined(PPC32)
+#if defined(PPC32) && !defined(__SPE__)
     double tmp;
     asm volatile ("lfd  %0, %2\n"
                   "stfd %0, %1\n"
                   : "=&f"(tmp), "=Q"(*(volatile double*)dst)
                   : "Q"(*(volatile double*)src));
+#elif defined(PPC32) && defined(__SPE__)
+    long tmp;
+    asm volatile ("evldd  %0, %2\n"
+                  "evstdd %0, %1\n"
+                  : "=&r"(tmp), "=Q"(*(volatile long*)dst)
+                  : "Q"(*(volatile long*)src));
 #elif defined(S390) && !defined(_LP64)
     double tmp;
     asm volatile ("ld  %0, 0(%1)\n"