5ea879a
# HG changeset patch
5ea879a
# User glaubitz
5ea879a
# Date 1524889690 -3600
5ea879a
#      Sat Apr 28 05:28:10 2018 +0100
5ea879a
# Node ID be1379a186ba527b32c93a83e04c9600735fe44b
5ea879a
# Parent  91ab2eac9856ec86c16c0bedd32e0b87974ead6f
5ea879a
8186461, PR3557: Zero's atomic_copy64() should use SPE instructions on linux-powerpcspe
5ea879a
Reviewed-by: aph
5ea879a
5ea879a
diff --git openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp
5ea879a
--- openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp
5ea879a
+++ openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp
5ea879a
@@ -36,12 +36,18 @@
5ea879a
 
5ea879a
   // Atomically copy 64 bits of data
5ea879a
   static void atomic_copy64(volatile void *src, volatile void *dst) {
5ea879a
-#if defined(PPC32)
5ea879a
+#if defined(PPC32) && !defined(__SPE__)
5ea879a
     double tmp;
5ea879a
     asm volatile ("lfd  %0, %2\n"
5ea879a
                   "stfd %0, %1\n"
5ea879a
                   : "=&f"(tmp), "=Q"(*(volatile double*)dst)
5ea879a
                   : "Q"(*(volatile double*)src));
5ea879a
+#elif defined(PPC32) && defined(__SPE__)
5ea879a
+    long tmp;
5ea879a
+    asm volatile ("evldd  %0, %2\n"
5ea879a
+                  "evstdd %0, %1\n"
5ea879a
+                  : "=&r"(tmp), "=Q"(*(volatile long*)dst)
5ea879a
+                  : "Q"(*(volatile long*)src));
5ea879a
 #elif defined(S390) && !defined(_LP64)
5ea879a
     double tmp;
5ea879a
     asm volatile ("ld  %0, 0(%1)\n"