Search in sources :

Example 6 with NegateNode

use of org.graalvm.compiler.nodes.calc.NegateNode in project graal by oracle.

the class AMD64AddressLoweringTest method convertTwoLevelsOfNegatedShiftedBaseAndNegatedIndexToDisplacement.

@Test
public void convertTwoLevelsOfNegatedShiftedBaseAndNegatedIndexToDisplacement() {
    ValueNode base = graph.addOrUniqueWithInputs(new NegateNode(new LeftShiftNode(new NegateNode(new LeftShiftNode(const64(500), const32(1))), const32(1))));
    ValueNode index = graph.addOrUniqueWithInputs(new NegateNode(new AddNode(new NegateNode(const64(13)), const64(3))));
    AddressNode result = lowering.lower(base, index);
    assertAddress(result, null, null, Scale.Times4, 2010);
}
Also used : ValueNode(org.graalvm.compiler.nodes.ValueNode) NegateNode(org.graalvm.compiler.nodes.calc.NegateNode) AMD64AddressNode(org.graalvm.compiler.core.amd64.AMD64AddressNode) AddressNode(org.graalvm.compiler.nodes.memory.address.AddressNode) LeftShiftNode(org.graalvm.compiler.nodes.calc.LeftShiftNode) AddNode(org.graalvm.compiler.nodes.calc.AddNode) Test(org.junit.Test) GraalCompilerTest(org.graalvm.compiler.core.test.GraalCompilerTest)

Aggregations

ValueNode (org.graalvm.compiler.nodes.ValueNode)6 NegateNode (org.graalvm.compiler.nodes.calc.NegateNode)6 LeftShiftNode (org.graalvm.compiler.nodes.calc.LeftShiftNode)5 AMD64AddressNode (org.graalvm.compiler.core.amd64.AMD64AddressNode)4 GraalCompilerTest (org.graalvm.compiler.core.test.GraalCompilerTest)4 AddressNode (org.graalvm.compiler.nodes.memory.address.AddressNode)4 Test (org.junit.Test)4 AddNode (org.graalvm.compiler.nodes.calc.AddNode)2 LinkedList (java.util.LinkedList)1 IntegerStamp (org.graalvm.compiler.core.common.type.IntegerStamp)1 Node (org.graalvm.compiler.graph.Node)1 AbstractBeginNode (org.graalvm.compiler.nodes.AbstractBeginNode)1 AbstractEndNode (org.graalvm.compiler.nodes.AbstractEndNode)1 ConstantNode (org.graalvm.compiler.nodes.ConstantNode)1 FixedGuardNode (org.graalvm.compiler.nodes.FixedGuardNode)1 FixedNode (org.graalvm.compiler.nodes.FixedNode)1 FixedWithNextNode (org.graalvm.compiler.nodes.FixedWithNextNode)1 FullInfopointNode (org.graalvm.compiler.nodes.FullInfopointNode)1 IfNode (org.graalvm.compiler.nodes.IfNode)1 LogicNode (org.graalvm.compiler.nodes.LogicNode)1