author | redestad |
Thu, 14 Nov 2019 15:24:35 +0100 | |
changeset 59081 | 95a99e617f28 |
parent 53244 | 9807daeb47c4 |
permissions | -rw-r--r-- |
20289 | 1 |
/* |
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
48704
diff
changeset
|
2 |
* Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved. |
20289 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
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 |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
22 |
* |
|
23 |
*/ |
|
24 |
||
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
48704
diff
changeset
|
25 |
#ifndef SHARE_OPTO_MATHEXACTNODE_HPP |
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
48704
diff
changeset
|
26 |
#define SHARE_OPTO_MATHEXACTNODE_HPP |
20289 | 27 |
|
28 |
#include "opto/multnode.hpp" |
|
29 |
#include "opto/node.hpp" |
|
22911
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
30 |
#include "opto/addnode.hpp" |
20715
be1135dc1406
8025657: compiler/intrinsics/mathexact/ConstantTest.java fails on assert in lcm.cpp on solaris x64
rbackman
parents:
20289
diff
changeset
|
31 |
#include "opto/subnode.hpp" |
20289 | 32 |
#include "opto/type.hpp" |
33 |
||
34 |
class PhaseGVN; |
|
35 |
class PhaseTransform; |
|
36 |
||
22911
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
37 |
class OverflowNode : public CmpNode { |
20289 | 38 |
public: |
22911
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
39 |
OverflowNode(Node* in1, Node* in2) : CmpNode(in1, in2) {} |
20289 | 40 |
|
22911
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
41 |
virtual uint ideal_reg() const { return Op_RegFlags; } |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
42 |
virtual const Type* sub(const Type* t1, const Type* t2) const; |
21105
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20715
diff
changeset
|
43 |
}; |
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20715
diff
changeset
|
44 |
|
22911
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
45 |
class OverflowINode : public OverflowNode { |
21105
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20715
diff
changeset
|
46 |
public: |
22911
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
47 |
typedef TypeInt TypeClass; |
21105
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20715
diff
changeset
|
48 |
|
22911
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
49 |
OverflowINode(Node* in1, Node* in2) : OverflowNode(in1, in2) {} |
21105
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20715
diff
changeset
|
50 |
virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); |
35551
36ef3841fb34
8146629: Make phase->is_IterGVN() accessible from Node::Identity and Node::Value
thartmann
parents:
22911
diff
changeset
|
51 |
virtual const Type* Value(PhaseGVN* phase) const; |
20289 | 52 |
|
22911
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
53 |
virtual bool will_overflow(jint v1, jint v2) const = 0; |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
54 |
virtual bool can_overflow(const Type* t1, const Type* t2) const = 0; |
20289 | 55 |
}; |
56 |
||
57 |
||
22911
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
58 |
class OverflowLNode : public OverflowNode { |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
59 |
public: |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
60 |
typedef TypeLong TypeClass; |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
61 |
|
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
62 |
OverflowLNode(Node* in1, Node* in2) : OverflowNode(in1, in2) {} |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
63 |
virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); |
35551
36ef3841fb34
8146629: Make phase->is_IterGVN() accessible from Node::Identity and Node::Value
thartmann
parents:
22911
diff
changeset
|
64 |
virtual const Type* Value(PhaseGVN* phase) const; |
22911
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
65 |
|
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
66 |
virtual bool will_overflow(jlong v1, jlong v2) const = 0; |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
67 |
virtual bool can_overflow(const Type* t1, const Type* t2) const = 0; |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
68 |
}; |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
69 |
|
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
70 |
class OverflowAddINode : public OverflowINode { |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
71 |
public: |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
72 |
typedef AddINode MathOp; |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
73 |
|
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
74 |
OverflowAddINode(Node* in1, Node* in2) : OverflowINode(in1, in2) {} |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
75 |
virtual int Opcode() const; |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
76 |
|
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
77 |
virtual bool will_overflow(jint v1, jint v2) const; |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
78 |
virtual bool can_overflow(const Type* t1, const Type* t2) const; |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
79 |
}; |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
80 |
|
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
81 |
class OverflowSubINode : public OverflowINode { |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
82 |
public: |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
83 |
typedef SubINode MathOp; |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
84 |
|
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
85 |
OverflowSubINode(Node* in1, Node* in2) : OverflowINode(in1, in2) {} |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
86 |
virtual int Opcode() const; |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
87 |
|
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
88 |
virtual bool will_overflow(jint v1, jint v2) const; |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
89 |
virtual bool can_overflow(const Type* t1, const Type* t2) const; |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
90 |
}; |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
91 |
|
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
92 |
class OverflowMulINode : public OverflowINode { |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
93 |
public: |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
94 |
typedef MulINode MathOp; |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
95 |
|
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
96 |
OverflowMulINode(Node* in1, Node* in2) : OverflowINode(in1, in2) {} |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
97 |
virtual int Opcode() const; |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
98 |
|
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
99 |
virtual bool will_overflow(jint v1, jint v2) const; |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
100 |
virtual bool can_overflow(const Type* t1, const Type* t2) const; |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
101 |
}; |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
102 |
|
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
103 |
class OverflowAddLNode : public OverflowLNode { |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
104 |
public: |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
105 |
typedef AddLNode MathOp; |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
106 |
|
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
107 |
OverflowAddLNode(Node* in1, Node* in2) : OverflowLNode(in1, in2) {} |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
108 |
virtual int Opcode() const; |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
109 |
|
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
110 |
virtual bool will_overflow(jlong v1, jlong v2) const; |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
111 |
virtual bool can_overflow(const Type* t1, const Type* t2) const; |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
112 |
}; |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
113 |
|
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
114 |
class OverflowSubLNode : public OverflowLNode { |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
115 |
public: |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
116 |
typedef SubLNode MathOp; |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
117 |
|
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
118 |
OverflowSubLNode(Node* in1, Node* in2) : OverflowLNode(in1, in2) {} |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
119 |
virtual int Opcode() const; |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
120 |
|
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
121 |
virtual bool will_overflow(jlong v1, jlong v2) const; |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
122 |
virtual bool can_overflow(const Type* t1, const Type* t2) const; |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
123 |
}; |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
124 |
|
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
125 |
class OverflowMulLNode : public OverflowLNode { |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
126 |
public: |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
127 |
typedef MulLNode MathOp; |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
128 |
|
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
129 |
OverflowMulLNode(Node* in1, Node* in2) : OverflowLNode(in1, in2) {} |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
130 |
virtual int Opcode() const; |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
131 |
|
48704
4162f740b7bd
8191915: JCK tests produce incorrect results with C2
rbackman
parents:
47216
diff
changeset
|
132 |
virtual bool will_overflow(jlong v1, jlong v2) const { return is_overflow(v1, v2); } |
22911
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
133 |
virtual bool can_overflow(const Type* t1, const Type* t2) const; |
48704
4162f740b7bd
8191915: JCK tests produce incorrect results with C2
rbackman
parents:
47216
diff
changeset
|
134 |
|
4162f740b7bd
8191915: JCK tests produce incorrect results with C2
rbackman
parents:
47216
diff
changeset
|
135 |
static bool is_overflow(jlong v1, jlong v2); |
22911
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
136 |
}; |
ff49c48c887d
8027754: Enable loop optimizations for loops with MathExact inside
rbackman
parents:
21578
diff
changeset
|
137 |
|
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
48704
diff
changeset
|
138 |
#endif // SHARE_OPTO_MATHEXACTNODE_HPP |