comparison graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerLessThanNode.java @ 22604:b00cc0475f31

Update jvmci import: Refactoring: Rename Kind to JavaKind.
author Roland Schatz <roland.schatz@oracle.com>
date Tue, 08 Sep 2015 19:57:39 +0200
parents b611fa9fef24
children 05183a084a08
comparison
equal deleted inserted replaced
22603:6d339ba0edc5 22604:b00cc0475f31
38 public final class IntegerLessThanNode extends CompareNode { 38 public final class IntegerLessThanNode extends CompareNode {
39 public static final NodeClass<IntegerLessThanNode> TYPE = NodeClass.create(IntegerLessThanNode.class); 39 public static final NodeClass<IntegerLessThanNode> TYPE = NodeClass.create(IntegerLessThanNode.class);
40 40
41 public IntegerLessThanNode(ValueNode x, ValueNode y) { 41 public IntegerLessThanNode(ValueNode x, ValueNode y) {
42 super(TYPE, Condition.LT, false, x, y); 42 super(TYPE, Condition.LT, false, x, y);
43 assert !x.getStackKind().isNumericFloat() && x.getStackKind() != Kind.Object; 43 assert !x.getStackKind().isNumericFloat() && x.getStackKind() != JavaKind.Object;
44 assert !y.getStackKind().isNumericFloat() && y.getStackKind() != Kind.Object; 44 assert !y.getStackKind().isNumericFloat() && y.getStackKind() != JavaKind.Object;
45 } 45 }
46 46
47 public static LogicNode create(ValueNode x, ValueNode y, ConstantReflectionProvider constantReflection) { 47 public static LogicNode create(ValueNode x, ValueNode y, ConstantReflectionProvider constantReflection) {
48 LogicNode result = CompareNode.tryConstantFold(Condition.LT, x, y, constantReflection, false); 48 LogicNode result = CompareNode.tryConstantFold(Condition.LT, x, y, constantReflection, false);
49 if (result != null) { 49 if (result != null) {
59 59
60 @Override 60 @Override
61 protected ValueNode optimizeNormalizeCmp(Constant constant, NormalizeCompareNode normalizeNode, boolean mirrored) { 61 protected ValueNode optimizeNormalizeCmp(Constant constant, NormalizeCompareNode normalizeNode, boolean mirrored) {
62 PrimitiveConstant primitive = (PrimitiveConstant) constant; 62 PrimitiveConstant primitive = (PrimitiveConstant) constant;
63 assert condition() == Condition.LT; 63 assert condition() == Condition.LT;
64 if (primitive.getKind() == Kind.Int && primitive.asInt() == 0) { 64 if (primitive.getJavaKind() == JavaKind.Int && primitive.asInt() == 0) {
65 ValueNode a = mirrored ? normalizeNode.getY() : normalizeNode.getX(); 65 ValueNode a = mirrored ? normalizeNode.getY() : normalizeNode.getX();
66 ValueNode b = mirrored ? normalizeNode.getX() : normalizeNode.getY(); 66 ValueNode b = mirrored ? normalizeNode.getX() : normalizeNode.getY();
67 67
68 if (normalizeNode.getX().getStackKind() == Kind.Double || normalizeNode.getX().getStackKind() == Kind.Float) { 68 if (normalizeNode.getX().getStackKind() == JavaKind.Double || normalizeNode.getX().getStackKind() == JavaKind.Float) {
69 return new FloatLessThanNode(a, b, mirrored ^ normalizeNode.isUnorderedLess); 69 return new FloatLessThanNode(a, b, mirrored ^ normalizeNode.isUnorderedLess);
70 } else { 70 } else {
71 return new IntegerLessThanNode(a, b); 71 return new IntegerLessThanNode(a, b);
72 } 72 }
73 } 73 }