Blame jdk8186461-pr3557-zeros_atomic_copy64_should_use_spe_instructions_on_linux_powerpcspe.patch

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