hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Move.java
changeset 46680 2894e4262fd6
parent 46536 79d8dffda212
--- a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Move.java	Mon Jul 17 09:21:48 2017 -0700
+++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Move.java	Mon Jul 17 16:31:51 2017 -0700
@@ -435,8 +435,9 @@
             try (ScratchRegister r2 = masm.getScratchRegister()) {
                 Register rscratch1 = r1.getRegister();
                 Register rscratch2 = r2.getRegister();
+                // use the slot kind to define the operand size
                 PlatformKind kind = input.getPlatformKind();
-                final int size = kind.getSizeInBytes() <= 4 ? 32 : 64;
+                final int size = kind.getSizeInBytes() * Byte.SIZE;
 
                 // Always perform stack -> stack copies through integer registers
                 crb.blockComment("[stack -> stack copy]");
@@ -466,8 +467,9 @@
     private static void reg2stack(CompilationResultBuilder crb, AArch64MacroAssembler masm, AllocatableValue result, AllocatableValue input) {
         AArch64Address dest = loadStackSlotAddress(crb, masm, asStackSlot(result), Value.ILLEGAL);
         Register src = asRegister(input);
-        AArch64Kind kind = (AArch64Kind) input.getPlatformKind();
-        int size = kind.getSizeInBytes() * Byte.SIZE;
+        // use the slot kind to define the operand size
+        AArch64Kind kind = (AArch64Kind) result.getPlatformKind();
+        final int size = kind.getSizeInBytes() * Byte.SIZE;
         if (kind.isInteger()) {
             masm.str(size, src, dest);
         } else {
@@ -477,6 +479,7 @@
 
     private static void stack2reg(CompilationResultBuilder crb, AArch64MacroAssembler masm, AllocatableValue result, AllocatableValue input) {
         AArch64Kind kind = (AArch64Kind) input.getPlatformKind();
+        // use the slot kind to define the operand size
         final int size = kind.getSizeInBytes() * Byte.SIZE;
         if (kind.isInteger()) {
             AArch64Address src = loadStackSlotAddress(crb, masm, asStackSlot(input), result);