Search in sources :

Example 6 with PrimitiveStamp

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

the class PrimitiveStampBoundaryTest method testBinaryBoundaryValues.

private static void testBinaryBoundaryValues(ArithmeticOpTable.BinaryOp<?> op, HashSet<PrimitiveStamp> stamps) {
    for (PrimitiveStamp v1 : stamps) {
        for (PrimitiveStamp v2 : stamps) {
            if (v1.getBits() == v2.getBits() && v1.getClass() == v2.getClass()) {
                Stamp result = op.foldStamp(v1, v2);
                Stamp v1lower = boundaryStamp(v1, false);
                Stamp v1upper = boundaryStamp(v1, true);
                Stamp v2lower = boundaryStamp(v2, false);
                Stamp v2upper = boundaryStamp(v2, true);
                checkBinaryOperation(op, result, v1lower, v2lower);
                checkBinaryOperation(op, result, v1lower, v2upper);
                checkBinaryOperation(op, result, v1upper, v2lower);
                checkBinaryOperation(op, result, v1upper, v2upper);
            }
        }
    }
}
Also used : PrimitiveStamp(org.graalvm.compiler.core.common.type.PrimitiveStamp) Stamp(org.graalvm.compiler.core.common.type.Stamp) IntegerStamp(org.graalvm.compiler.core.common.type.IntegerStamp) FloatStamp(org.graalvm.compiler.core.common.type.FloatStamp) PrimitiveStamp(org.graalvm.compiler.core.common.type.PrimitiveStamp)

Aggregations

PrimitiveStamp (org.graalvm.compiler.core.common.type.PrimitiveStamp)6 IntegerStamp (org.graalvm.compiler.core.common.type.IntegerStamp)5 FloatStamp (org.graalvm.compiler.core.common.type.FloatStamp)4 Stamp (org.graalvm.compiler.core.common.type.Stamp)4 JavaKind (jdk.vm.ci.meta.JavaKind)1 Node (org.graalvm.compiler.graph.Node)1 ConstantNode (org.graalvm.compiler.nodes.ConstantNode)1 ValueNode (org.graalvm.compiler.nodes.ValueNode)1 ReinterpretNode (org.graalvm.compiler.nodes.calc.ReinterpretNode)1 LoadFieldNode (org.graalvm.compiler.nodes.java.LoadFieldNode)1 VirtualObjectNode (org.graalvm.compiler.nodes.virtual.VirtualObjectNode)1