src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/UnsignedMulHighNode.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
26 |
26 |
27 import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; |
27 import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; |
28 import static org.graalvm.compiler.nodeinfo.NodeSize.SIZE_2; |
28 import static org.graalvm.compiler.nodeinfo.NodeSize.SIZE_2; |
29 |
29 |
30 import org.graalvm.compiler.core.common.type.ArithmeticOpTable; |
30 import org.graalvm.compiler.core.common.type.ArithmeticOpTable; |
|
31 import org.graalvm.compiler.core.common.type.ArithmeticOpTable.BinaryOp; |
31 import org.graalvm.compiler.core.common.type.ArithmeticOpTable.BinaryOp.UMulHigh; |
32 import org.graalvm.compiler.core.common.type.ArithmeticOpTable.BinaryOp.UMulHigh; |
32 import org.graalvm.compiler.graph.NodeClass; |
33 import org.graalvm.compiler.graph.NodeClass; |
33 import org.graalvm.compiler.graph.spi.Canonicalizable; |
34 import org.graalvm.compiler.graph.spi.Canonicalizable; |
34 import org.graalvm.compiler.graph.spi.CanonicalizerTool; |
35 import org.graalvm.compiler.graph.spi.CanonicalizerTool; |
35 import org.graalvm.compiler.lir.gen.ArithmeticLIRGeneratorTool; |
36 import org.graalvm.compiler.lir.gen.ArithmeticLIRGeneratorTool; |
47 @NodeInfo(shortName = "|*H|", cycles = CYCLES_2, size = SIZE_2) |
48 @NodeInfo(shortName = "|*H|", cycles = CYCLES_2, size = SIZE_2) |
48 public final class UnsignedMulHighNode extends BinaryArithmeticNode<UMulHigh> implements Canonicalizable.BinaryCommutative<ValueNode> { |
49 public final class UnsignedMulHighNode extends BinaryArithmeticNode<UMulHigh> implements Canonicalizable.BinaryCommutative<ValueNode> { |
49 public static final NodeClass<UnsignedMulHighNode> TYPE = NodeClass.create(UnsignedMulHighNode.class); |
50 public static final NodeClass<UnsignedMulHighNode> TYPE = NodeClass.create(UnsignedMulHighNode.class); |
50 |
51 |
51 public UnsignedMulHighNode(ValueNode x, ValueNode y) { |
52 public UnsignedMulHighNode(ValueNode x, ValueNode y) { |
52 super(TYPE, ArithmeticOpTable::getUMulHigh, x, y); |
53 super(TYPE, getArithmeticOpTable(x).getUMulHigh(), x, y); |
|
54 } |
|
55 |
|
56 @Override |
|
57 protected BinaryOp<UMulHigh> getOp(ArithmeticOpTable table) { |
|
58 return table.getUMulHigh(); |
53 } |
59 } |
54 |
60 |
55 @Override |
61 @Override |
56 public void generate(NodeLIRBuilderTool nodeValueMap, ArithmeticLIRGeneratorTool gen) { |
62 public void generate(NodeLIRBuilderTool nodeValueMap, ArithmeticLIRGeneratorTool gen) { |
57 Value a = nodeValueMap.operand(getX()); |
63 Value a = nodeValueMap.operand(getX()); |