changeset 22655:8372e2859f3a

Update jvmci import: Use AMD64Kind instead of JavaKind in backend.
author Roland Schatz <roland.schatz@oracle.com>
date Fri, 18 Sep 2015 13:12:02 +0200
parents 4fca22325604
children 475ce82f1cdd
files graal/com.oracle.graal.asm.amd64/src/com/oracle/graal/asm/amd64/AMD64MacroAssembler.java graal/com.oracle.graal.compiler.amd64.test/src/com/oracle/graal/compiler/amd64/test/StackStoreTest.java graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRKindTool.java graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64NodeLIRBuilder.java graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBytecodeLIRBuilder.java graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRKindTool.java graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotMove.java graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Arithmetic.java graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ArrayEqualsOp.java graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ByteSwapOp.java graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Call.java graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ControlFlow.java graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64FrameMap.java graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64MathIntrinsicOp.java graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java graal/com.oracle.graal.lir.jtt/src/com/oracle/graal/lir/jtt/ConstantStackCastTest.java graal/com.oracle.graal.lir.jtt/src/com/oracle/graal/lir/jtt/StackMoveTest.java graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/GenericValueMapTest.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/LIRGenerator.java graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/DirectReadNode.java mx.graal/suite.py
diffstat 25 files changed, 574 insertions(+), 493 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.asm.amd64/src/com/oracle/graal/asm/amd64/AMD64MacroAssembler.java	Fri Sep 18 11:41:06 2015 +0200
+++ b/graal/com.oracle.graal.asm.amd64/src/com/oracle/graal/asm/amd64/AMD64MacroAssembler.java	Fri Sep 18 13:12:02 2015 +0200
@@ -26,10 +26,10 @@
 import static com.oracle.graal.asm.amd64.AMD64AsmOptions.UseXmmLoadAndClearUpper;
 import static com.oracle.graal.asm.amd64.AMD64AsmOptions.UseXmmRegToRegMoveAll;
 import jdk.internal.jvmci.amd64.AMD64;
+import jdk.internal.jvmci.amd64.AMD64Kind;
 import jdk.internal.jvmci.code.Register;
 import jdk.internal.jvmci.code.RegisterConfig;
 import jdk.internal.jvmci.code.TargetDescription;
-import jdk.internal.jvmci.meta.JavaKind;
 
 import com.oracle.graal.asm.NumUtil;
 
@@ -309,7 +309,7 @@
     private AMD64Address trigPrologue(Register value) {
         assert value.getRegisterCategory().equals(AMD64.XMM);
         AMD64Address tmp = new AMD64Address(AMD64.rsp);
-        subq(AMD64.rsp, target.getSizeInBytes(JavaKind.Double));
+        subq(AMD64.rsp, AMD64Kind.DOUBLE.getSizeInBytes());
         movdbl(tmp, value);
         fldd(tmp);
         return tmp;
@@ -319,6 +319,6 @@
         assert dest.getRegisterCategory().equals(AMD64.XMM);
         fstpd(tmp);
         movdbl(dest, tmp);
-        addq(AMD64.rsp, target.getSizeInBytes(JavaKind.Double));
+        addq(AMD64.rsp, AMD64Kind.DOUBLE.getSizeInBytes());
     }
 }
--- a/graal/com.oracle.graal.compiler.amd64.test/src/com/oracle/graal/compiler/amd64/test/StackStoreTest.java	Fri Sep 18 11:41:06 2015 +0200
+++ b/graal/com.oracle.graal.compiler.amd64.test/src/com/oracle/graal/compiler/amd64/test/StackStoreTest.java	Fri Sep 18 13:12:02 2015 +0200
@@ -24,9 +24,9 @@
 
 import static org.junit.Assume.assumeTrue;
 import jdk.internal.jvmci.amd64.AMD64;
+import jdk.internal.jvmci.amd64.AMD64Kind;
 import jdk.internal.jvmci.code.StackSlotValue;
 import jdk.internal.jvmci.meta.JavaConstant;
-import jdk.internal.jvmci.meta.JavaKind;
 import jdk.internal.jvmci.meta.LIRKind;
 import jdk.internal.jvmci.meta.Value;
 
@@ -50,7 +50,7 @@
             FrameMapBuilder frameMapBuilder = gen.getResult().getFrameMapBuilder();
             // create slots
             StackSlotValue s1 = frameMapBuilder.allocateSpillSlot(a.getLIRKind());
-            StackSlotValue s2 = frameMapBuilder.allocateSpillSlot(LIRKind.value(JavaKind.Short));
+            StackSlotValue s2 = frameMapBuilder.allocateSpillSlot(LIRKind.value(AMD64Kind.WORD));
             // move stuff around
             gen.emitMove(s1, a);
             gen.emitMoveConstant(s2, JavaConstant.forShort(Short.MIN_VALUE));
@@ -66,10 +66,10 @@
             FrameMapBuilder frameMapBuilder = gen.getResult().getFrameMapBuilder();
             // create slots
             StackSlotValue s1 = frameMapBuilder.allocateSpillSlot(a.getLIRKind());
-            StackSlotValue s2 = frameMapBuilder.allocateSpillSlot(LIRKind.value(JavaKind.Short));
+            StackSlotValue s2 = frameMapBuilder.allocateSpillSlot(LIRKind.value(AMD64Kind.WORD));
             // move stuff around
             gen.emitMove(s1, a);
-            Value v = gen.emitLoadConstant(LIRKind.value(JavaKind.Short), JavaConstant.forShort(Short.MIN_VALUE));
+            Value v = gen.emitLoadConstant(LIRKind.value(AMD64Kind.WORD), JavaConstant.forShort(Short.MIN_VALUE));
             gen.emitMove(s2, v);
             setResult(gen.emitMove(s1));
             gen.emitBlackhole(s1);
@@ -83,7 +83,7 @@
             FrameMapBuilder frameMapBuilder = gen.getResult().getFrameMapBuilder();
             // create slots
             StackSlotValue s1 = frameMapBuilder.allocateSpillSlot(a.getLIRKind());
-            StackSlotValue s2 = frameMapBuilder.allocateSpillSlot(LIRKind.value(JavaKind.Short));
+            StackSlotValue s2 = frameMapBuilder.allocateSpillSlot(LIRKind.value(AMD64Kind.WORD));
             // move stuff around
             gen.emitMoveConstant(s2, JavaConstant.forShort(Short.MIN_VALUE));
             gen.emitMove(s1, a);
--- a/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java	Fri Sep 18 11:41:06 2015 +0200
+++ b/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java	Fri Sep 18 13:12:02 2015 +0200
@@ -77,6 +77,7 @@
 import java.util.Map;
 
 import jdk.internal.jvmci.amd64.AMD64;
+import jdk.internal.jvmci.amd64.AMD64Kind;
 import jdk.internal.jvmci.code.Architecture;
 import jdk.internal.jvmci.code.CallingConvention;
 import jdk.internal.jvmci.code.CodeUtil;
@@ -162,7 +163,8 @@
  */
 public abstract class AMD64LIRGenerator extends LIRGenerator implements AMD64ArithmeticLIRGenerator {
 
-    private static final RegisterValue RCX_I = AMD64.rcx.asValue(LIRKind.value(JavaKind.Int));
+    private static final RegisterValue RCX_I = AMD64.rcx.asValue(LIRKind.value(AMD64Kind.DWORD));
+
     private AMD64SpillMoveFactory moveFactory;
     private Map<PlatformKind.Key, RegisterBackupPair> categorized;
 
@@ -239,15 +241,35 @@
         }
     }
 
+    @Override
+    protected JavaConstant zapValueForKind(PlatformKind kind) {
+        long dead = 0xDEADDEADDEADDEADL;
+        switch ((AMD64Kind) kind) {
+            case BYTE:
+                return JavaConstant.forByte((byte) dead);
+            case WORD:
+                return JavaConstant.forShort((short) dead);
+            case DWORD:
+                return JavaConstant.forInt((int) dead);
+            case QWORD:
+                return JavaConstant.forLong(dead);
+            case SINGLE:
+                return JavaConstant.forFloat(Float.intBitsToFloat((int) dead));
+            default:
+                // we don't support vector types, so just zap with double for all of them
+                return JavaConstant.forDouble(Double.longBitsToDouble(dead));
+        }
+    }
+
     protected AMD64LIRInstruction createMove(AllocatableValue dst, Value src) {
         if (src instanceof AMD64AddressValue) {
             return new LeaOp(dst, (AMD64AddressValue) src);
         } else if (isJavaConstant(src)) {
             return createMoveConstant(dst, asJavaConstant(src));
         } else if (isRegister(src) || isStackSlotValue(dst)) {
-            return new MoveFromRegOp((JavaKind) dst.getPlatformKind(), dst, (AllocatableValue) src);
+            return new MoveFromRegOp((AMD64Kind) dst.getPlatformKind(), dst, (AllocatableValue) src);
         } else {
-            return new MoveToRegOp((JavaKind) dst.getPlatformKind(), dst, (AllocatableValue) src);
+            return new MoveToRegOp((AMD64Kind) dst.getPlatformKind(), dst, (AllocatableValue) src);
         }
     }
 
@@ -256,22 +278,18 @@
     }
 
     protected LIRInstruction createStackMove(AllocatableValue result, AllocatableValue input) {
-        PlatformKind kind = result.getPlatformKind();
-        OperandSize size;
-        switch (target().getSizeInBytes(kind)) {
+        AMD64Kind kind = (AMD64Kind) result.getPlatformKind();
+        switch (kind.getSizeInBytes()) {
+            case 2:
+                return new AMD64PushPopStackMove(WORD, result, input);
             case 8:
-                size = QWORD;
-                break;
-            case 2:
-                size = WORD;
-                break;
+                return new AMD64PushPopStackMove(QWORD, result, input);
             default:
                 RegisterBackupPair backup = getScratchRegister(input.getPlatformKind());
                 Register scratchRegister = backup.register;
                 StackSlotValue backupSlot = backup.backupSlot;
                 return createStackMove(result, input, scratchRegister, backupSlot);
         }
-        return new AMD64PushPopStackMove(size, result, input);
     }
 
     protected LIRInstruction createStackMove(AllocatableValue result, AllocatableValue input, Register scratchRegister, StackSlotValue backupSlot) {
@@ -342,34 +360,43 @@
         return result;
     }
 
+    /**
+     * The AMD64 backend only uses DWORD and QWORD values in registers because of a performance
+     * penalty when accessing WORD or BYTE registers. This function converts small integer kinds to
+     * DWORD.
+     */
+    @Override
+    public LIRKind toRegisterKind(LIRKind kind) {
+        switch ((AMD64Kind) kind.getPlatformKind()) {
+            case BYTE:
+            case WORD:
+                return kind.changeType(AMD64Kind.DWORD);
+            default:
+                return kind;
+        }
+    }
+
     @Override
     public Variable emitLoad(LIRKind kind, Value address, LIRFrameState state) {
         AMD64AddressValue loadAddress = asAddressValue(address);
         Variable result = newVariable(toRegisterKind(kind));
-        switch ((JavaKind) kind.getPlatformKind()) {
-            case Boolean:
-                append(new AMD64Unary.MemoryOp(MOVZXB, DWORD, result, loadAddress, state));
-                break;
-            case Byte:
+        switch ((AMD64Kind) kind.getPlatformKind()) {
+            case BYTE:
                 append(new AMD64Unary.MemoryOp(MOVSXB, DWORD, result, loadAddress, state));
                 break;
-            case Char:
-                append(new AMD64Unary.MemoryOp(MOVZX, DWORD, result, loadAddress, state));
-                break;
-            case Short:
+            case WORD:
                 append(new AMD64Unary.MemoryOp(MOVSX, DWORD, result, loadAddress, state));
                 break;
-            case Int:
+            case DWORD:
                 append(new AMD64Unary.MemoryOp(MOV, DWORD, result, loadAddress, state));
                 break;
-            case Long:
-            case Object:
+            case QWORD:
                 append(new AMD64Unary.MemoryOp(MOV, QWORD, result, loadAddress, state));
                 break;
-            case Float:
+            case SINGLE:
                 append(new AMD64Unary.MemoryOp(MOVSS, SS, result, loadAddress, state));
                 break;
-            case Double:
+            case DOUBLE:
                 append(new AMD64Unary.MemoryOp(MOVSD, SD, result, loadAddress, state));
                 break;
             default:
@@ -378,11 +405,11 @@
         return result;
     }
 
-    protected void emitStoreConst(JavaKind kind, AMD64AddressValue address, ConstantValue value, LIRFrameState state) {
-        JavaConstant c = (JavaConstant) value.getConstant();
+    protected void emitStoreConst(AMD64Kind kind, AMD64AddressValue address, ConstantValue value, LIRFrameState state) {
+        JavaConstant c = value.getJavaConstant();
         if (c.isNull()) {
-            assert kind == JavaKind.Int || kind == JavaKind.Long || kind == JavaKind.Object;
-            OperandSize size = kind == JavaKind.Int ? DWORD : QWORD;
+            assert kind == AMD64Kind.DWORD || kind == AMD64Kind.QWORD;
+            OperandSize size = kind == AMD64Kind.DWORD ? DWORD : QWORD;
             append(new AMD64BinaryConsumer.MemoryConstOp(AMD64MIOp.MOV, size, address, 0, state));
         } else {
             AMD64MIOp op = AMD64MIOp.MOV;
@@ -390,30 +417,28 @@
             long imm;
 
             switch (kind) {
-                case Boolean:
-                case Byte:
+                case BYTE:
                     op = AMD64MIOp.MOVB;
                     size = BYTE;
                     imm = c.asInt();
                     break;
-                case Char:
-                case Short:
+                case WORD:
                     size = WORD;
                     imm = c.asInt();
                     break;
-                case Int:
+                case DWORD:
                     size = DWORD;
                     imm = c.asInt();
                     break;
-                case Long:
+                case QWORD:
                     size = QWORD;
                     imm = c.asLong();
                     break;
-                case Float:
+                case SINGLE:
                     size = DWORD;
                     imm = Float.floatToRawIntBits(c.asFloat());
                     break;
-                case Double:
+                case DOUBLE:
                     size = QWORD;
                     imm = Double.doubleToRawLongBits(c.asDouble());
                     break;
@@ -429,27 +454,24 @@
         }
     }
 
-    protected void emitStore(JavaKind kind, AMD64AddressValue address, AllocatableValue value, LIRFrameState state) {
+    protected void emitStore(AMD64Kind kind, AMD64AddressValue address, AllocatableValue value, LIRFrameState state) {
         switch (kind) {
-            case Boolean:
-            case Byte:
+            case BYTE:
                 append(new AMD64BinaryConsumer.MemoryMROp(AMD64MROp.MOVB, BYTE, address, value, state));
                 break;
-            case Char:
-            case Short:
+            case WORD:
                 append(new AMD64BinaryConsumer.MemoryMROp(AMD64MROp.MOV, WORD, address, value, state));
                 break;
-            case Int:
+            case DWORD:
                 append(new AMD64BinaryConsumer.MemoryMROp(AMD64MROp.MOV, DWORD, address, value, state));
                 break;
-            case Long:
-            case Object:
+            case QWORD:
                 append(new AMD64BinaryConsumer.MemoryMROp(AMD64MROp.MOV, QWORD, address, value, state));
                 break;
-            case Float:
+            case SINGLE:
                 append(new AMD64BinaryConsumer.MemoryMROp(AMD64MROp.MOVSS, SS, address, value, state));
                 break;
-            case Double:
+            case DOUBLE:
                 append(new AMD64BinaryConsumer.MemoryMROp(AMD64MROp.MOVSD, SD, address, value, state));
                 break;
             default:
@@ -460,7 +482,7 @@
     @Override
     public void emitStore(LIRKind lirKind, Value address, Value input, LIRFrameState state) {
         AMD64AddressValue storeAddress = asAddressValue(address);
-        JavaKind kind = (JavaKind) lirKind.getPlatformKind();
+        AMD64Kind kind = (AMD64Kind) lirKind.getPlatformKind();
         if (isJavaConstant(input)) {
             emitStoreConst(kind, storeAddress, asConstantValue(input), state);
         } else {
@@ -472,7 +494,7 @@
     public Variable emitCompareAndSwap(Value address, Value expectedValue, Value newValue, Value trueValue, Value falseValue) {
         LIRKind kind = newValue.getLIRKind();
         assert kind.equals(expectedValue.getLIRKind());
-        JavaKind memKind = (JavaKind) kind.getPlatformKind();
+        AMD64Kind memKind = (AMD64Kind) kind.getPlatformKind();
 
         AMD64AddressValue addressValue = asAddressValue(address);
         RegisterValue raxRes = AMD64.rax.asValue(kind);
@@ -488,26 +510,23 @@
     @Override
     public Value emitAtomicReadAndAdd(Value address, Value delta) {
         LIRKind kind = delta.getLIRKind();
-        JavaKind memKind = (JavaKind) kind.getPlatformKind();
         Variable result = newVariable(kind);
         AMD64AddressValue addressValue = asAddressValue(address);
-        append(new AMD64Move.AtomicReadAndAddOp(memKind, result, addressValue, asAllocatable(delta)));
+        append(new AMD64Move.AtomicReadAndAddOp((AMD64Kind) kind.getPlatformKind(), result, addressValue, asAllocatable(delta)));
         return result;
     }
 
     @Override
     public Value emitAtomicReadAndWrite(Value address, Value newValue) {
         LIRKind kind = newValue.getLIRKind();
-        JavaKind memKind = (JavaKind) kind.getPlatformKind();
         Variable result = newVariable(kind);
         AMD64AddressValue addressValue = asAddressValue(address);
-        append(new AMD64Move.AtomicReadAndWriteOp(memKind, result, addressValue, asAllocatable(newValue)));
+        append(new AMD64Move.AtomicReadAndWriteOp((AMD64Kind) kind.getPlatformKind(), result, addressValue, asAllocatable(newValue)));
         return result;
     }
 
     @Override
     public void emitNullCheck(Value address, LIRFrameState state) {
-        assert address.getPlatformKind() == JavaKind.Object || address.getPlatformKind() == JavaKind.Long : address + " - " + address.getPlatformKind() + " not a pointer!";
         append(new AMD64Move.NullCheckOp(asAddressValue(address), state));
     }
 
@@ -521,18 +540,18 @@
     public void emitCompareBranch(PlatformKind cmpKind, Value left, Value right, Condition cond, boolean unorderedIsTrue, LabelRef trueLabel, LabelRef falseLabel, double trueLabelProbability) {
         boolean mirrored = emitCompare(cmpKind, left, right);
         Condition finalCondition = mirrored ? cond.mirror() : cond;
-        if (cmpKind == JavaKind.Float || cmpKind == JavaKind.Double) {
+        if (cmpKind == AMD64Kind.SINGLE || cmpKind == AMD64Kind.DOUBLE) {
             append(new FloatBranchOp(finalCondition, unorderedIsTrue, trueLabel, falseLabel, trueLabelProbability));
         } else {
             append(new BranchOp(finalCondition, trueLabel, falseLabel, trueLabelProbability));
         }
     }
 
-    public void emitCompareBranchMemory(JavaKind cmpKind, Value left, AMD64AddressValue right, LIRFrameState state, Condition cond, boolean unorderedIsTrue, LabelRef trueLabel, LabelRef falseLabel,
+    public void emitCompareBranchMemory(AMD64Kind cmpKind, Value left, AMD64AddressValue right, LIRFrameState state, Condition cond, boolean unorderedIsTrue, LabelRef trueLabel, LabelRef falseLabel,
                     double trueLabelProbability) {
         boolean mirrored = emitCompareMemory(cmpKind, left, right, state);
         Condition finalCondition = mirrored ? cond.mirror() : cond;
-        if (cmpKind == JavaKind.Float || cmpKind == JavaKind.Double) {
+        if (cmpKind.isXMM()) {
             append(new FloatBranchOp(finalCondition, unorderedIsTrue, trueLabel, falseLabel, trueLabelProbability));
         } else {
             append(new BranchOp(finalCondition, trueLabel, falseLabel, trueLabelProbability));
@@ -556,7 +575,7 @@
         Condition finalCondition = mirrored ? cond.mirror() : cond;
 
         Variable result = newVariable(trueValue.getLIRKind());
-        if (cmpKind == JavaKind.Float || cmpKind == JavaKind.Double) {
+        if (cmpKind == AMD64Kind.SINGLE || cmpKind == AMD64Kind.DOUBLE) {
             append(new FloatCondMoveOp(result, finalCondition, unorderedIsTrue, load(trueValue), load(falseValue)));
         } else {
             append(new CondMoveOp(result, finalCondition, load(trueValue), loadNonConst(falseValue)));
@@ -573,8 +592,8 @@
     }
 
     private void emitIntegerTest(Value a, Value b) {
-        assert ((JavaKind) a.getPlatformKind()).isNumericInteger();
-        OperandSize size = (JavaKind) a.getPlatformKind() == JavaKind.Long ? QWORD : DWORD;
+        assert ((AMD64Kind) a.getPlatformKind()).isInteger();
+        OperandSize size = a.getPlatformKind() == AMD64Kind.QWORD ? QWORD : DWORD;
         if (isJavaConstant(b) && NumUtil.is32bit(asJavaConstant(b).asLong())) {
             append(new AMD64BinaryConsumer.ConstOp(AMD64MIOp.TEST, size, asAllocatable(a), (int) asJavaConstant(b).asLong()));
         } else if (isJavaConstant(a) && NumUtil.is32bit(asJavaConstant(a).asLong())) {
@@ -588,26 +607,23 @@
 
     protected void emitCompareOp(PlatformKind cmpKind, Variable left, Value right) {
         OperandSize size;
-        switch ((JavaKind) cmpKind) {
-            case Byte:
-            case Boolean:
+        switch ((AMD64Kind) cmpKind) {
+            case BYTE:
                 size = BYTE;
                 break;
-            case Short:
-            case Char:
+            case WORD:
                 size = WORD;
                 break;
-            case Int:
+            case DWORD:
                 size = DWORD;
                 break;
-            case Long:
-            case Object:
+            case QWORD:
                 size = QWORD;
                 break;
-            case Float:
+            case SINGLE:
                 append(new AMD64BinaryConsumer.Op(SSEOp.UCOMIS, PS, left, asAllocatable(right)));
                 return;
-            case Double:
+            case DOUBLE:
                 append(new AMD64BinaryConsumer.Op(SSEOp.UCOMIS, PD, left, asAllocatable(right)));
                 return;
             default:
@@ -637,28 +653,25 @@
      * @param b the right operand of the comparison
      * @return true if the left and right operands were switched, false otherwise
      */
-    private boolean emitCompareMemory(JavaKind cmpKind, Value a, AMD64AddressValue b, LIRFrameState state) {
+    private boolean emitCompareMemory(AMD64Kind cmpKind, Value a, AMD64AddressValue b, LIRFrameState state) {
         OperandSize size;
         switch (cmpKind) {
-            case Byte:
-            case Boolean:
-                size = BYTE;
+            case BYTE:
+                size = OperandSize.BYTE;
                 break;
-            case Short:
-            case Char:
-                size = WORD;
+            case WORD:
+                size = OperandSize.WORD;
                 break;
-            case Int:
-                size = DWORD;
+            case DWORD:
+                size = OperandSize.DWORD;
                 break;
-            case Long:
-            case Object:
-                size = QWORD;
+            case QWORD:
+                size = OperandSize.QWORD;
                 break;
-            case Float:
+            case SINGLE:
                 append(new AMD64BinaryConsumer.MemoryRMOp(SSEOp.UCOMIS, PS, asAllocatable(a), b, state));
                 return false;
-            case Double:
+            case DOUBLE:
                 append(new AMD64BinaryConsumer.MemoryRMOp(SSEOp.UCOMIS, PD, asAllocatable(a), b, state));
                 return false;
             default:
@@ -717,17 +730,17 @@
     public Variable emitNegate(Value inputVal) {
         AllocatableValue input = asAllocatable(inputVal);
         Variable result = newVariable(LIRKind.combine(input));
-        switch ((JavaKind) input.getPlatformKind()) {
-            case Int:
+        switch ((AMD64Kind) input.getPlatformKind()) {
+            case DWORD:
                 append(new AMD64Unary.MOp(NEG, DWORD, result, input));
                 break;
-            case Long:
+            case QWORD:
                 append(new AMD64Unary.MOp(NEG, QWORD, result, input));
                 break;
-            case Float:
+            case SINGLE:
                 append(new AMD64Binary.DataOp(SSEOp.XOR, PS, result, input, JavaConstant.forFloat(Float.intBitsToFloat(0x80000000)), 16));
                 break;
-            case Double:
+            case DOUBLE:
                 append(new AMD64Binary.DataOp(SSEOp.XOR, PD, result, input, JavaConstant.forDouble(Double.longBitsToDouble(0x8000000000000000L)), 16));
                 break;
             default:
@@ -740,11 +753,11 @@
     public Variable emitNot(Value inputVal) {
         AllocatableValue input = asAllocatable(inputVal);
         Variable result = newVariable(LIRKind.combine(input));
-        switch ((JavaKind) input.getPlatformKind()) {
-            case Int:
+        switch ((AMD64Kind) input.getPlatformKind()) {
+            case DWORD:
                 append(new AMD64Unary.MOp(NOT, DWORD, result, input));
                 break;
-            case Long:
+            case QWORD:
                 append(new AMD64Unary.MOp(NOT, QWORD, result, input));
                 break;
             default:
@@ -830,15 +843,20 @@
     }
 
     @Override
+    protected boolean isNumericInteger(PlatformKind kind) {
+        return ((AMD64Kind) kind).isInteger();
+    }
+
+    @Override
     public Variable emitAdd(LIRKind resultKind, Value a, Value b, boolean setFlags) {
-        switch (((JavaKind) a.getPlatformKind()).getStackKind()) {
-            case Int:
+        switch ((AMD64Kind) a.getPlatformKind()) {
+            case DWORD:
                 return emitBinary(resultKind, ADD, DWORD, true, a, b, setFlags);
-            case Long:
+            case QWORD:
                 return emitBinary(resultKind, ADD, QWORD, true, a, b, setFlags);
-            case Float:
+            case SINGLE:
                 return emitBinary(resultKind, SSEOp.ADD, SS, true, a, b);
-            case Double:
+            case DOUBLE:
                 return emitBinary(resultKind, SSEOp.ADD, SD, true, a, b);
             default:
                 throw JVMCIError.shouldNotReachHere();
@@ -847,14 +865,14 @@
 
     @Override
     public Variable emitSub(LIRKind resultKind, Value a, Value b, boolean setFlags) {
-        switch (((JavaKind) a.getPlatformKind()).getStackKind()) {
-            case Int:
+        switch ((AMD64Kind) a.getPlatformKind()) {
+            case DWORD:
                 return emitBinary(resultKind, SUB, DWORD, false, a, b, setFlags);
-            case Long:
+            case QWORD:
                 return emitBinary(resultKind, SUB, QWORD, false, a, b, setFlags);
-            case Float:
+            case SINGLE:
                 return emitBinary(resultKind, SSEOp.SUB, SS, false, a, b);
-            case Double:
+            case DOUBLE:
                 return emitBinary(resultKind, SSEOp.SUB, SD, false, a, b);
             default:
                 throw JVMCIError.shouldNotReachHere();
@@ -892,14 +910,14 @@
 
     @Override
     public Variable emitMul(Value a, Value b, boolean setFlags) {
-        switch (((JavaKind) a.getPlatformKind()).getStackKind()) {
-            case Int:
+        switch ((AMD64Kind) a.getPlatformKind()) {
+            case DWORD:
                 return emitIMUL(DWORD, a, b);
-            case Long:
+            case QWORD:
                 return emitIMUL(QWORD, a, b);
-            case Float:
+            case SINGLE:
                 return emitBinary(LIRKind.combine(a, b), SSEOp.MUL, SS, true, a, b);
-            case Double:
+            case DOUBLE:
                 return emitBinary(LIRKind.combine(a, b), SSEOp.MUL, SD, true, a, b);
             default:
                 throw JVMCIError.shouldNotReachHere();
@@ -919,10 +937,10 @@
 
     @Override
     public Value emitMulHigh(Value a, Value b) {
-        switch (((JavaKind) a.getPlatformKind()).getStackKind()) {
-            case Int:
+        switch ((AMD64Kind) a.getPlatformKind()) {
+            case DWORD:
                 return emitMulHigh(AMD64MOp.IMUL, DWORD, a, b);
-            case Long:
+            case QWORD:
                 return emitMulHigh(AMD64MOp.IMUL, QWORD, a, b);
             default:
                 throw JVMCIError.shouldNotReachHere();
@@ -931,10 +949,10 @@
 
     @Override
     public Value emitUMulHigh(Value a, Value b) {
-        switch (((JavaKind) a.getPlatformKind()).getStackKind()) {
-            case Int:
+        switch ((AMD64Kind) a.getPlatformKind()) {
+            case DWORD:
                 return emitMulHigh(AMD64MOp.MUL, DWORD, a, b);
-            case Long:
+            case QWORD:
                 return emitMulHigh(AMD64MOp.MUL, QWORD, a, b);
             default:
                 throw JVMCIError.shouldNotReachHere();
@@ -953,23 +971,21 @@
         return result;
     }
 
-    protected Value emitZeroExtendMemory(JavaKind memoryKind, int resultBits, AMD64AddressValue address, LIRFrameState state) {
+    protected Value emitZeroExtendMemory(AMD64Kind memoryKind, int resultBits, AMD64AddressValue address, LIRFrameState state) {
         // Issue a zero extending load of the proper bit size and set the result to
         // the proper kind.
-        Variable result = newVariable(LIRKind.value(resultBits == 32 ? JavaKind.Int : JavaKind.Long));
+        Variable result = newVariable(LIRKind.value(resultBits == 32 ? AMD64Kind.DWORD : AMD64Kind.QWORD));
         switch (memoryKind) {
-            case Boolean:
-            case Byte:
+            case BYTE:
                 append(new AMD64Unary.MemoryOp(MOVZXB, DWORD, result, address, state));
                 break;
-            case Char:
-            case Short:
+            case WORD:
                 append(new AMD64Unary.MemoryOp(MOVZX, DWORD, result, address, state));
                 break;
-            case Int:
+            case DWORD:
                 append(new AMD64Unary.MemoryOp(MOV, DWORD, result, address, state));
                 break;
-            case Long:
+            case QWORD:
                 append(new AMD64Unary.MemoryOp(MOV, QWORD, result, address, state));
                 break;
             default:
@@ -996,11 +1012,11 @@
 
     public Value[] emitIntegerDivRem(Value a, Value b, LIRFrameState state) {
         AMD64MulDivOp op;
-        switch (((JavaKind) a.getPlatformKind()).getStackKind()) {
-            case Int:
+        switch ((AMD64Kind) a.getPlatformKind()) {
+            case DWORD:
                 op = emitIDIV(DWORD, a, b, state);
                 break;
-            case Long:
+            case QWORD:
                 op = emitIDIV(QWORD, a, b, state);
                 break;
             default:
@@ -1011,16 +1027,16 @@
 
     @Override
     public Value emitDiv(Value a, Value b, LIRFrameState state) {
-        switch (((JavaKind) a.getPlatformKind()).getStackKind()) {
-            case Int:
+        switch ((AMD64Kind) a.getPlatformKind()) {
+            case DWORD:
                 AMD64MulDivOp op = emitIDIV(DWORD, a, b, state);
                 return emitMove(op.getQuotient());
-            case Long:
+            case QWORD:
                 AMD64MulDivOp lop = emitIDIV(QWORD, a, b, state);
                 return emitMove(lop.getQuotient());
-            case Float:
+            case SINGLE:
                 return emitBinary(LIRKind.combine(a, b), SSEOp.DIV, SS, false, a, b);
-            case Double:
+            case DOUBLE:
                 return emitBinary(LIRKind.combine(a, b), SSEOp.DIV, SD, false, a, b);
             default:
                 throw JVMCIError.shouldNotReachHere();
@@ -1029,19 +1045,19 @@
 
     @Override
     public Value emitRem(Value a, Value b, LIRFrameState state) {
-        switch (((JavaKind) a.getPlatformKind()).getStackKind()) {
-            case Int:
+        switch ((AMD64Kind) a.getPlatformKind()) {
+            case DWORD:
                 AMD64MulDivOp op = emitIDIV(DWORD, a, b, state);
                 return emitMove(op.getRemainder());
-            case Long:
+            case QWORD:
                 AMD64MulDivOp lop = emitIDIV(QWORD, a, b, state);
                 return emitMove(lop.getRemainder());
-            case Float: {
+            case SINGLE: {
                 Variable result = newVariable(LIRKind.combine(a, b));
                 append(new FPDivRemOp(FREM, result, load(a), load(b)));
                 return result;
             }
-            case Double: {
+            case DOUBLE: {
                 Variable result = newVariable(LIRKind.combine(a, b));
                 append(new FPDivRemOp(DREM, result, load(a), load(b)));
                 return result;
@@ -1054,11 +1070,11 @@
     @Override
     public Variable emitUDiv(Value a, Value b, LIRFrameState state) {
         AMD64MulDivOp op;
-        switch (((JavaKind) a.getPlatformKind()).getStackKind()) {
-            case Int:
+        switch ((AMD64Kind) a.getPlatformKind()) {
+            case DWORD:
                 op = emitDIV(DWORD, a, b, state);
                 break;
-            case Long:
+            case QWORD:
                 op = emitDIV(QWORD, a, b, state);
                 break;
             default:
@@ -1070,11 +1086,11 @@
     @Override
     public Variable emitURem(Value a, Value b, LIRFrameState state) {
         AMD64MulDivOp op;
-        switch (((JavaKind) a.getPlatformKind()).getStackKind()) {
-            case Int:
+        switch ((AMD64Kind) a.getPlatformKind()) {
+            case DWORD:
                 op = emitDIV(DWORD, a, b, state);
                 break;
-            case Long:
+            case QWORD:
                 op = emitDIV(QWORD, a, b, state);
                 break;
             default:
@@ -1086,14 +1102,14 @@
     @Override
     public Variable emitAnd(Value a, Value b) {
         LIRKind resultKind = LIRKind.combine(a, b);
-        switch (((JavaKind) a.getPlatformKind()).getStackKind()) {
-            case Int:
+        switch ((AMD64Kind) a.getPlatformKind()) {
+            case DWORD:
                 return emitBinary(resultKind, AND, DWORD, true, a, b, false);
-            case Long:
+            case QWORD:
                 return emitBinary(resultKind, AND, QWORD, true, a, b, false);
-            case Float:
+            case SINGLE:
                 return emitBinary(resultKind, SSEOp.AND, PS, true, a, b);
-            case Double:
+            case DOUBLE:
                 return emitBinary(resultKind, SSEOp.AND, PD, true, a, b);
             default:
                 throw JVMCIError.shouldNotReachHere();
@@ -1103,14 +1119,14 @@
     @Override
     public Variable emitOr(Value a, Value b) {
         LIRKind resultKind = LIRKind.combine(a, b);
-        switch (((JavaKind) a.getPlatformKind()).getStackKind()) {
-            case Int:
+        switch ((AMD64Kind) a.getPlatformKind()) {
+            case DWORD:
                 return emitBinary(resultKind, OR, DWORD, true, a, b, false);
-            case Long:
+            case QWORD:
                 return emitBinary(resultKind, OR, QWORD, true, a, b, false);
-            case Float:
+            case SINGLE:
                 return emitBinary(resultKind, SSEOp.OR, PS, true, a, b);
-            case Double:
+            case DOUBLE:
                 return emitBinary(resultKind, SSEOp.OR, PD, true, a, b);
             default:
                 throw JVMCIError.shouldNotReachHere();
@@ -1120,14 +1136,14 @@
     @Override
     public Variable emitXor(Value a, Value b) {
         LIRKind resultKind = LIRKind.combine(a, b);
-        switch (((JavaKind) a.getPlatformKind()).getStackKind()) {
-            case Int:
+        switch ((AMD64Kind) a.getPlatformKind()) {
+            case DWORD:
                 return emitBinary(resultKind, XOR, DWORD, true, a, b, false);
-            case Long:
+            case QWORD:
                 return emitBinary(resultKind, XOR, QWORD, true, a, b, false);
-            case Float:
+            case SINGLE:
                 return emitBinary(resultKind, SSEOp.XOR, PS, true, a, b);
-            case Double:
+            case DOUBLE:
                 return emitBinary(resultKind, SSEOp.XOR, PD, true, a, b);
             default:
                 throw JVMCIError.shouldNotReachHere();
@@ -1157,10 +1173,10 @@
 
     @Override
     public Variable emitShl(Value a, Value b) {
-        switch (((JavaKind) a.getPlatformKind()).getStackKind()) {
-            case Int:
+        switch ((AMD64Kind) a.getPlatformKind()) {
+            case DWORD:
                 return emitShift(SHL, DWORD, a, b);
-            case Long:
+            case QWORD:
                 return emitShift(SHL, QWORD, a, b);
             default:
                 throw JVMCIError.shouldNotReachHere();
@@ -1169,10 +1185,10 @@
 
     @Override
     public Variable emitShr(Value a, Value b) {
-        switch (((JavaKind) a.getPlatformKind()).getStackKind()) {
-            case Int:
+        switch ((AMD64Kind) a.getPlatformKind()) {
+            case DWORD:
                 return emitShift(SAR, DWORD, a, b);
-            case Long:
+            case QWORD:
                 return emitShift(SAR, QWORD, a, b);
             default:
                 throw JVMCIError.shouldNotReachHere();
@@ -1181,10 +1197,10 @@
 
     @Override
     public Variable emitUShr(Value a, Value b) {
-        switch (((JavaKind) a.getPlatformKind()).getStackKind()) {
-            case Int:
+        switch ((AMD64Kind) a.getPlatformKind()) {
+            case DWORD:
                 return emitShift(SHR, DWORD, a, b);
-            case Long:
+            case QWORD:
                 return emitShift(SHR, QWORD, a, b);
             default:
                 throw JVMCIError.shouldNotReachHere();
@@ -1192,10 +1208,10 @@
     }
 
     public Variable emitRol(Value a, Value b) {
-        switch (((JavaKind) a.getPlatformKind()).getStackKind()) {
-            case Int:
+        switch ((AMD64Kind) a.getPlatformKind()) {
+            case DWORD:
                 return emitShift(ROL, DWORD, a, b);
-            case Long:
+            case QWORD:
                 return emitShift(ROL, QWORD, a, b);
             default:
                 throw JVMCIError.shouldNotReachHere();
@@ -1203,10 +1219,10 @@
     }
 
     public Variable emitRor(Value a, Value b) {
-        switch (((JavaKind) a.getPlatformKind()).getStackKind()) {
-            case Int:
+        switch ((AMD64Kind) a.getPlatformKind()) {
+            case DWORD:
                 return emitShift(ROR, DWORD, a, b);
-            case Long:
+            case QWORD:
                 return emitShift(ROR, QWORD, a, b);
             default:
                 throw JVMCIError.shouldNotReachHere();
@@ -1237,29 +1253,29 @@
          * Conversions between integer to floating point types require moves between CPU and FPU
          * registers.
          */
-        JavaKind fromKind = (JavaKind) from.getPlatformKind();
-        switch ((JavaKind) to.getPlatformKind()) {
-            case Int:
+        AMD64Kind fromKind = (AMD64Kind) from.getPlatformKind();
+        switch ((AMD64Kind) to.getPlatformKind()) {
+            case DWORD:
                 switch (fromKind) {
-                    case Float:
+                    case SINGLE:
                         return emitConvertOp(to, AMD64MROp.MOVD, DWORD, input);
                 }
                 break;
-            case Long:
+            case QWORD:
                 switch (fromKind) {
-                    case Double:
+                    case DOUBLE:
                         return emitConvertOp(to, AMD64MROp.MOVQ, QWORD, input);
                 }
                 break;
-            case Float:
+            case SINGLE:
                 switch (fromKind) {
-                    case Int:
+                    case DWORD:
                         return emitConvertOp(to, AMD64RMOp.MOVD, DWORD, input);
                 }
                 break;
-            case Double:
+            case DOUBLE:
                 switch (fromKind) {
-                    case Long:
+                    case QWORD:
                         return emitConvertOp(to, AMD64RMOp.MOVQ, QWORD, input);
                 }
                 break;
@@ -1270,25 +1286,25 @@
     public Value emitFloatConvert(FloatConvert op, Value input) {
         switch (op) {
             case D2F:
-                return emitConvertOp(LIRKind.combine(input).changeType(JavaKind.Float), SSEOp.CVTSD2SS, SD, input);
+                return emitConvertOp(LIRKind.combine(input).changeType(AMD64Kind.SINGLE), SSEOp.CVTSD2SS, SD, input);
             case D2I:
-                return emitConvertOp(LIRKind.combine(input).changeType(JavaKind.Int), SSEOp.CVTTSD2SI, DWORD, input);
+                return emitConvertOp(LIRKind.combine(input).changeType(AMD64Kind.DWORD), SSEOp.CVTTSD2SI, DWORD, input);
             case D2L:
-                return emitConvertOp(LIRKind.combine(input).changeType(JavaKind.Long), SSEOp.CVTTSD2SI, QWORD, input);
+                return emitConvertOp(LIRKind.combine(input).changeType(AMD64Kind.QWORD), SSEOp.CVTTSD2SI, QWORD, input);
             case F2D:
-                return emitConvertOp(LIRKind.combine(input).changeType(JavaKind.Double), SSEOp.CVTSS2SD, SS, input);
+                return emitConvertOp(LIRKind.combine(input).changeType(AMD64Kind.DOUBLE), SSEOp.CVTSS2SD, SS, input);
             case F2I:
-                return emitConvertOp(LIRKind.combine(input).changeType(JavaKind.Int), SSEOp.CVTTSS2SI, DWORD, input);
+                return emitConvertOp(LIRKind.combine(input).changeType(AMD64Kind.DWORD), SSEOp.CVTTSS2SI, DWORD, input);
             case F2L:
-                return emitConvertOp(LIRKind.combine(input).changeType(JavaKind.Long), SSEOp.CVTTSS2SI, QWORD, input);
+                return emitConvertOp(LIRKind.combine(input).changeType(AMD64Kind.QWORD), SSEOp.CVTTSS2SI, QWORD, input);
             case I2D:
-                return emitConvertOp(LIRKind.combine(input).changeType(JavaKind.Double), SSEOp.CVTSI2SD, DWORD, input);
+                return emitConvertOp(LIRKind.combine(input).changeType(AMD64Kind.DOUBLE), SSEOp.CVTSI2SD, DWORD, input);
             case I2F:
-                return emitConvertOp(LIRKind.combine(input).changeType(JavaKind.Float), SSEOp.CVTSI2SS, DWORD, input);
+                return emitConvertOp(LIRKind.combine(input).changeType(AMD64Kind.SINGLE), SSEOp.CVTSI2SS, DWORD, input);
             case L2D:
-                return emitConvertOp(LIRKind.combine(input).changeType(JavaKind.Double), SSEOp.CVTSI2SD, QWORD, input);
+                return emitConvertOp(LIRKind.combine(input).changeType(AMD64Kind.DOUBLE), SSEOp.CVTSI2SD, QWORD, input);
             case L2F:
-                return emitConvertOp(LIRKind.combine(input).changeType(JavaKind.Float), SSEOp.CVTSI2SS, QWORD, input);
+                return emitConvertOp(LIRKind.combine(input).changeType(AMD64Kind.SINGLE), SSEOp.CVTSI2SS, QWORD, input);
             default:
                 throw JVMCIError.shouldNotReachHere();
         }
@@ -1296,9 +1312,9 @@
 
     @Override
     public Value emitNarrow(Value inputVal, int bits) {
-        if (inputVal.getPlatformKind() == JavaKind.Long && bits <= 32) {
+        if (inputVal.getPlatformKind() == AMD64Kind.QWORD && bits <= 32) {
             // TODO make it possible to reinterpret Long as Int in LIR without move
-            return emitConvertOp(LIRKind.combine(inputVal).changeType(JavaKind.Int), AMD64RMOp.MOV, DWORD, inputVal);
+            return emitConvertOp(LIRKind.combine(inputVal).changeType(AMD64Kind.DWORD), AMD64RMOp.MOV, DWORD, inputVal);
         } else {
             return inputVal;
         }
@@ -1313,11 +1329,11 @@
             // sign extend to 64 bits
             switch (fromBits) {
                 case 8:
-                    return emitConvertOp(LIRKind.combine(inputVal).changeType(JavaKind.Long), MOVSXB, QWORD, inputVal);
+                    return emitConvertOp(LIRKind.combine(inputVal).changeType(AMD64Kind.QWORD), MOVSXB, QWORD, inputVal);
                 case 16:
-                    return emitConvertOp(LIRKind.combine(inputVal).changeType(JavaKind.Long), MOVSX, QWORD, inputVal);
+                    return emitConvertOp(LIRKind.combine(inputVal).changeType(AMD64Kind.QWORD), MOVSX, QWORD, inputVal);
                 case 32:
-                    return emitConvertOp(LIRKind.combine(inputVal).changeType(JavaKind.Long), MOVSXD, QWORD, inputVal);
+                    return emitConvertOp(LIRKind.combine(inputVal).changeType(AMD64Kind.QWORD), MOVSXD, QWORD, inputVal);
                 default:
                     throw JVMCIError.unimplemented("unsupported sign extension (" + fromBits + " bit -> " + toBits + " bit)");
             }
@@ -1325,9 +1341,9 @@
             // sign extend to 32 bits (smaller values are internally represented as 32 bit values)
             switch (fromBits) {
                 case 8:
-                    return emitConvertOp(LIRKind.combine(inputVal).changeType(JavaKind.Int), MOVSXB, DWORD, inputVal);
+                    return emitConvertOp(LIRKind.combine(inputVal).changeType(AMD64Kind.DWORD), MOVSXB, DWORD, inputVal);
                 case 16:
-                    return emitConvertOp(LIRKind.combine(inputVal).changeType(JavaKind.Int), MOVSX, DWORD, inputVal);
+                    return emitConvertOp(LIRKind.combine(inputVal).changeType(AMD64Kind.DWORD), MOVSX, DWORD, inputVal);
                 case 32:
                     return inputVal;
                 default:
@@ -1342,19 +1358,17 @@
         if (fromBits == toBits) {
             return inputVal;
         } else if (fromBits > 32) {
-            assert inputVal.getPlatformKind() == JavaKind.Long;
-            Variable result = newVariable(LIRKind.combine(inputVal).changeType(JavaKind.Long));
+            assert inputVal.getPlatformKind() == AMD64Kind.QWORD;
+            Variable result = newVariable(LIRKind.combine(inputVal));
             long mask = CodeUtil.mask(fromBits);
             append(new AMD64Binary.DataOp(AND.getRMOpcode(QWORD), QWORD, result, asAllocatable(inputVal), JavaConstant.forLong(mask)));
             return result;
         } else {
-            assert ((JavaKind) inputVal.getPlatformKind()).getStackKind() == JavaKind.Int;
-
             LIRKind resultKind = LIRKind.combine(inputVal);
             if (toBits > 32) {
-                resultKind = resultKind.changeType(JavaKind.Long);
+                resultKind = resultKind.changeType(AMD64Kind.QWORD);
             } else {
-                resultKind = resultKind.changeType(JavaKind.Int);
+                resultKind = resultKind.changeType(AMD64Kind.DWORD);
             }
 
             /*
@@ -1407,8 +1421,9 @@
 
     @Override
     public Variable emitBitCount(Value value) {
-        Variable result = newVariable(LIRKind.combine(value).changeType(JavaKind.Int));
-        if (value.getPlatformKind() == JavaKind.Long) {
+        Variable result = newVariable(LIRKind.combine(value).changeType(AMD64Kind.DWORD));
+        assert ((AMD64Kind) value.getPlatformKind()).isInteger();
+        if (value.getPlatformKind() == AMD64Kind.QWORD) {
             append(new AMD64Unary.RMOp(POPCNT, QWORD, result, asAllocatable(value)));
         } else {
             append(new AMD64Unary.RMOp(POPCNT, DWORD, result, asAllocatable(value)));
@@ -1418,15 +1433,16 @@
 
     @Override
     public Variable emitBitScanForward(Value value) {
-        Variable result = newVariable(LIRKind.combine(value).changeType(JavaKind.Int));
+        Variable result = newVariable(LIRKind.combine(value).changeType(AMD64Kind.DWORD));
         append(new AMD64Unary.RMOp(BSF, QWORD, result, asAllocatable(value)));
         return result;
     }
 
     @Override
     public Variable emitBitScanReverse(Value value) {
-        Variable result = newVariable(LIRKind.combine(value).changeType(JavaKind.Int));
-        if (value.getPlatformKind() == JavaKind.Long) {
+        Variable result = newVariable(LIRKind.combine(value).changeType(AMD64Kind.DWORD));
+        assert ((AMD64Kind) value.getPlatformKind()).isInteger();
+        if (value.getPlatformKind() == AMD64Kind.QWORD) {
             append(new AMD64Unary.RMOp(BSR, QWORD, result, asAllocatable(value)));
         } else {
             append(new AMD64Unary.RMOp(BSR, DWORD, result, asAllocatable(value)));
@@ -1435,8 +1451,9 @@
     }
 
     public Value emitCountLeadingZeros(Value value) {
-        Variable result = newVariable(LIRKind.combine(value).changeType(JavaKind.Int));
-        if (value.getPlatformKind() == JavaKind.Long) {
+        Variable result = newVariable(LIRKind.combine(value).changeType(AMD64Kind.DWORD));
+        assert ((AMD64Kind) value.getPlatformKind()).isInteger();
+        if (value.getPlatformKind() == AMD64Kind.QWORD) {
             append(new AMD64Unary.RMOp(LZCNT, QWORD, result, asAllocatable(value)));
         } else {
             append(new AMD64Unary.RMOp(LZCNT, DWORD, result, asAllocatable(value)));
@@ -1445,8 +1462,9 @@
     }
 
     public Value emitCountTrailingZeros(Value value) {
-        Variable result = newVariable(LIRKind.combine(value).changeType(JavaKind.Int));
-        if (value.getPlatformKind() == JavaKind.Long) {
+        Variable result = newVariable(LIRKind.combine(value).changeType(AMD64Kind.DWORD));
+        assert ((AMD64Kind) value.getPlatformKind()).isInteger();
+        if (value.getPlatformKind() == AMD64Kind.QWORD) {
             append(new AMD64Unary.RMOp(TZCNT, QWORD, result, asAllocatable(value)));
         } else {
             append(new AMD64Unary.RMOp(TZCNT, DWORD, result, asAllocatable(value)));
@@ -1457,11 +1475,11 @@
     @Override
     public Value emitMathAbs(Value input) {
         Variable result = newVariable(LIRKind.combine(input));
-        switch ((JavaKind) input.getPlatformKind()) {
-            case Float:
+        switch ((AMD64Kind) input.getPlatformKind()) {
+            case SINGLE:
                 append(new AMD64Binary.DataOp(SSEOp.AND, PS, result, asAllocatable(input), JavaConstant.forFloat(Float.intBitsToFloat(0x7FFFFFFF)), 16));
                 break;
-            case Double:
+            case DOUBLE:
                 append(new AMD64Binary.DataOp(SSEOp.AND, PD, result, asAllocatable(input), JavaConstant.forDouble(Double.longBitsToDouble(0x7FFFFFFFFFFFFFFFL)), 16));
                 break;
             default:
@@ -1473,11 +1491,11 @@
     @Override
     public Value emitMathSqrt(Value input) {
         Variable result = newVariable(LIRKind.combine(input));
-        switch ((JavaKind) input.getPlatformKind()) {
-            case Float:
+        switch ((AMD64Kind) input.getPlatformKind()) {
+            case SINGLE:
                 append(new AMD64Unary.RMOp(SSEOp.SQRT, SS, result, asAllocatable(input)));
                 break;
-            case Double:
+            case DOUBLE:
                 append(new AMD64Unary.RMOp(SSEOp.SQRT, SD, result, asAllocatable(input)));
                 break;
             default:
@@ -1523,7 +1541,7 @@
 
     @Override
     public Variable emitArrayEquals(JavaKind kind, Value array1, Value array2, Value length) {
-        Variable result = newVariable(LIRKind.value(JavaKind.Int));
+        Variable result = newVariable(LIRKind.value(AMD64Kind.DWORD));
         append(new AMD64ArrayEqualsOp(this, kind, result, array1, array2, asAllocatable(length)));
         return result;
     }
@@ -1545,7 +1563,7 @@
     @Override
     public void emitStrategySwitch(SwitchStrategy strategy, Variable key, LabelRef[] keyTargets, LabelRef defaultTarget) {
         // a temp is needed for loading object constants
-        boolean needsTemp = key.getPlatformKind() == JavaKind.Object;
+        boolean needsTemp = !key.getLIRKind().isValue();
         append(createStrategySwitchOp(strategy, keyTargets, defaultTarget, key, needsTemp ? newVariable(key.getLIRKind()) : Value.ILLEGAL));
     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRKindTool.java	Fri Sep 18 13:12:02 2015 +0200
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2015, 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.amd64;
+
+import jdk.internal.jvmci.amd64.AMD64Kind;
+import jdk.internal.jvmci.common.JVMCIError;
+import jdk.internal.jvmci.meta.LIRKind;
+
+import com.oracle.graal.compiler.common.spi.LIRKindTool;
+
+public class AMD64LIRKindTool implements LIRKindTool {
+
+    public LIRKind getIntegerKind(int bits) {
+        if (bits <= 8) {
+            return LIRKind.value(AMD64Kind.BYTE);
+        } else if (bits <= 16) {
+            return LIRKind.value(AMD64Kind.WORD);
+        } else if (bits <= 32) {
+            return LIRKind.value(AMD64Kind.DWORD);
+        } else {
+            assert bits <= 64;
+            return LIRKind.value(AMD64Kind.QWORD);
+        }
+    }
+
+    public LIRKind getFloatingKind(int bits) {
+        switch (bits) {
+            case 32:
+                return LIRKind.value(AMD64Kind.SINGLE);
+            case 64:
+                return LIRKind.value(AMD64Kind.DOUBLE);
+            default:
+                throw JVMCIError.shouldNotReachHere();
+        }
+    }
+
+    public LIRKind getObjectKind() {
+        return LIRKind.reference(AMD64Kind.QWORD);
+    }
+
+    public LIRKind getWordKind() {
+        return LIRKind.value(AMD64Kind.QWORD);
+    }
+
+}
--- a/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64NodeLIRBuilder.java	Fri Sep 18 11:41:06 2015 +0200
+++ b/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64NodeLIRBuilder.java	Fri Sep 18 13:12:02 2015 +0200
@@ -36,6 +36,7 @@
 import static com.oracle.graal.asm.amd64.AMD64Assembler.OperandSize.SD;
 import static com.oracle.graal.asm.amd64.AMD64Assembler.OperandSize.SS;
 import jdk.internal.jvmci.amd64.AMD64;
+import jdk.internal.jvmci.amd64.AMD64Kind;
 import jdk.internal.jvmci.code.CallingConvention;
 import jdk.internal.jvmci.common.JVMCIError;
 import jdk.internal.jvmci.meta.AllocatableValue;
@@ -150,25 +151,23 @@
         return null;
     }
 
-    protected JavaKind getMemoryKind(Access access) {
-        return (JavaKind) gen.getLIRKind(access.asNode().stamp()).getPlatformKind();
+    protected AMD64Kind getMemoryKind(Access access) {
+        return (AMD64Kind) gen.getLIRKind(access.asNode().stamp()).getPlatformKind();
     }
 
     protected OperandSize getMemorySize(Access access) {
         switch (getMemoryKind(access)) {
-            case Boolean:
-            case Byte:
+            case BYTE:
                 return OperandSize.BYTE;
-            case Char:
-            case Short:
+            case WORD:
                 return OperandSize.WORD;
-            case Int:
+            case DWORD:
                 return OperandSize.DWORD;
-            case Long:
+            case QWORD:
                 return OperandSize.QWORD;
-            case Float:
+            case SINGLE:
                 return OperandSize.SS;
-            case Double:
+            case DOUBLE:
                 return OperandSize.SD;
             default:
                 throw JVMCIError.shouldNotReachHere("unsupported memory access type " + getMemoryKind(access));
@@ -185,28 +184,20 @@
 
     protected ComplexMatchResult emitCompareBranchMemory(IfNode ifNode, CompareNode compare, ValueNode value, Access access) {
         Condition cond = compare.condition();
-        JavaKind kind = getMemoryKind(access);
+        AMD64Kind kind = getMemoryKind(access);
 
         if (value.isConstant()) {
             JavaConstant constant = value.asJavaConstant();
-            if (kind == JavaKind.Long && !NumUtil.isInt(constant.asLong())) {
+            if (kind == AMD64Kind.QWORD && !NumUtil.isInt(constant.asLong())) {
                 // Only imm32 as long
                 return null;
             }
-            if (kind.isNumericFloat()) {
+            if (kind.isXMM()) {
                 Debug.log("Skipping constant compares for float kinds");
                 return null;
             }
-            if (kind == JavaKind.Object) {
-                if (!constant.isNull()) {
-                    Debug.log("Skipping constant compares for Object kinds");
-                    return null;
-                }
-            }
-        } else {
-            if (kind == JavaKind.Object) {
-                // Can't compare against objects since they require encode/decode
-                Debug.log("Skipping compares for Object kinds");
+            if (constant.getJavaKind() == JavaKind.Object && !constant.isNull()) {
+                Debug.log("Skipping constant compares for Object kinds");
                 return null;
             }
         }
@@ -239,14 +230,11 @@
         LabelRef trueLabel = getLIRBlock(x.trueSuccessor());
         LabelRef falseLabel = getLIRBlock(x.falseSuccessor());
         double trueLabelProbability = x.probability(x.trueSuccessor());
-        JavaKind kind = getMemoryKind(access);
-        OperandSize size = kind == JavaKind.Long ? QWORD : DWORD;
+        AMD64Kind kind = getMemoryKind(access);
+        OperandSize size = kind == AMD64Kind.QWORD ? QWORD : DWORD;
         if (value.isConstant()) {
-            if (kind != kind.getStackKind()) {
-                return null;
-            }
             JavaConstant constant = value.asJavaConstant();
-            if (kind == JavaKind.Long && !NumUtil.isInt(constant.asLong())) {
+            if (kind == AMD64Kind.QWORD && !NumUtil.isInt(constant.asLong())) {
                 // Only imm32 as long
                 return null;
             }
@@ -276,14 +264,14 @@
 
     private ComplexMatchResult emitSignExtendMemory(Access access, int fromBits, int toBits) {
         assert fromBits <= toBits && toBits <= 64;
-        JavaKind kind = null;
+        AMD64Kind kind = null;
         AMD64RMOp op;
         OperandSize size;
         if (fromBits == toBits) {
             return null;
         } else if (toBits > 32) {
-            kind = JavaKind.Long;
-            size = QWORD;
+            kind = AMD64Kind.QWORD;
+            size = OperandSize.QWORD;
             // sign extend to 64 bits
             switch (fromBits) {
                 case 8:
@@ -299,8 +287,8 @@
                     throw JVMCIError.unimplemented("unsupported sign extension (" + fromBits + " bit -> " + toBits + " bit)");
             }
         } else {
-            kind = JavaKind.Int;
-            size = DWORD;
+            kind = AMD64Kind.DWORD;
+            size = OperandSize.DWORD;
             // sign extend to 32 bits (smaller values are internally represented as 32 bit values)
             switch (fromBits) {
                 case 8:
@@ -459,17 +447,8 @@
     @MatchRule("(ZeroExtend Read=access)")
     @MatchRule("(ZeroExtend FloatingRead=access)")
     public ComplexMatchResult zeroExtend(ZeroExtendNode root, Access access) {
-        JavaKind memoryKind = getMemoryKind(access);
-        if (memoryKind.getBitCount() != root.getInputBits() && !memoryKind.isUnsigned()) {
-            /*
-             * The memory being read from is signed and smaller than the result size so this is a
-             * sign extension to inputBits followed by a zero extension to resultBits which can't be
-             * expressed in a memory operation.
-             */
-            return null;
-        }
-        return builder -> getLIRGeneratorTool().emitZeroExtendMemory(memoryKind == JavaKind.Short ? JavaKind.Char : memoryKind, root.getResultBits(), (AMD64AddressValue) operand(access.getAddress()),
-                        getState(access));
+        AMD64Kind memoryKind = getMemoryKind(access);
+        return builder -> getLIRGeneratorTool().emitZeroExtendMemory(memoryKind, root.getResultBits(), (AMD64AddressValue) operand(access.getAddress()), getState(access));
     }
 
     @MatchRule("(FloatConvert Read=access)")
@@ -477,25 +456,25 @@
     public ComplexMatchResult floatConvert(FloatConvertNode root, Access access) {
         switch (root.getFloatConvert()) {
             case D2F:
-                return emitConvertMemoryOp(JavaKind.Float, SSEOp.CVTSD2SS, SD, access);
+                return emitConvertMemoryOp(AMD64Kind.SINGLE, SSEOp.CVTSD2SS, SD, access);
             case D2I:
-                return emitConvertMemoryOp(JavaKind.Int, SSEOp.CVTTSD2SI, DWORD, access);
+                return emitConvertMemoryOp(AMD64Kind.DWORD, SSEOp.CVTTSD2SI, DWORD, access);
             case D2L:
-                return emitConvertMemoryOp(JavaKind.Long, SSEOp.CVTTSD2SI, QWORD, access);
+                return emitConvertMemoryOp(AMD64Kind.QWORD, SSEOp.CVTTSD2SI, QWORD, access);
             case F2D:
-                return emitConvertMemoryOp(JavaKind.Double, SSEOp.CVTSS2SD, SS, access);
+                return emitConvertMemoryOp(AMD64Kind.DOUBLE, SSEOp.CVTSS2SD, SS, access);
             case F2I:
-                return emitConvertMemoryOp(JavaKind.Int, SSEOp.CVTTSS2SI, DWORD, access);
+                return emitConvertMemoryOp(AMD64Kind.DWORD, SSEOp.CVTTSS2SI, DWORD, access);
             case F2L:
-                return emitConvertMemoryOp(JavaKind.Long, SSEOp.CVTTSS2SI, QWORD, access);
+                return emitConvertMemoryOp(AMD64Kind.QWORD, SSEOp.CVTTSS2SI, QWORD, access);
             case I2D:
-                return emitConvertMemoryOp(JavaKind.Double, SSEOp.CVTSI2SD, DWORD, access);
+                return emitConvertMemoryOp(AMD64Kind.DOUBLE, SSEOp.CVTSI2SD, DWORD, access);
             case I2F:
-                return emitConvertMemoryOp(JavaKind.Float, SSEOp.CVTSI2SS, DWORD, access);
+                return emitConvertMemoryOp(AMD64Kind.SINGLE, SSEOp.CVTSI2SS, DWORD, access);
             case L2D:
-                return emitConvertMemoryOp(JavaKind.Double, SSEOp.CVTSI2SD, QWORD, access);
+                return emitConvertMemoryOp(AMD64Kind.DOUBLE, SSEOp.CVTSI2SD, QWORD, access);
             case L2F:
-                return emitConvertMemoryOp(JavaKind.Float, SSEOp.CVTSI2SS, QWORD, access);
+                return emitConvertMemoryOp(AMD64Kind.SINGLE, SSEOp.CVTSI2SS, QWORD, access);
             default:
                 throw JVMCIError.shouldNotReachHere();
         }
--- a/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java	Fri Sep 18 11:41:06 2015 +0200
+++ b/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java	Fri Sep 18 13:12:02 2015 +0200
@@ -681,6 +681,11 @@
     }
 
     @Override
+    protected boolean isNumericInteger(PlatformKind kind) {
+        return ((JavaKind) kind).isNumericInteger();
+    }
+
+    @Override
     public Variable emitAdd(LIRKind resultKind, Value a, Value b, boolean setFlags) {
         switch (((JavaKind) a.getPlatformKind()).getStackKind()) {
             case Int:
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBytecodeLIRBuilder.java	Fri Sep 18 11:41:06 2015 +0200
+++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBytecodeLIRBuilder.java	Fri Sep 18 13:12:02 2015 +0200
@@ -23,12 +23,12 @@
 package com.oracle.graal.hotspot.amd64;
 
 import static jdk.internal.jvmci.amd64.AMD64.rbp;
+import jdk.internal.jvmci.amd64.AMD64Kind;
 import jdk.internal.jvmci.code.CallingConvention;
 import jdk.internal.jvmci.code.StackSlot;
 import jdk.internal.jvmci.code.ValueUtil;
 import jdk.internal.jvmci.hotspot.HotSpotResolvedJavaField;
 import jdk.internal.jvmci.meta.JavaConstant;
-import jdk.internal.jvmci.meta.JavaKind;
 import jdk.internal.jvmci.meta.LIRKind;
 import jdk.internal.jvmci.meta.ResolvedJavaField;
 import jdk.internal.jvmci.meta.ResolvedJavaMethod;
@@ -64,7 +64,7 @@
                 }
             }
         }
-        params[params.length - 1] = rbp.asValue(LIRKind.value(JavaKind.Long));
+        params[params.length - 1] = rbp.asValue(LIRKind.value(AMD64Kind.QWORD));
 
         gen.emitIncomingValues(params);
 
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java	Fri Sep 18 11:41:06 2015 +0200
+++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java	Fri Sep 18 13:12:02 2015 +0200
@@ -37,6 +37,7 @@
 import java.util.Map;
 
 import jdk.internal.jvmci.amd64.AMD64;
+import jdk.internal.jvmci.amd64.AMD64Kind;
 import jdk.internal.jvmci.code.CallingConvention;
 import jdk.internal.jvmci.code.Register;
 import jdk.internal.jvmci.code.RegisterConfig;
@@ -77,7 +78,6 @@
 import com.oracle.graal.hotspot.amd64.AMD64HotSpotMove.StoreRbpOp;
 import com.oracle.graal.hotspot.debug.BenchmarkCounters;
 import com.oracle.graal.hotspot.meta.HotSpotProviders;
-import com.oracle.graal.hotspot.nodes.type.DefaultHotSpotLIRKindTool;
 import com.oracle.graal.hotspot.stubs.Stub;
 import com.oracle.graal.lir.ConstantValue;
 import com.oracle.graal.lir.LIR;
@@ -114,7 +114,7 @@
     private HotSpotLockStack lockStack;
 
     protected AMD64HotSpotLIRGenerator(HotSpotProviders providers, HotSpotVMConfig config, CallingConvention cc, LIRGenerationResult lirGenRes) {
-        this(new DefaultHotSpotLIRKindTool(providers.getCodeCache().getTarget().arch.getWordKind()), providers, config, cc, lirGenRes);
+        this(new AMD64HotSpotLIRKindTool(), providers, config, cc, lirGenRes);
     }
 
     protected AMD64HotSpotLIRGenerator(LIRKindTool lirKindTool, HotSpotProviders providers, HotSpotVMConfig config, CallingConvention cc, LIRGenerationResult lirGenRes) {
@@ -150,7 +150,7 @@
             this.placeholder = placeholder0;
             AMD64FrameMapBuilder frameMapBuilder = (AMD64FrameMapBuilder) getResult().getFrameMapBuilder();
             this.reservedSlot = frameMapBuilder.allocateRBPSpillSlot();
-            this.rescueSlot = newVariable(LIRKind.value(JavaKind.Long));
+            this.rescueSlot = newVariable(LIRKind.value(AMD64Kind.QWORD));
         }
 
         /**
@@ -159,13 +159,13 @@
          * @param useStack specifies if rbp must be saved to the stack
          */
         public void finalize(boolean useStack) {
-            RegisterValue rbpValue = rbp.asValue(LIRKind.value(JavaKind.Long));
+            RegisterValue rbpValue = rbp.asValue(LIRKind.value(AMD64Kind.QWORD));
             LIRInstruction move;
             if (useStack) {
                 move = new StoreRbpOp(rescueSlot, rbpValue, reservedSlot);
             } else {
                 ((AMD64FrameMapBuilder) getResult().getFrameMapBuilder()).freeRBPSpillSlot();
-                move = new MoveFromRegOp(JavaKind.Long, rescueSlot, rbpValue);
+                move = new MoveFromRegOp(AMD64Kind.QWORD, rescueSlot, rbpValue);
             }
             placeholder.replace(getResult().getLIR(), move);
 
@@ -312,14 +312,14 @@
 
     @Override
     public Value emitCardTableShift() {
-        Variable result = newVariable(LIRKind.value(JavaKind.Long));
+        Variable result = newVariable(LIRKind.value(AMD64Kind.QWORD));
         append(new AMD64HotSpotCardTableShiftOp(result, config));
         return result;
     }
 
     @Override
     public Value emitCardTableAddress() {
-        Variable result = newVariable(LIRKind.value(JavaKind.Long));
+        Variable result = newVariable(LIRKind.value(AMD64Kind.QWORD));
         append(new AMD64HotSpotCardTableAddressOp(result, config));
         return result;
     }
@@ -345,7 +345,6 @@
         StackSlotValue[] savedRegisterLocations = new StackSlotValue[savedRegisters.length];
         for (int i = 0; i < savedRegisters.length; i++) {
             PlatformKind kind = target().arch.getLargestStorableKind(savedRegisters[i].getRegisterCategory());
-            assert kind != JavaKind.Illegal;
             VirtualStackSlot spillSlot = getResult().getFrameMapBuilder().allocateSpillSlot(LIRKind.value(kind));
             savedRegisterLocations[i] = spillSlot;
         }
@@ -422,7 +421,7 @@
 
         Register thread = getProviders().getRegisters().getThreadRegister();
         append(new AMD64HotSpotCRuntimeCallPrologueOp(config.threadLastJavaSpOffset(), thread));
-        Variable result = super.emitForeignCall(linkage, null, thread.asValue(LIRKind.value(JavaKind.Long)), trapRequest);
+        Variable result = super.emitForeignCall(linkage, null, thread.asValue(LIRKind.value(AMD64Kind.QWORD)), trapRequest);
         append(new AMD64HotSpotCRuntimeCallEpilogueOp(config.threadLastJavaSpOffset(), config.threadLastJavaFpOffset(), thread));
 
         Map<LIRFrameState, SaveRegistersOp> calleeSaveInfo = ((AMD64HotSpotLIRGenerationResult) getResult()).getCalleeSaveInfo();
@@ -437,7 +436,7 @@
 
         Register thread = getProviders().getRegisters().getThreadRegister();
         append(new AMD64HotSpotCRuntimeCallPrologueOp(config.threadLastJavaSpOffset(), thread));
-        Variable result = super.emitForeignCall(linkage, null, thread.asValue(LIRKind.value(JavaKind.Long)));
+        Variable result = super.emitForeignCall(linkage, null, thread.asValue(LIRKind.value(AMD64Kind.QWORD)));
         append(new AMD64HotSpotCRuntimeCallEpilogueOp(config.threadLastJavaSpOffset(), config.threadLastJavaFpOffset(), thread));
 
         Map<LIRFrameState, SaveRegistersOp> calleeSaveInfo = ((AMD64HotSpotLIRGenerationResult) getResult()).getCalleeSaveInfo();
@@ -458,7 +457,6 @@
         JavaConstant[] zapValues = new JavaConstant[zappedRegisters.length];
         for (int i = 0; i < zappedRegisters.length; i++) {
             PlatformKind kind = target().arch.getLargestStorableKind(zappedRegisters[i].getRegisterCategory());
-            assert kind != JavaKind.Illegal;
             zapValues[i] = zapValueForKind(kind);
         }
         ((AMD64HotSpotLIRGenerationResult) getResult()).getCalleeSaveInfo().put(currentRuntimeCallInfo, emitZapRegisters(zappedRegisters, zapValues));
@@ -477,7 +475,7 @@
         // TODO(mg): in case a native function uses floating point varargs, the ABI requires that
         // RAX contains the length of the varargs
         PrimitiveConstant intConst = JavaConstant.forInt(numberOfFloatingPointArguments);
-        AllocatableValue numberOfFloatingPointArgumentsRegister = AMD64.rax.asValue(LIRKind.value(JavaKind.Int));
+        AllocatableValue numberOfFloatingPointArgumentsRegister = AMD64.rax.asValue(LIRKind.value(AMD64Kind.DWORD));
         emitMoveConstant(numberOfFloatingPointArgumentsRegister, intConst);
         for (int i = 0; i < args.length; i++) {
             Value arg = args[i];
@@ -485,7 +483,7 @@
             emitMove(loc, arg);
             argLocations[i] = loc;
         }
-        Value ptr = emitLoadConstant(LIRKind.value(JavaKind.Long), JavaConstant.forLong(address));
+        Value ptr = emitLoadConstant(LIRKind.value(AMD64Kind.QWORD), JavaConstant.forLong(address));
         append(new AMD64CCall(nativeCallingConvention.getReturn(), ptr, numberOfFloatingPointArgumentsRegister, argLocations));
     }
 
@@ -520,7 +518,7 @@
     @Override
     public void emitDeoptimizeCaller(DeoptimizationAction action, DeoptimizationReason reason) {
         Value actionAndReason = emitJavaConstant(getMetaAccess().encodeDeoptActionAndReason(action, reason, 0));
-        Value nullValue = emitConstant(LIRKind.reference(JavaKind.Long), JavaConstant.NULL_POINTER);
+        Value nullValue = emitConstant(LIRKind.reference(AMD64Kind.QWORD), JavaConstant.NULL_POINTER);
         moveDeoptValuesToThread(actionAndReason, nullValue);
         append(new AMD64HotSpotDeoptimizeCallerOp(saveRbp.getRbpRescueSlot()));
     }
@@ -554,12 +552,12 @@
     }
 
     @Override
-    protected void emitStoreConst(JavaKind kind, AMD64AddressValue address, ConstantValue value, LIRFrameState state) {
+    protected void emitStoreConst(AMD64Kind kind, AMD64AddressValue address, ConstantValue value, LIRFrameState state) {
         Constant c = value.getConstant();
         if (c instanceof HotSpotConstant && !JavaConstant.isNull(c)) {
             HotSpotConstant hc = (HotSpotConstant) c;
             if (hc.isCompressed()) {
-                assert kind == JavaKind.Int;
+                assert kind == AMD64Kind.DWORD;
                 if (!target().inlineObjects && hc instanceof HotSpotObjectConstant) {
                     emitStore(kind, address, asAllocatable(value), state);
                 } else {
@@ -576,18 +574,18 @@
     @Override
     public Value emitCompress(Value pointer, CompressEncoding encoding, boolean nonNull) {
         LIRKind inputKind = pointer.getLIRKind();
-        assert inputKind.getPlatformKind() == JavaKind.Long;
+        assert inputKind.getPlatformKind() == AMD64Kind.QWORD;
         if (inputKind.isReference(0)) {
             // oop
-            Variable result = newVariable(LIRKind.reference(JavaKind.Int));
+            Variable result = newVariable(LIRKind.reference(AMD64Kind.DWORD));
             append(new AMD64HotSpotMove.CompressPointer(result, asAllocatable(pointer), getProviders().getRegisters().getHeapBaseRegister().asValue(), encoding, nonNull));
             return result;
         } else {
             // metaspace pointer
-            Variable result = newVariable(LIRKind.value(JavaKind.Int));
+            Variable result = newVariable(LIRKind.value(AMD64Kind.DWORD));
             AllocatableValue base = Value.ILLEGAL;
             if (encoding.base != 0) {
-                base = emitLoadConstant(LIRKind.value(JavaKind.Long), JavaConstant.forLong(encoding.base));
+                base = emitLoadConstant(LIRKind.value(AMD64Kind.QWORD), JavaConstant.forLong(encoding.base));
             }
             append(new AMD64HotSpotMove.CompressPointer(result, asAllocatable(pointer), base, encoding, nonNull));
             return result;
@@ -597,18 +595,18 @@
     @Override
     public Value emitUncompress(Value pointer, CompressEncoding encoding, boolean nonNull) {
         LIRKind inputKind = pointer.getLIRKind();
-        assert inputKind.getPlatformKind() == JavaKind.Int;
+        assert inputKind.getPlatformKind() == AMD64Kind.DWORD;
         if (inputKind.isReference(0)) {
             // oop
-            Variable result = newVariable(LIRKind.reference(JavaKind.Long));
+            Variable result = newVariable(LIRKind.reference(AMD64Kind.QWORD));
             append(new AMD64HotSpotMove.UncompressPointer(result, asAllocatable(pointer), getProviders().getRegisters().getHeapBaseRegister().asValue(), encoding, nonNull));
             return result;
         } else {
             // metaspace pointer
-            Variable result = newVariable(LIRKind.value(JavaKind.Long));
+            Variable result = newVariable(LIRKind.value(AMD64Kind.QWORD));
             AllocatableValue base = Value.ILLEGAL;
             if (encoding.base != 0) {
-                base = emitLoadConstant(LIRKind.value(JavaKind.Long), JavaConstant.forLong(encoding.base));
+                base = emitLoadConstant(LIRKind.value(AMD64Kind.QWORD), JavaConstant.forLong(encoding.base));
             }
             append(new AMD64HotSpotMove.UncompressPointer(result, asAllocatable(pointer), base, encoding, nonNull));
             return result;
@@ -630,7 +628,7 @@
 
     @Override
     public void emitNullCheck(Value address, LIRFrameState state) {
-        if (address.getLIRKind().getPlatformKind() == JavaKind.Int) {
+        if (address.getLIRKind().getPlatformKind() == AMD64Kind.DWORD) {
             CompressEncoding encoding = config.getOopEncoding();
             Value uncompressed;
             if (encoding.shift <= 3) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRKindTool.java	Fri Sep 18 13:12:02 2015 +0200
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2015, 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.amd64;
+
+import jdk.internal.jvmci.amd64.AMD64Kind;
+import jdk.internal.jvmci.meta.LIRKind;
+
+import com.oracle.graal.compiler.amd64.AMD64LIRKindTool;
+import com.oracle.graal.hotspot.nodes.type.HotSpotLIRKindTool;
+
+public class AMD64HotSpotLIRKindTool extends AMD64LIRKindTool implements HotSpotLIRKindTool {
+
+    public LIRKind getNarrowOopKind() {
+        return LIRKind.reference(AMD64Kind.DWORD);
+    }
+
+    public LIRKind getNarrowPointerKind() {
+        return LIRKind.value(AMD64Kind.DWORD);
+    }
+}
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotMove.java	Fri Sep 18 11:41:06 2015 +0200
+++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotMove.java	Fri Sep 18 13:12:02 2015 +0200
@@ -29,6 +29,7 @@
 import static jdk.internal.jvmci.code.ValueUtil.asRegister;
 import static jdk.internal.jvmci.code.ValueUtil.isRegister;
 import static jdk.internal.jvmci.code.ValueUtil.isStackSlot;
+import jdk.internal.jvmci.amd64.AMD64Kind;
 import jdk.internal.jvmci.code.Register;
 import jdk.internal.jvmci.code.StackSlotValue;
 import jdk.internal.jvmci.common.JVMCIError;
@@ -38,7 +39,6 @@
 import jdk.internal.jvmci.meta.AllocatableValue;
 import jdk.internal.jvmci.meta.Constant;
 import jdk.internal.jvmci.meta.JavaConstant;
-import jdk.internal.jvmci.meta.JavaKind;
 import jdk.internal.jvmci.meta.Value;
 
 import com.oracle.graal.asm.Label;
@@ -192,7 +192,7 @@
 
         @Override
         public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) {
-            AMD64Move.move(JavaKind.Long, crb, masm, result, input);
+            AMD64Move.move(AMD64Kind.QWORD, crb, masm, result, input);
 
             Register resReg = asRegister(result);
             if (encoding.base != 0) {
@@ -240,8 +240,7 @@
 
         @Override
         public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) {
-            assert result.getPlatformKind() instanceof JavaKind : "Can only deal with Kind: " + result.getLIRKind();
-            JavaKind kind = (JavaKind) result.getPlatformKind();
+            AMD64Kind kind = (AMD64Kind) result.getPlatformKind();
             AMD64Move.move(kind, crb, masm, result, input);
             AMD64Move.move(kind, crb, masm, stackSlot, input);
         }
@@ -268,7 +267,7 @@
 
         @Override
         public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) {
-            AMD64Move.move(JavaKind.Int, crb, masm, result, input);
+            AMD64Move.move(AMD64Kind.DWORD, crb, masm, result, input);
 
             Register resReg = asRegister(result);
             if (encoding.shift != 0) {
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java	Fri Sep 18 11:41:06 2015 +0200
+++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java	Fri Sep 18 13:12:02 2015 +0200
@@ -27,6 +27,7 @@
 import static jdk.internal.jvmci.code.ValueUtil.isStackSlot;
 import static jdk.internal.jvmci.hotspot.HotSpotVMConfig.config;
 import jdk.internal.jvmci.amd64.AMD64;
+import jdk.internal.jvmci.amd64.AMD64Kind;
 import jdk.internal.jvmci.code.BytecodeFrame;
 import jdk.internal.jvmci.code.CallingConvention;
 import jdk.internal.jvmci.code.Register;
@@ -35,7 +36,6 @@
 import jdk.internal.jvmci.code.ValueUtil;
 import jdk.internal.jvmci.hotspot.HotSpotResolvedJavaMethod;
 import jdk.internal.jvmci.meta.AllocatableValue;
-import jdk.internal.jvmci.meta.JavaKind;
 import jdk.internal.jvmci.meta.LIRKind;
 import jdk.internal.jvmci.meta.Value;
 
@@ -81,7 +81,7 @@
 
     @Override
     protected DebugInfoBuilder createDebugInfoBuilder(StructuredGraph graph, NodeValueMap nodeValueMap) {
-        HotSpotLockStack lockStack = new HotSpotLockStack(gen.getResult().getFrameMapBuilder(), LIRKind.value(JavaKind.Long));
+        HotSpotLockStack lockStack = new HotSpotLockStack(gen.getResult().getFrameMapBuilder(), LIRKind.value(AMD64Kind.QWORD));
         return new HotSpotDebugInfoBuilder(nodeValueMap, lockStack);
     }
 
@@ -100,7 +100,7 @@
                 }
             }
         }
-        params[params.length - 1] = rbp.asValue(LIRKind.value(JavaKind.Long));
+        params[params.length - 1] = rbp.asValue(LIRKind.value(AMD64Kind.QWORD));
 
         gen.emitIncomingValues(params);
 
@@ -187,7 +187,7 @@
 
         RegisterValue raxLocal = AMD64.rax.asValue(expected.getLIRKind());
         gen.emitMove(raxLocal, expected);
-        append(new CompareAndSwapOp((JavaKind) expected.getPlatformKind(), raxLocal, getGen().asAddressValue(operand(x.getAddress())), raxLocal, newVal));
+        append(new CompareAndSwapOp((AMD64Kind) expected.getPlatformKind(), raxLocal, getGen().asAddressValue(operand(x.getAddress())), raxLocal, newVal));
 
         setResult(x, gen.emitMove(raxLocal));
     }
--- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Arithmetic.java	Fri Sep 18 11:41:06 2015 +0200
+++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Arithmetic.java	Fri Sep 18 13:12:02 2015 +0200
@@ -24,8 +24,8 @@
 
 import static jdk.internal.jvmci.code.ValueUtil.asRegister;
 import jdk.internal.jvmci.amd64.AMD64;
+import jdk.internal.jvmci.amd64.AMD64Kind;
 import jdk.internal.jvmci.meta.AllocatableValue;
-import jdk.internal.jvmci.meta.JavaKind;
 import jdk.internal.jvmci.meta.LIRKind;
 
 import com.oracle.graal.asm.Label;
@@ -53,7 +53,7 @@
             super(TYPE);
             this.opcode = opcode;
             this.result = result;
-            this.raxTemp = AMD64.rax.asValue(LIRKind.value(JavaKind.Int));
+            this.raxTemp = AMD64.rax.asValue(LIRKind.value(AMD64Kind.DWORD));
             this.x = x;
             this.y = y;
         }
@@ -98,8 +98,8 @@
         @Override
         public void verify() {
             super.verify();
-            assert (opcode.name().startsWith("F") && result.getPlatformKind() == JavaKind.Float && x.getPlatformKind() == JavaKind.Float && y.getPlatformKind() == JavaKind.Float) ||
-                            (opcode.name().startsWith("D") && result.getPlatformKind() == JavaKind.Double && x.getPlatformKind() == JavaKind.Double && y.getPlatformKind() == JavaKind.Double);
+            assert (opcode.name().startsWith("F") && result.getPlatformKind() == AMD64Kind.SINGLE && x.getPlatformKind() == AMD64Kind.SINGLE && y.getPlatformKind() == AMD64Kind.SINGLE) ||
+                            (opcode.name().startsWith("D") && result.getPlatformKind() == AMD64Kind.DOUBLE && x.getPlatformKind() == AMD64Kind.DOUBLE && y.getPlatformKind() == AMD64Kind.DOUBLE);
         }
     }
 }
--- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ArrayEqualsOp.java	Fri Sep 18 11:41:06 2015 +0200
+++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ArrayEqualsOp.java	Fri Sep 18 13:12:02 2015 +0200
@@ -31,6 +31,7 @@
 
 import jdk.internal.jvmci.amd64.AMD64;
 import jdk.internal.jvmci.amd64.AMD64.CPUFeature;
+import jdk.internal.jvmci.amd64.AMD64Kind;
 import jdk.internal.jvmci.code.Register;
 import jdk.internal.jvmci.code.TargetDescription;
 import jdk.internal.jvmci.meta.JavaKind;
@@ -92,8 +93,8 @@
 
         // We only need the vector temporaries if we generate SSE code.
         if (supportsSSE41(tool.target())) {
-            this.vectorTemp1 = tool.newVariable(LIRKind.value(JavaKind.Double));
-            this.vectorTemp2 = tool.newVariable(LIRKind.value(JavaKind.Double));
+            this.vectorTemp1 = tool.newVariable(LIRKind.value(AMD64Kind.DOUBLE));
+            this.vectorTemp2 = tool.newVariable(LIRKind.value(AMD64Kind.DOUBLE));
         } else {
             this.vectorTemp1 = Value.ILLEGAL;
             this.vectorTemp2 = Value.ILLEGAL;
@@ -161,8 +162,8 @@
     private void emitSSE41Compare(CompilationResultBuilder crb, AMD64MacroAssembler masm, Register result, Register array1, Register array2, Register length, Label trueLabel, Label falseLabel) {
         assert supportsSSE41(crb.target);
 
-        Register vector1 = asRegister(vectorTemp1, JavaKind.Double);
-        Register vector2 = asRegister(vectorTemp2, JavaKind.Double);
+        Register vector1 = asRegister(vectorTemp1, AMD64Kind.DOUBLE);
+        Register vector2 = asRegister(vectorTemp2, AMD64Kind.DOUBLE);
 
         Label loop = new Label();
         Label compareTail = new Label();
--- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ByteSwapOp.java	Fri Sep 18 11:41:06 2015 +0200
+++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ByteSwapOp.java	Fri Sep 18 13:12:02 2015 +0200
@@ -22,8 +22,9 @@
  */
 package com.oracle.graal.lir.amd64;
 
+import jdk.internal.jvmci.amd64.AMD64Kind;
 import jdk.internal.jvmci.code.ValueUtil;
-import jdk.internal.jvmci.meta.JavaKind;
+import jdk.internal.jvmci.common.JVMCIError;
 import jdk.internal.jvmci.meta.Value;
 
 import com.oracle.graal.asm.amd64.AMD64MacroAssembler;
@@ -47,12 +48,15 @@
     @Override
     public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) {
         AMD64Move.move(crb, masm, result, input);
-        switch ((JavaKind) input.getPlatformKind()) {
-            case Int:
-                masm.bswapl(ValueUtil.asRegister(result, JavaKind.Int));
+        switch ((AMD64Kind) input.getPlatformKind()) {
+            case DWORD:
+                masm.bswapl(ValueUtil.asRegister(result));
                 break;
-            case Long:
-                masm.bswapq(ValueUtil.asRegister(result, JavaKind.Long));
+            case QWORD:
+                masm.bswapq(ValueUtil.asRegister(result));
+                break;
+            default:
+                throw JVMCIError.shouldNotReachHere();
         }
     }
 }
--- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Call.java	Fri Sep 18 11:41:06 2015 +0200
+++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Call.java	Fri Sep 18 13:12:02 2015 +0200
@@ -28,12 +28,12 @@
 import static jdk.internal.jvmci.code.ValueUtil.asRegister;
 import static jdk.internal.jvmci.code.ValueUtil.isRegister;
 import jdk.internal.jvmci.amd64.AMD64;
+import jdk.internal.jvmci.amd64.AMD64Kind;
 import jdk.internal.jvmci.code.Register;
 import jdk.internal.jvmci.code.RegisterValue;
 import jdk.internal.jvmci.code.ValueUtil;
 import jdk.internal.jvmci.meta.AllocatableValue;
 import jdk.internal.jvmci.meta.InvokeTarget;
-import jdk.internal.jvmci.meta.JavaKind;
 import jdk.internal.jvmci.meta.LIRKind;
 import jdk.internal.jvmci.meta.ResolvedJavaMethod;
 import jdk.internal.jvmci.meta.Value;
@@ -171,7 +171,7 @@
              * The register allocator does not support virtual registers that are used at the call
              * site, so use a fixed register.
              */
-            callTemp = AMD64.rax.asValue(LIRKind.value(JavaKind.Long));
+            callTemp = AMD64.rax.asValue(LIRKind.value(AMD64Kind.QWORD));
             assert ValueUtil.differentRegisters(parameters, callTemp);
         }
 
--- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ControlFlow.java	Fri Sep 18 11:41:06 2015 +0200
+++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ControlFlow.java	Fri Sep 18 13:12:02 2015 +0200
@@ -30,13 +30,13 @@
 import static jdk.internal.jvmci.code.ValueUtil.asRegister;
 import static jdk.internal.jvmci.code.ValueUtil.isRegister;
 import jdk.internal.jvmci.amd64.AMD64;
+import jdk.internal.jvmci.amd64.AMD64Kind;
 import jdk.internal.jvmci.code.CompilationResult.JumpTable;
 import jdk.internal.jvmci.code.Register;
 import jdk.internal.jvmci.common.JVMCIError;
 import jdk.internal.jvmci.meta.AllocatableValue;
 import jdk.internal.jvmci.meta.Constant;
 import jdk.internal.jvmci.meta.JavaConstant;
-import jdk.internal.jvmci.meta.JavaKind;
 import jdk.internal.jvmci.meta.Value;
 
 import com.oracle.graal.asm.Label;
@@ -164,7 +164,6 @@
             this.scratch = scratch;
             assert keyConstants.length == keyTargets.length;
             assert keyConstants.length == strategy.keyProbabilities.length;
-            assert (scratch.getPlatformKind() == JavaKind.Illegal) == (key.getPlatformKind() == JavaKind.Int || key.getPlatformKind() == JavaKind.Long);
         }
 
         @Override
@@ -237,9 +236,9 @@
 
         @Override
         public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) {
-            Register indexReg = asRegister(index, JavaKind.Int);
-            Register idxScratchReg = asRegister(idxScratch, JavaKind.Int);
-            Register scratchReg = asRegister(scratch, JavaKind.Long);
+            Register indexReg = asRegister(index, AMD64Kind.DWORD);
+            Register idxScratchReg = asRegister(idxScratch, AMD64Kind.DWORD);
+            Register scratchReg = asRegister(scratch, AMD64Kind.QWORD);
 
             if (!indexReg.equals(idxScratchReg)) {
                 masm.movl(idxScratchReg, indexReg);
@@ -377,15 +376,13 @@
     private static void cmove(CompilationResultBuilder crb, AMD64MacroAssembler masm, Value result, ConditionFlag cond, Value other) {
         if (isRegister(other)) {
             assert !asRegister(other).equals(asRegister(result)) : "other already overwritten by previous move";
-            switch ((JavaKind) other.getPlatformKind()) {
-                case Boolean:
-                case Byte:
-                case Short:
-                case Char:
-                case Int:
+            switch ((AMD64Kind) other.getPlatformKind()) {
+                case BYTE:
+                case WORD:
+                case DWORD:
                     masm.cmovl(cond, asRegister(result), asRegister(other));
                     break;
-                case Long:
+                case QWORD:
                     masm.cmovq(cond, asRegister(result), asRegister(other));
                     break;
                 default:
@@ -393,15 +390,13 @@
             }
         } else {
             AMD64Address addr = (AMD64Address) crb.asAddress(other);
-            switch ((JavaKind) other.getPlatformKind()) {
-                case Boolean:
-                case Byte:
-                case Short:
-                case Char:
-                case Int:
+            switch ((AMD64Kind) other.getPlatformKind()) {
+                case BYTE:
+                case WORD:
+                case DWORD:
                     masm.cmovl(cond, asRegister(result), addr);
                     break;
-                case Long:
+                case QWORD:
                     masm.cmovq(cond, asRegister(result), addr);
                     break;
                 default:
--- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64FrameMap.java	Fri Sep 18 11:41:06 2015 +0200
+++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64FrameMap.java	Fri Sep 18 13:12:02 2015 +0200
@@ -23,10 +23,10 @@
 package com.oracle.graal.lir.amd64;
 
 import static jdk.internal.jvmci.code.ValueUtil.asStackSlot;
+import jdk.internal.jvmci.amd64.AMD64Kind;
 import jdk.internal.jvmci.code.CodeCacheProvider;
 import jdk.internal.jvmci.code.RegisterConfig;
 import jdk.internal.jvmci.code.StackSlot;
-import jdk.internal.jvmci.meta.JavaKind;
 import jdk.internal.jvmci.meta.LIRKind;
 
 import com.oracle.graal.asm.NumUtil;
@@ -39,7 +39,7 @@
  *
  * <pre>
  *   Base       Contents
- *
+ * 
  *            :                                :  -----
  *   caller   | incoming overflow argument n   |    ^
  *   frame    :     ...                        :    | positive
@@ -121,19 +121,19 @@
      */
     StackSlot allocateRBPSpillSlot() {
         assert spillSize == initialSpillSize : "RBP spill slot must be the first allocated stack slots";
-        rbpSpillSlot = allocateSpillSlot(LIRKind.value(JavaKind.Long));
+        rbpSpillSlot = allocateSpillSlot(LIRKind.value(AMD64Kind.QWORD));
         assert asStackSlot(rbpSpillSlot).getRawOffset() == -16 : asStackSlot(rbpSpillSlot).getRawOffset();
         return rbpSpillSlot;
     }
 
     void freeRBPSpillSlot() {
-        int size = spillSlotSize(LIRKind.value(JavaKind.Long));
+        int size = spillSlotSize(LIRKind.value(AMD64Kind.QWORD));
         assert spillSize == NumUtil.roundUp(initialSpillSize + size, size) : "RBP spill slot can not be freed after allocation other stack slots";
         spillSize = initialSpillSize;
     }
 
     public StackSlot allocateDeoptimizationRescueSlot() {
-        assert spillSize == initialSpillSize || spillSize == initialSpillSize + spillSlotSize(LIRKind.value(JavaKind.Long)) : "Deoptimization rescue slot must be the first or second (if there is an RBP spill slot) stack slot";
-        return allocateSpillSlot(LIRKind.value(JavaKind.Long));
+        assert spillSize == initialSpillSize || spillSize == initialSpillSize + spillSlotSize(LIRKind.value(AMD64Kind.QWORD)) : "Deoptimization rescue slot must be the first or second (if there is an RBP spill slot) stack slot";
+        return allocateSpillSlot(LIRKind.value(AMD64Kind.QWORD));
     }
 }
--- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64MathIntrinsicOp.java	Fri Sep 18 11:41:06 2015 +0200
+++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64MathIntrinsicOp.java	Fri Sep 18 13:12:02 2015 +0200
@@ -23,8 +23,8 @@
 package com.oracle.graal.lir.amd64;
 
 import static jdk.internal.jvmci.code.ValueUtil.asRegister;
+import jdk.internal.jvmci.amd64.AMD64Kind;
 import jdk.internal.jvmci.common.JVMCIError;
-import jdk.internal.jvmci.meta.JavaKind;
 import jdk.internal.jvmci.meta.Value;
 
 import com.oracle.graal.asm.amd64.AMD64MacroAssembler;
@@ -54,11 +54,11 @@
     @Override
     public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) {
         switch (opcode) {
-            case LOG:   masm.flog(asRegister(result, JavaKind.Double), asRegister(input, JavaKind.Double), false); break;
-            case LOG10: masm.flog(asRegister(result, JavaKind.Double), asRegister(input, JavaKind.Double), true); break;
-            case SIN:   masm.fsin(asRegister(result, JavaKind.Double), asRegister(input, JavaKind.Double)); break;
-            case COS:   masm.fcos(asRegister(result, JavaKind.Double), asRegister(input, JavaKind.Double)); break;
-            case TAN:   masm.ftan(asRegister(result, JavaKind.Double), asRegister(input, JavaKind.Double)); break;
+            case LOG:   masm.flog(asRegister(result, AMD64Kind.DOUBLE), asRegister(input, AMD64Kind.DOUBLE), false); break;
+            case LOG10: masm.flog(asRegister(result, AMD64Kind.DOUBLE), asRegister(input, AMD64Kind.DOUBLE), true); break;
+            case SIN:   masm.fsin(asRegister(result, AMD64Kind.DOUBLE), asRegister(input, AMD64Kind.DOUBLE)); break;
+            case COS:   masm.fcos(asRegister(result, AMD64Kind.DOUBLE), asRegister(input, AMD64Kind.DOUBLE)); break;
+            case TAN:   masm.ftan(asRegister(result, AMD64Kind.DOUBLE), asRegister(input, AMD64Kind.DOUBLE)); break;
             default:    throw JVMCIError.shouldNotReachHere();
         }
     }
--- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java	Fri Sep 18 11:41:06 2015 +0200
+++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java	Fri Sep 18 13:12:02 2015 +0200
@@ -36,13 +36,13 @@
 import static jdk.internal.jvmci.code.ValueUtil.isStackSlot;
 import static jdk.internal.jvmci.code.ValueUtil.isStackSlotValue;
 import jdk.internal.jvmci.amd64.AMD64;
+import jdk.internal.jvmci.amd64.AMD64Kind;
 import jdk.internal.jvmci.code.Register;
 import jdk.internal.jvmci.code.StackSlotValue;
 import jdk.internal.jvmci.common.JVMCIError;
 import jdk.internal.jvmci.meta.AllocatableValue;
 import jdk.internal.jvmci.meta.Constant;
 import jdk.internal.jvmci.meta.JavaConstant;
-import jdk.internal.jvmci.meta.JavaKind;
 import jdk.internal.jvmci.meta.Value;
 
 import com.oracle.graal.asm.NumUtil;
@@ -64,16 +64,11 @@
     private abstract static class AbstractMoveOp extends AMD64LIRInstruction implements ValueMoveOp {
         public static final LIRInstructionClass<AbstractMoveOp> TYPE = LIRInstructionClass.create(AbstractMoveOp.class);
 
-        private JavaKind moveKind;
+        private AMD64Kind moveKind;
 
-        protected AbstractMoveOp(LIRInstructionClass<? extends AbstractMoveOp> c, JavaKind moveKind) {
+        protected AbstractMoveOp(LIRInstructionClass<? extends AbstractMoveOp> c, AMD64Kind moveKind) {
             super(c);
-            if (moveKind == JavaKind.Illegal) {
-                // unknown operand size, conservatively move the whole register
-                this.moveKind = JavaKind.Long;
-            } else {
-                this.moveKind = moveKind;
-            }
+            this.moveKind = moveKind;
         }
 
         @Override
@@ -89,7 +84,7 @@
         @Def({REG, HINT}) protected AllocatableValue result;
         @Use({REG, STACK}) protected AllocatableValue input;
 
-        public MoveToRegOp(JavaKind moveKind, AllocatableValue result, AllocatableValue input) {
+        public MoveToRegOp(AMD64Kind moveKind, AllocatableValue result, AllocatableValue input) {
             super(TYPE, moveKind);
             this.result = result;
             this.input = input;
@@ -113,7 +108,7 @@
         @Def({REG, STACK}) protected AllocatableValue result;
         @Use({REG, HINT}) protected AllocatableValue input;
 
-        public MoveFromRegOp(JavaKind moveKind, AllocatableValue result, AllocatableValue input) {
+        public MoveFromRegOp(AMD64Kind moveKind, AllocatableValue result, AllocatableValue input) {
             super(TYPE, moveKind);
             this.result = result;
             this.input = input;
@@ -200,14 +195,19 @@
 
         @Override
         public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) {
+            AMD64Kind backupKind = (AMD64Kind) backupSlot.getPlatformKind();
+            if (backupKind.isXMM()) {
+                // graal doesn't use vector values, so it's safe to backup using DOUBLE
+                backupKind = AMD64Kind.DOUBLE;
+            }
+
             // backup scratch register
-            move((JavaKind) backupSlot.getPlatformKind(), crb, masm, backupSlot, scratch.asValue(backupSlot.getLIRKind()));
+            reg2stack(backupKind, crb, masm, backupSlot, scratch);
             // move stack slot
-            move((JavaKind) getInput().getPlatformKind(), crb, masm, scratch.asValue(getInput().getLIRKind()), getInput());
-            move((JavaKind) getResult().getPlatformKind(), crb, masm, getResult(), scratch.asValue(getResult().getLIRKind()));
+            stack2reg((AMD64Kind) getInput().getPlatformKind(), crb, masm, scratch, getInput());
+            reg2stack((AMD64Kind) getResult().getPlatformKind(), crb, masm, getResult(), scratch);
             // restore scratch register
-            move((JavaKind) backupSlot.getPlatformKind(), crb, masm, scratch.asValue(backupSlot.getLIRKind()), backupSlot);
-
+            stack2reg(backupKind, crb, masm, scratch, backupSlot);
         }
     }
 
@@ -231,18 +231,23 @@
 
         @Override
         public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) {
+            AMD64Kind backupKind = (AMD64Kind) backupSlot.getPlatformKind();
+            if (backupKind.isXMM()) {
+                // graal doesn't use vector values, so it's safe to backup using DOUBLE
+                backupKind = AMD64Kind.DOUBLE;
+            }
+
             // backup scratch register
-            move((JavaKind) backupSlot.getPlatformKind(), crb, masm, backupSlot, scratch.asValue(backupSlot.getLIRKind()));
+            move(backupKind, crb, masm, backupSlot, scratch.asValue(backupSlot.getLIRKind()));
             for (int i = 0; i < results.length; i++) {
                 Value input = inputs[i];
                 AllocatableValue result = results[i];
                 // move stack slot
-                move((JavaKind) input.getPlatformKind(), crb, masm, scratch.asValue(input.getLIRKind()), input);
-                move((JavaKind) result.getPlatformKind(), crb, masm, result, scratch.asValue(result.getLIRKind()));
+                move((AMD64Kind) input.getPlatformKind(), crb, masm, scratch.asValue(input.getLIRKind()), input);
+                move((AMD64Kind) result.getPlatformKind(), crb, masm, result, scratch.asValue(result.getLIRKind()));
             }
             // restore scratch register
-            move((JavaKind) backupSlot.getPlatformKind(), crb, masm, scratch.asValue(backupSlot.getLIRKind()), backupSlot);
-
+            move(backupKind, crb, masm, scratch.asValue(backupSlot.getLIRKind()), backupSlot);
         }
     }
 
@@ -292,7 +297,7 @@
 
         @Override
         public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) {
-            masm.leaq(asRegister(result, JavaKind.Long), address.toAddress());
+            masm.leaq(asRegister(result, AMD64Kind.QWORD), address.toAddress());
         }
     }
 
@@ -329,7 +334,7 @@
 
         @Override
         public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) {
-            masm.leaq(asRegister(result, JavaKind.Long), (AMD64Address) crb.asAddress(slot));
+            masm.leaq(asRegister(result, AMD64Kind.QWORD), (AMD64Address) crb.asAddress(slot));
         }
     }
 
@@ -380,14 +385,14 @@
     public static final class CompareAndSwapOp extends AMD64LIRInstruction {
         public static final LIRInstructionClass<CompareAndSwapOp> TYPE = LIRInstructionClass.create(CompareAndSwapOp.class);
 
-        private final JavaKind accessKind;
+        private final AMD64Kind accessKind;
 
         @Def protected AllocatableValue result;
         @Use({COMPOSITE}) protected AMD64AddressValue address;
         @Use protected AllocatableValue cmpValue;
         @Use protected AllocatableValue newValue;
 
-        public CompareAndSwapOp(JavaKind accessKind, AllocatableValue result, AMD64AddressValue address, AllocatableValue cmpValue, AllocatableValue newValue) {
+        public CompareAndSwapOp(AMD64Kind accessKind, AllocatableValue result, AMD64AddressValue address, AllocatableValue cmpValue, AllocatableValue newValue) {
             super(TYPE);
             this.accessKind = accessKind;
             this.result = result;
@@ -404,11 +409,10 @@
                 masm.lock();
             }
             switch (accessKind) {
-                case Int:
+                case DWORD:
                     masm.cmpxchgl(asRegister(newValue), address.toAddress());
                     break;
-                case Long:
-                case Object:
+                case QWORD:
                     masm.cmpxchgq(asRegister(newValue), address.toAddress());
                     break;
                 default:
@@ -421,13 +425,13 @@
     public static final class AtomicReadAndAddOp extends AMD64LIRInstruction {
         public static final LIRInstructionClass<AtomicReadAndAddOp> TYPE = LIRInstructionClass.create(AtomicReadAndAddOp.class);
 
-        private final JavaKind accessKind;
+        private final AMD64Kind accessKind;
 
         @Def protected AllocatableValue result;
         @Alive({COMPOSITE}) protected AMD64AddressValue address;
         @Use protected AllocatableValue delta;
 
-        public AtomicReadAndAddOp(JavaKind accessKind, AllocatableValue result, AMD64AddressValue address, AllocatableValue delta) {
+        public AtomicReadAndAddOp(AMD64Kind accessKind, AllocatableValue result, AMD64AddressValue address, AllocatableValue delta) {
             super(TYPE);
             this.accessKind = accessKind;
             this.result = result;
@@ -442,10 +446,10 @@
                 masm.lock();
             }
             switch (accessKind) {
-                case Int:
+                case DWORD:
                     masm.xaddl(address.toAddress(), asRegister(result));
                     break;
-                case Long:
+                case QWORD:
                     masm.xaddq(address.toAddress(), asRegister(result));
                     break;
                 default:
@@ -458,13 +462,13 @@
     public static final class AtomicReadAndWriteOp extends AMD64LIRInstruction {
         public static final LIRInstructionClass<AtomicReadAndWriteOp> TYPE = LIRInstructionClass.create(AtomicReadAndWriteOp.class);
 
-        private final JavaKind accessKind;
+        private final AMD64Kind accessKind;
 
         @Def protected AllocatableValue result;
         @Alive({COMPOSITE}) protected AMD64AddressValue address;
         @Use protected AllocatableValue newValue;
 
-        public AtomicReadAndWriteOp(JavaKind accessKind, AllocatableValue result, AMD64AddressValue address, AllocatableValue newValue) {
+        public AtomicReadAndWriteOp(AMD64Kind accessKind, AllocatableValue result, AMD64AddressValue address, AllocatableValue newValue) {
             super(TYPE);
             this.accessKind = accessKind;
             this.result = result;
@@ -476,11 +480,10 @@
         public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) {
             move(accessKind, crb, masm, result, newValue);
             switch (accessKind) {
-                case Int:
+                case DWORD:
                     masm.xchgl(asRegister(result), address.toAddress());
                     break;
-                case Long:
-                case Object:
+                case QWORD:
                     masm.xchgq(asRegister(result), address.toAddress());
                     break;
                 default:
@@ -490,21 +493,21 @@
     }
 
     public static void move(CompilationResultBuilder crb, AMD64MacroAssembler masm, Value result, Value input) {
-        move((JavaKind) result.getPlatformKind(), crb, masm, result, input);
+        move((AMD64Kind) result.getPlatformKind(), crb, masm, result, input);
     }
 
-    public static void move(JavaKind moveKind, CompilationResultBuilder crb, AMD64MacroAssembler masm, Value result, Value input) {
+    public static void move(AMD64Kind moveKind, CompilationResultBuilder crb, AMD64MacroAssembler masm, Value result, Value input) {
         if (isRegister(input)) {
             if (isRegister(result)) {
                 reg2reg(moveKind, masm, result, input);
             } else if (isStackSlot(result)) {
-                reg2stack(moveKind, crb, masm, result, input);
+                reg2stack(moveKind, crb, masm, result, asRegister(input));
             } else {
                 throw JVMCIError.shouldNotReachHere();
             }
         } else if (isStackSlot(input)) {
             if (isRegister(result)) {
-                stack2reg(moveKind, crb, masm, result, input);
+                stack2reg(moveKind, crb, masm, asRegister(result), input);
             } else {
                 throw JVMCIError.shouldNotReachHere();
             }
@@ -521,91 +524,76 @@
         }
     }
 
-    private static void reg2reg(JavaKind kind, AMD64MacroAssembler masm, Value result, Value input) {
+    private static void reg2reg(AMD64Kind kind, AMD64MacroAssembler masm, Value result, Value input) {
         if (asRegister(input).equals(asRegister(result))) {
             return;
         }
-        switch (kind.getStackKind()) {
-            case Int:
+        switch (kind) {
+            case BYTE:
+            case WORD:
+            case DWORD:
                 masm.movl(asRegister(result), asRegister(input));
                 break;
-            case Long:
+            case QWORD:
                 masm.movq(asRegister(result), asRegister(input));
                 break;
-            case Float:
-                masm.movflt(asRegister(result, JavaKind.Float), asRegister(input, JavaKind.Float));
+            case SINGLE:
+                masm.movflt(asRegister(result, AMD64Kind.SINGLE), asRegister(input, AMD64Kind.SINGLE));
                 break;
-            case Double:
-                masm.movdbl(asRegister(result, JavaKind.Double), asRegister(input, JavaKind.Double));
-                break;
-            case Object:
-                masm.movq(asRegister(result), asRegister(input));
+            case DOUBLE:
+                masm.movdbl(asRegister(result, AMD64Kind.DOUBLE), asRegister(input, AMD64Kind.DOUBLE));
                 break;
             default:
-                throw JVMCIError.shouldNotReachHere("kind=" + result.getPlatformKind());
+                throw JVMCIError.shouldNotReachHere("kind=" + kind);
         }
     }
 
-    private static void reg2stack(JavaKind kind, CompilationResultBuilder crb, AMD64MacroAssembler masm, Value result, Value input) {
+    private static void reg2stack(AMD64Kind kind, CompilationResultBuilder crb, AMD64MacroAssembler masm, Value result, Register input) {
         AMD64Address dest = (AMD64Address) crb.asAddress(result);
         switch (kind) {
-            case Boolean:
-            case Byte:
-                masm.movb(dest, asRegister(input));
+            case BYTE:
+                masm.movb(dest, input);
                 break;
-            case Short:
-            case Char:
-                masm.movw(dest, asRegister(input));
+            case WORD:
+                masm.movw(dest, input);
                 break;
-            case Int:
-                masm.movl(dest, asRegister(input));
+            case DWORD:
+                masm.movl(dest, input);
                 break;
-            case Long:
-                masm.movq(dest, asRegister(input));
-                break;
-            case Float:
-                masm.movflt(dest, asRegister(input, JavaKind.Float));
+            case QWORD:
+                masm.movq(dest, input);
                 break;
-            case Double:
-                masm.movsd(dest, asRegister(input, JavaKind.Double));
+            case SINGLE:
+                masm.movflt(dest, input);
                 break;
-            case Object:
-                masm.movq(dest, asRegister(input));
+            case DOUBLE:
+                masm.movsd(dest, input);
                 break;
             default:
                 throw JVMCIError.shouldNotReachHere();
         }
     }
 
-    private static void stack2reg(JavaKind kind, CompilationResultBuilder crb, AMD64MacroAssembler masm, Value result, Value input) {
+    private static void stack2reg(AMD64Kind kind, CompilationResultBuilder crb, AMD64MacroAssembler masm, Register result, Value input) {
         AMD64Address src = (AMD64Address) crb.asAddress(input);
         switch (kind) {
-            case Boolean:
-                masm.movzbl(asRegister(result), src);
-                break;
-            case Byte:
-                masm.movsbl(asRegister(result), src);
+            case BYTE:
+                masm.movsbl(result, src);
                 break;
-            case Short:
-                masm.movswl(asRegister(result), src);
+            case WORD:
+                masm.movswl(result, src);
                 break;
-            case Char:
-                masm.movzwl(asRegister(result), src);
+            case DWORD:
+                masm.movl(result, src);
                 break;
-            case Int:
-                masm.movl(asRegister(result), src);
-                break;
-            case Long:
-                masm.movq(asRegister(result), src);
+            case QWORD:
+                masm.movq(result, src);
                 break;
-            case Float:
-                masm.movflt(asRegister(result, JavaKind.Float), src);
+            case SINGLE:
+                masm.movflt(result, src);
                 break;
-            case Double:
-                masm.movdbl(asRegister(result, JavaKind.Double), src);
-                break;
-            case Object:
-                masm.movq(asRegister(result), src);
+            case DOUBLE:
+                masm.movdbl(result, src);
                 break;
             default:
                 throw JVMCIError.shouldNotReachHere();
@@ -657,18 +645,18 @@
                 // This is *not* the same as 'constant == 0.0f' in the case where constant is -0.0f
                 if (Float.floatToRawIntBits(input.asFloat()) == Float.floatToRawIntBits(0.0f)) {
                     assert !crb.codeCache.needsDataPatch(input);
-                    masm.xorps(asRegister(result, JavaKind.Float), asRegister(result, JavaKind.Float));
+                    masm.xorps(asRegister(result, AMD64Kind.SINGLE), asRegister(result));
                 } else {
-                    masm.movflt(asRegister(result, JavaKind.Float), (AMD64Address) crb.asFloatConstRef(input));
+                    masm.movflt(asRegister(result, AMD64Kind.SINGLE), (AMD64Address) crb.asFloatConstRef(input));
                 }
                 break;
             case Double:
                 // This is *not* the same as 'constant == 0.0d' in the case where constant is -0.0d
                 if (Double.doubleToRawLongBits(input.asDouble()) == Double.doubleToRawLongBits(0.0d)) {
                     assert !crb.codeCache.needsDataPatch(input);
-                    masm.xorpd(asRegister(result, JavaKind.Double), asRegister(result, JavaKind.Double));
+                    masm.xorpd(asRegister(result, AMD64Kind.DOUBLE), asRegister(result));
                 } else {
-                    masm.movdbl(asRegister(result, JavaKind.Double), (AMD64Address) crb.asDoubleConstRef(input));
+                    masm.movdbl(asRegister(result, AMD64Kind.DOUBLE), (AMD64Address) crb.asDoubleConstRef(input));
                 }
                 break;
             case Object:
@@ -716,27 +704,23 @@
             default:
                 throw JVMCIError.shouldNotReachHere();
         }
-        switch ((JavaKind) result.getPlatformKind()) {
-            case Byte:
+
+        switch ((AMD64Kind) result.getPlatformKind()) {
+            case BYTE:
                 assert NumUtil.isByte(imm) : "Is not in byte range: " + imm;
                 AMD64MIOp.MOVB.emit(masm, OperandSize.BYTE, dest, (int) imm);
                 break;
-            case Short:
+            case WORD:
                 assert NumUtil.isShort(imm) : "Is not in short range: " + imm;
                 AMD64MIOp.MOV.emit(masm, OperandSize.WORD, dest, (int) imm);
                 break;
-            case Char:
-                assert NumUtil.isUShort(imm) : "Is not in char range: " + imm;
-                AMD64MIOp.MOV.emit(masm, OperandSize.WORD, dest, (int) imm);
-                break;
-            case Int:
-            case Float:
+            case DWORD:
+            case SINGLE:
                 assert NumUtil.isInt(imm) : "Is not in int range: " + imm;
                 masm.movl(dest, (int) imm);
                 break;
-            case Long:
-            case Double:
-            case Object:
+            case QWORD:
+            case DOUBLE:
                 masm.movlong(dest, imm);
                 break;
             default:
--- a/graal/com.oracle.graal.lir.jtt/src/com/oracle/graal/lir/jtt/ConstantStackCastTest.java	Fri Sep 18 11:41:06 2015 +0200
+++ b/graal/com.oracle.graal.lir.jtt/src/com/oracle/graal/lir/jtt/ConstantStackCastTest.java	Fri Sep 18 13:12:02 2015 +0200
@@ -24,10 +24,10 @@
 
 import static com.oracle.graal.lir.LIRValueUtil.asJavaConstant;
 import static com.oracle.graal.lir.LIRValueUtil.isJavaConstant;
+import jdk.internal.jvmci.amd64.AMD64Kind;
 import jdk.internal.jvmci.code.StackSlotValue;
 import jdk.internal.jvmci.common.JVMCIError;
 import jdk.internal.jvmci.meta.JavaConstant;
-import jdk.internal.jvmci.meta.JavaKind;
 import jdk.internal.jvmci.meta.LIRKind;
 import jdk.internal.jvmci.meta.Value;
 
@@ -70,8 +70,8 @@
 
         private static ConstantValue getConstant(LIRKind srcKind, JavaConstant c) {
 
-            switch ((JavaKind) srcKind.getPlatformKind()) {
-                case Byte:
+            switch ((AMD64Kind) srcKind.getPlatformKind()) {
+                case BYTE:
                     JavaConstant byteConst = JavaConstant.forByte((byte) c.asInt());
                     return new ConstantValue(srcKind, byteConst);
                 default:
@@ -80,7 +80,7 @@
         }
     }
 
-    private static final LoadConstantStackSpec stackCopyByte = new LoadConstantStackSpec(LIRKind.value(JavaKind.Int), LIRKind.value(JavaKind.Byte));
+    private static final LoadConstantStackSpec stackCopyByte = new LoadConstantStackSpec(LIRKind.value(AMD64Kind.DWORD), LIRKind.value(AMD64Kind.BYTE));
 
     @LIRIntrinsic
     public static byte testCopyByte(@SuppressWarnings("unused") LoadConstantStackSpec spec, byte value) {
--- a/graal/com.oracle.graal.lir.jtt/src/com/oracle/graal/lir/jtt/StackMoveTest.java	Fri Sep 18 11:41:06 2015 +0200
+++ b/graal/com.oracle.graal.lir.jtt/src/com/oracle/graal/lir/jtt/StackMoveTest.java	Fri Sep 18 13:12:02 2015 +0200
@@ -22,8 +22,8 @@
  */
 package com.oracle.graal.lir.jtt;
 
+import jdk.internal.jvmci.amd64.AMD64Kind;
 import jdk.internal.jvmci.code.StackSlotValue;
-import jdk.internal.jvmci.meta.JavaKind;
 import jdk.internal.jvmci.meta.LIRKind;
 import jdk.internal.jvmci.meta.Value;
 
@@ -184,7 +184,7 @@
     private static final LIRTestSpecification shortStackCopy = new StackCopySpec() {
         @Override
         protected LIRKind getLIRKind(Value value) {
-            return LIRKind.value(JavaKind.Short);
+            return LIRKind.value(AMD64Kind.WORD);
         }
     };
 
@@ -218,7 +218,7 @@
     private static final LIRTestSpecification byteStackCopy = new StackCopySpec() {
         @Override
         protected LIRKind getLIRKind(Value value) {
-            return LIRKind.value(JavaKind.Byte);
+            return LIRKind.value(AMD64Kind.BYTE);
         }
     };
 
--- a/graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/GenericValueMapTest.java	Fri Sep 18 11:41:06 2015 +0200
+++ b/graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/GenericValueMapTest.java	Fri Sep 18 13:12:02 2015 +0200
@@ -27,7 +27,6 @@
 import jdk.internal.jvmci.code.Register;
 import jdk.internal.jvmci.code.Register.RegisterCategory;
 import jdk.internal.jvmci.code.RegisterValue;
-import jdk.internal.jvmci.meta.JavaConstant;
 import jdk.internal.jvmci.meta.LIRKind;
 import jdk.internal.jvmci.meta.PlatformKind;
 
@@ -58,10 +57,6 @@
         public char getTypeChar() {
             return 'l';
         }
-
-        public JavaConstant getDefaultValue() {
-            return null;
-        }
     }
 
     @Test
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/LIRGenerator.java	Fri Sep 18 11:41:06 2015 +0200
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/LIRGenerator.java	Fri Sep 18 13:12:02 2015 +0200
@@ -462,9 +462,7 @@
 
     // automatic derived reference handling
 
-    protected boolean isNumericInteger(PlatformKind kind) {
-        return ((JavaKind) kind).isNumericInteger();
-    }
+    protected abstract boolean isNumericInteger(PlatformKind kind);
 
     protected abstract Variable emitAdd(LIRKind resultKind, Value a, Value b, boolean setFlags);
 
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/DirectReadNode.java	Fri Sep 18 11:41:06 2015 +0200
+++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/DirectReadNode.java	Fri Sep 18 13:12:02 2015 +0200
@@ -69,7 +69,7 @@
     public void generate(NodeLIRBuilderTool gen) {
         LIRKind kind = gen.getLIRGeneratorTool().target().getLIRKind(readKind);
         Value loaded = gen.getLIRGeneratorTool().emitLoad(kind, gen.operand(address), null);
-        switch ((JavaKind) kind.getPlatformKind()) {
+        switch (readKind) {
             case Byte:
                 loaded = gen.getLIRGeneratorTool().emitSignExtend(loaded, 8, 32);
                 break;
--- a/mx.graal/suite.py	Fri Sep 18 11:41:06 2015 +0200
+++ b/mx.graal/suite.py	Fri Sep 18 13:12:02 2015 +0200
@@ -6,7 +6,7 @@
     "suites": [
             {
                "name" : "jvmci",
-               "version" : "b4abfaab2ba9e1cbc29376465af4de519efb8a0e",
+               "version" : "6a7f2f656ed99597674ea44413229663f198bb45",
                "urls" : [
                     {"url" : "http://lafo.ssw.uni-linz.ac.at/hg/graal-jvmci-8", "kind" : "hg"},
                     {"url" : "https://curio.ssw.jku.at/nexus/content/repositories/snapshots", "kind" : "binary"},