Mercurial > hg > truffle
comparison graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatLessThanNode.java @ 15975:0ad889977080
CompareNode.canonicalizeSymmetricConstant can lead to float<->int changes so the right type of node needs to be created depending on the inputs
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Thu, 29 May 2014 14:44:43 +0200 |
parents | d5b824a41530 |
children | 51c7c676d41a |
comparison
equal
deleted
inserted
replaced
15974:3a537502f40f | 15975:0ad889977080 |
---|---|
22 */ | 22 */ |
23 package com.oracle.graal.nodes.calc; | 23 package com.oracle.graal.nodes.calc; |
24 | 24 |
25 import com.oracle.graal.api.meta.*; | 25 import com.oracle.graal.api.meta.*; |
26 import com.oracle.graal.api.meta.ProfilingInfo.TriState; | 26 import com.oracle.graal.api.meta.ProfilingInfo.TriState; |
27 import com.oracle.graal.compiler.common.*; | |
27 import com.oracle.graal.compiler.common.calc.*; | 28 import com.oracle.graal.compiler.common.calc.*; |
28 import com.oracle.graal.compiler.common.type.*; | 29 import com.oracle.graal.compiler.common.type.*; |
29 import com.oracle.graal.graph.*; | 30 import com.oracle.graal.graph.*; |
30 import com.oracle.graal.nodes.*; | 31 import com.oracle.graal.nodes.*; |
31 import com.oracle.graal.nodes.util.*; | 32 import com.oracle.graal.nodes.util.*; |
68 return super.evaluate(constantReflection, forX, forY); | 69 return super.evaluate(constantReflection, forX, forY); |
69 } | 70 } |
70 | 71 |
71 @Override | 72 @Override |
72 protected CompareNode duplicateModified(ValueNode newX, ValueNode newY) { | 73 protected CompareNode duplicateModified(ValueNode newX, ValueNode newY) { |
73 return new FloatLessThanNode(newX, newY, unorderedIsTrue); | 74 if (newX.stamp() instanceof FloatStamp && newY.stamp() instanceof FloatStamp) { |
75 return new FloatLessThanNode(newX, newY, unorderedIsTrue); | |
76 } else if (newX.stamp() instanceof IntegerStamp && newY.stamp() instanceof IntegerStamp) { | |
77 return new IntegerLessThanNode(newX, newY); | |
78 } | |
79 throw GraalInternalError.shouldNotReachHere(); | |
74 } | 80 } |
75 } | 81 } |