changeset 8867:b2fa3e69edc9

8201509: Zero: S390 31bit atomic_copy64 inline assembler is wrong Summary: The inline assembler for the S390 (S390 and not _LP64) has src and dst reversed thereby corrupting data Reviewed-by: shade Contributed-by: Martin Balao <mbalao@redhat.com>
author chrisphi
date Wed, 25 Apr 2018 12:21:29 -0400
parents 615bfd32b82d
children 5792d995ed26
files src/os_cpu/linux_zero/vm/os_linux_zero.hpp
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/os_cpu/linux_zero/vm/os_linux_zero.hpp	Fri Nov 24 12:16:25 2017 +0100
+++ b/src/os_cpu/linux_zero/vm/os_linux_zero.hpp	Wed Apr 25 12:21:29 2018 -0400
@@ -50,10 +50,10 @@
                   : "Q"(*(volatile long*)src));
 #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));
+    asm volatile ("ld  %0, %2\n"
+                  "std %0, %1\n"
+                  : "=&f"(tmp), "=Q"(*(volatile double*)dst)
+                  : "Q"(*(volatile double*)src));
 #else
     *(jlong *) dst = *(jlong *) src;
 #endif