Search in sources :

Example 21 with IntegerStamp

use of org.graalvm.compiler.core.common.type.IntegerStamp in project graal by oracle.

the class IntegerSubOverflowsTest method testOverflowCheckStamp10.

@Test
public void testOverflowCheckStamp10() {
    IntegerStamp s1 = StampFactory.forInteger(64, Long.MIN_VALUE, Long.MIN_VALUE);
    IntegerStamp s2 = StampFactory.forInteger(64, Long.MIN_VALUE, Long.MIN_VALUE);
    Assert.assertFalse(IntegerStamp.subtractionCanOverflow(s1, s2));
}
Also used : IntegerStamp(org.graalvm.compiler.core.common.type.IntegerStamp) Test(org.junit.Test)

Example 22 with IntegerStamp

use of org.graalvm.compiler.core.common.type.IntegerStamp in project graal by oracle.

the class IntegerSubOverflowsTest method testOverflowCheckStamp01.

@Test
public void testOverflowCheckStamp01() {
    IntegerStamp s1 = StampFactory.forInteger(32, Integer.MAX_VALUE, Integer.MAX_VALUE);
    IntegerStamp s2 = StampFactory.forInteger(32, Integer.MAX_VALUE, Integer.MAX_VALUE);
    Assert.assertFalse(IntegerStamp.subtractionCanOverflow(s1, s2));
}
Also used : IntegerStamp(org.graalvm.compiler.core.common.type.IntegerStamp) Test(org.junit.Test)

Example 23 with IntegerStamp

use of org.graalvm.compiler.core.common.type.IntegerStamp in project graal by oracle.

the class IntegerSubOverflowsTest method testOverflowBIgStamps01.

@Test
public void testOverflowBIgStamps01() {
    IntegerStamp s1 = StampFactory.forInteger(64, Long.MIN_VALUE, Long.MAX_VALUE);
    IntegerStamp s2 = StampFactory.forInteger(64, Long.MIN_VALUE, Long.MAX_VALUE);
    Assert.assertTrue(IntegerStamp.subtractionCanOverflow(s1, s2));
}
Also used : IntegerStamp(org.graalvm.compiler.core.common.type.IntegerStamp) Test(org.junit.Test)

Example 24 with IntegerStamp

use of org.graalvm.compiler.core.common.type.IntegerStamp in project graal by oracle.

the class IntegerSubOverflowsTest method testOverflowCheckStamp02.

@Test
public void testOverflowCheckStamp02() {
    IntegerStamp s1 = StampFactory.forInteger(32, Integer.MIN_VALUE, Integer.MIN_VALUE);
    IntegerStamp s2 = StampFactory.forInteger(32, Integer.MIN_VALUE, Integer.MIN_VALUE);
    Assert.assertFalse(IntegerStamp.subtractionCanOverflow(s1, s2));
}
Also used : IntegerStamp(org.graalvm.compiler.core.common.type.IntegerStamp) Test(org.junit.Test)

Example 25 with IntegerStamp

use of org.graalvm.compiler.core.common.type.IntegerStamp in project graal by oracle.

the class IntegerSubOverflowsTest method testOverflowCheckStamp11.

@Test
public void testOverflowCheckStamp11() {
    IntegerStamp s1 = StampFactory.forInteger(64, Long.MIN_VALUE, Long.MIN_VALUE);
    IntegerStamp s2 = StampFactory.forInteger(64, 1, 1);
    Assert.assertTrue(IntegerStamp.subtractionCanOverflow(s1, s2));
}
Also used : IntegerStamp(org.graalvm.compiler.core.common.type.IntegerStamp) Test(org.junit.Test)

Aggregations

IntegerStamp (org.graalvm.compiler.core.common.type.IntegerStamp)65 Test (org.junit.Test)21 ValueNode (org.graalvm.compiler.nodes.ValueNode)19 Stamp (org.graalvm.compiler.core.common.type.Stamp)13 NodeView (org.graalvm.compiler.nodes.NodeView)8 AddNode (org.graalvm.compiler.nodes.calc.AddNode)6 ConstantNode (org.graalvm.compiler.nodes.ConstantNode)5 JavaConstant (jdk.vm.ci.meta.JavaConstant)4 Node (org.graalvm.compiler.graph.Node)4 StructuredGraph (org.graalvm.compiler.nodes.StructuredGraph)4 SignExtendNode (org.graalvm.compiler.nodes.calc.SignExtendNode)4 ArrayList (java.util.ArrayList)3 Constant (jdk.vm.ci.meta.Constant)3 PrimitiveConstant (jdk.vm.ci.meta.PrimitiveConstant)3 ArithmeticOpTable (org.graalvm.compiler.core.common.type.ArithmeticOpTable)3 GraphTest (org.graalvm.compiler.graph.test.GraphTest)3 FixedGuardNode (org.graalvm.compiler.nodes.FixedGuardNode)3 LoopBeginNode (org.graalvm.compiler.nodes.LoopBeginNode)3 ParameterNode (org.graalvm.compiler.nodes.ParameterNode)3 IntegerBelowNode (org.graalvm.compiler.nodes.calc.IntegerBelowNode)3