src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatDivNode.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2011, 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. |
50 public FloatDivNode(ValueNode x, ValueNode y) { |
50 public FloatDivNode(ValueNode x, ValueNode y) { |
51 this(TYPE, x, y); |
51 this(TYPE, x, y); |
52 } |
52 } |
53 |
53 |
54 protected FloatDivNode(NodeClass<? extends FloatDivNode> c, ValueNode x, ValueNode y) { |
54 protected FloatDivNode(NodeClass<? extends FloatDivNode> c, ValueNode x, ValueNode y) { |
55 super(c, ArithmeticOpTable::getDiv, x, y); |
55 super(c, getArithmeticOpTable(x).getDiv(), x, y); |
56 assert stamp instanceof FloatStamp; |
56 assert stamp instanceof FloatStamp; |
57 } |
57 } |
58 |
58 |
59 public static ValueNode create(ValueNode x, ValueNode y, NodeView view) { |
59 public static ValueNode create(ValueNode x, ValueNode y, NodeView view) { |
60 BinaryOp<Div> op = ArithmeticOpTable.forStamp(x.stamp(view)).getDiv(); |
60 BinaryOp<Div> op = ArithmeticOpTable.forStamp(x.stamp(view)).getDiv(); |
62 ConstantNode tryConstantFold = tryConstantFold(op, x, y, stamp, view); |
62 ConstantNode tryConstantFold = tryConstantFold(op, x, y, stamp, view); |
63 if (tryConstantFold != null) { |
63 if (tryConstantFold != null) { |
64 return tryConstantFold; |
64 return tryConstantFold; |
65 } |
65 } |
66 return canonical(null, op, x, y); |
66 return canonical(null, op, x, y); |
|
67 } |
|
68 |
|
69 @Override |
|
70 protected BinaryOp<Div> getOp(ArithmeticOpTable table) { |
|
71 return table.getDiv(); |
67 } |
72 } |
68 |
73 |
69 @Override |
74 @Override |
70 public ValueNode canonical(CanonicalizerTool tool, ValueNode forX, ValueNode forY) { |
75 public ValueNode canonical(CanonicalizerTool tool, ValueNode forX, ValueNode forY) { |
71 ValueNode ret = super.canonical(tool, forX, forY); |
76 ValueNode ret = super.canonical(tool, forX, forY); |