annotate src/share/vm/opto/subnode.hpp @ 12355:cefad50507d8

Merge with hs25-b53
author Gilles Duboscq <duboscq@ssw.jku.at>
date Fri, 11 Oct 2013 10:38:03 +0200
parents c9ccd7b85f20
children de6a9e811145
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
6842
b9a9ed0f8eeb 7197424: update copyright year to match last edit in jdk8 hotspot repository
mikael
parents: 6207
diff changeset
2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1396
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1396
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1396
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
25 #ifndef SHARE_VM_OPTO_SUBNODE_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
26 #define SHARE_VM_OPTO_SUBNODE_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
27
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
28 #include "opto/node.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
29 #include "opto/opcodes.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
30 #include "opto/type.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
31
0
a61af66fc99e Initial load
duke
parents:
diff changeset
32 // Portions of code courtesy of Clifford Click
a61af66fc99e Initial load
duke
parents:
diff changeset
33
a61af66fc99e Initial load
duke
parents:
diff changeset
34 //------------------------------SUBNode----------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
35 // Class SUBTRACTION functionality. This covers all the usual 'subtract'
a61af66fc99e Initial load
duke
parents:
diff changeset
36 // behaviors. Subtract-integer, -float, -double, binary xor, compare-integer,
a61af66fc99e Initial load
duke
parents:
diff changeset
37 // -float, and -double are all inherited from this class. The compare
a61af66fc99e Initial load
duke
parents:
diff changeset
38 // functions behave like subtract functions, except that all negative answers
a61af66fc99e Initial load
duke
parents:
diff changeset
39 // are compressed into -1, and all positive answers compressed to 1.
a61af66fc99e Initial load
duke
parents:
diff changeset
40 class SubNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
41 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
42 SubNode( Node *in1, Node *in2 ) : Node(0,in1,in2) {
a61af66fc99e Initial load
duke
parents:
diff changeset
43 init_class_id(Class_Sub);
a61af66fc99e Initial load
duke
parents:
diff changeset
44 }
a61af66fc99e Initial load
duke
parents:
diff changeset
45
a61af66fc99e Initial load
duke
parents:
diff changeset
46 // Handle algebraic identities here. If we have an identity, return the Node
a61af66fc99e Initial load
duke
parents:
diff changeset
47 // we are equivalent to. We look for "add of zero" as an identity.
a61af66fc99e Initial load
duke
parents:
diff changeset
48 virtual Node *Identity( PhaseTransform *phase );
a61af66fc99e Initial load
duke
parents:
diff changeset
49
a61af66fc99e Initial load
duke
parents:
diff changeset
50 // Compute a new Type for this node. Basically we just do the pre-check,
a61af66fc99e Initial load
duke
parents:
diff changeset
51 // then call the virtual add() to set the type.
a61af66fc99e Initial load
duke
parents:
diff changeset
52 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
53
a61af66fc99e Initial load
duke
parents:
diff changeset
54 // Supplied function returns the subtractend of the inputs.
a61af66fc99e Initial load
duke
parents:
diff changeset
55 // This also type-checks the inputs for sanity. Guaranteed never to
a61af66fc99e Initial load
duke
parents:
diff changeset
56 // be passed a TOP or BOTTOM type, these are filtered out by a pre-check.
a61af66fc99e Initial load
duke
parents:
diff changeset
57 virtual const Type *sub( const Type *, const Type * ) const = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
58
a61af66fc99e Initial load
duke
parents:
diff changeset
59 // Supplied function to return the additive identity type.
a61af66fc99e Initial load
duke
parents:
diff changeset
60 // This is returned whenever the subtracts inputs are the same.
a61af66fc99e Initial load
duke
parents:
diff changeset
61 virtual const Type *add_id() const = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
62
a61af66fc99e Initial load
duke
parents:
diff changeset
63 };
a61af66fc99e Initial load
duke
parents:
diff changeset
64
a61af66fc99e Initial load
duke
parents:
diff changeset
65
a61af66fc99e Initial load
duke
parents:
diff changeset
66 // NOTE: SubINode should be taken away and replaced by add and negate
a61af66fc99e Initial load
duke
parents:
diff changeset
67 //------------------------------SubINode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
68 // Subtract 2 integers
a61af66fc99e Initial load
duke
parents:
diff changeset
69 class SubINode : public SubNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
70 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
71 SubINode( Node *in1, Node *in2 ) : SubNode(in1,in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
72 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
73 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
74 virtual const Type *sub( const Type *, const Type * ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
75 const Type *add_id() const { return TypeInt::ZERO; }
a61af66fc99e Initial load
duke
parents:
diff changeset
76 const Type *bottom_type() const { return TypeInt::INT; }
a61af66fc99e Initial load
duke
parents:
diff changeset
77 virtual uint ideal_reg() const { return Op_RegI; }
a61af66fc99e Initial load
duke
parents:
diff changeset
78 };
a61af66fc99e Initial load
duke
parents:
diff changeset
79
a61af66fc99e Initial load
duke
parents:
diff changeset
80 //------------------------------SubLNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
81 // Subtract 2 integers
a61af66fc99e Initial load
duke
parents:
diff changeset
82 class SubLNode : public SubNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
83 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
84 SubLNode( Node *in1, Node *in2 ) : SubNode(in1,in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
85 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
86 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
87 virtual const Type *sub( const Type *, const Type * ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
88 const Type *add_id() const { return TypeLong::ZERO; }
a61af66fc99e Initial load
duke
parents:
diff changeset
89 const Type *bottom_type() const { return TypeLong::LONG; }
a61af66fc99e Initial load
duke
parents:
diff changeset
90 virtual uint ideal_reg() const { return Op_RegL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
91 };
a61af66fc99e Initial load
duke
parents:
diff changeset
92
a61af66fc99e Initial load
duke
parents:
diff changeset
93 // NOTE: SubFPNode should be taken away and replaced by add and negate
a61af66fc99e Initial load
duke
parents:
diff changeset
94 //------------------------------SubFPNode--------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
95 // Subtract 2 floats or doubles
a61af66fc99e Initial load
duke
parents:
diff changeset
96 class SubFPNode : public SubNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
97 protected:
a61af66fc99e Initial load
duke
parents:
diff changeset
98 SubFPNode( Node *in1, Node *in2 ) : SubNode(in1,in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
99 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
100 const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
101 };
a61af66fc99e Initial load
duke
parents:
diff changeset
102
a61af66fc99e Initial load
duke
parents:
diff changeset
103 // NOTE: SubFNode should be taken away and replaced by add and negate
a61af66fc99e Initial load
duke
parents:
diff changeset
104 //------------------------------SubFNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
105 // Subtract 2 doubles
a61af66fc99e Initial load
duke
parents:
diff changeset
106 class SubFNode : public SubFPNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
107 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
108 SubFNode( Node *in1, Node *in2 ) : SubFPNode(in1,in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
109 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
110 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
111 virtual const Type *sub( const Type *, const Type * ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
112 const Type *add_id() const { return TypeF::ZERO; }
a61af66fc99e Initial load
duke
parents:
diff changeset
113 const Type *bottom_type() const { return Type::FLOAT; }
a61af66fc99e Initial load
duke
parents:
diff changeset
114 virtual uint ideal_reg() const { return Op_RegF; }
a61af66fc99e Initial load
duke
parents:
diff changeset
115 };
a61af66fc99e Initial load
duke
parents:
diff changeset
116
a61af66fc99e Initial load
duke
parents:
diff changeset
117 // NOTE: SubDNode should be taken away and replaced by add and negate
a61af66fc99e Initial load
duke
parents:
diff changeset
118 //------------------------------SubDNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
119 // Subtract 2 doubles
a61af66fc99e Initial load
duke
parents:
diff changeset
120 class SubDNode : public SubFPNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
121 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
122 SubDNode( Node *in1, Node *in2 ) : SubFPNode(in1,in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
123 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
124 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
125 virtual const Type *sub( const Type *, const Type * ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
126 const Type *add_id() const { return TypeD::ZERO; }
a61af66fc99e Initial load
duke
parents:
diff changeset
127 const Type *bottom_type() const { return Type::DOUBLE; }
a61af66fc99e Initial load
duke
parents:
diff changeset
128 virtual uint ideal_reg() const { return Op_RegD; }
a61af66fc99e Initial load
duke
parents:
diff changeset
129 };
a61af66fc99e Initial load
duke
parents:
diff changeset
130
a61af66fc99e Initial load
duke
parents:
diff changeset
131 //------------------------------CmpNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
132 // Compare 2 values, returning condition codes (-1, 0 or 1).
a61af66fc99e Initial load
duke
parents:
diff changeset
133 class CmpNode : public SubNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
134 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
135 CmpNode( Node *in1, Node *in2 ) : SubNode(in1,in2) {
a61af66fc99e Initial load
duke
parents:
diff changeset
136 init_class_id(Class_Cmp);
a61af66fc99e Initial load
duke
parents:
diff changeset
137 }
a61af66fc99e Initial load
duke
parents:
diff changeset
138 virtual Node *Identity( PhaseTransform *phase );
a61af66fc99e Initial load
duke
parents:
diff changeset
139 const Type *add_id() const { return TypeInt::ZERO; }
a61af66fc99e Initial load
duke
parents:
diff changeset
140 const Type *bottom_type() const { return TypeInt::CC; }
a61af66fc99e Initial load
duke
parents:
diff changeset
141 virtual uint ideal_reg() const { return Op_RegFlags; }
a61af66fc99e Initial load
duke
parents:
diff changeset
142 };
a61af66fc99e Initial load
duke
parents:
diff changeset
143
a61af66fc99e Initial load
duke
parents:
diff changeset
144 //------------------------------CmpINode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
145 // Compare 2 signed values, returning condition codes (-1, 0 or 1).
a61af66fc99e Initial load
duke
parents:
diff changeset
146 class CmpINode : public CmpNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
147 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
148 CmpINode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
149 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
150 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
151 virtual const Type *sub( const Type *, const Type * ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
152 };
a61af66fc99e Initial load
duke
parents:
diff changeset
153
a61af66fc99e Initial load
duke
parents:
diff changeset
154 //------------------------------CmpUNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
155 // Compare 2 unsigned values (integer or pointer), returning condition codes (-1, 0 or 1).
a61af66fc99e Initial load
duke
parents:
diff changeset
156 class CmpUNode : public CmpNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
157 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
158 CmpUNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
159 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
160 virtual const Type *sub( const Type *, const Type * ) const;
6207
ae9241bbce4a 7181658: CTW: assert(t->meet(t0) == t) failed: Not monotonic
kvn
parents: 3338
diff changeset
161 bool is_index_range_check() const;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
162 };
a61af66fc99e Initial load
duke
parents:
diff changeset
163
a61af66fc99e Initial load
duke
parents:
diff changeset
164 //------------------------------CmpPNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
165 // Compare 2 pointer values, returning condition codes (-1, 0 or 1).
a61af66fc99e Initial load
duke
parents:
diff changeset
166 class CmpPNode : public CmpNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
167 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
168 CmpPNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
169 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
170 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
171 virtual const Type *sub( const Type *, const Type * ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
172 };
a61af66fc99e Initial load
duke
parents:
diff changeset
173
113
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
174 //------------------------------CmpNNode--------------------------------------
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
175 // Compare 2 narrow oop values, returning condition codes (-1, 0 or 1).
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
176 class CmpNNode : public CmpNode {
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
177 public:
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
178 CmpNNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
179 virtual int Opcode() const;
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
180 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
181 virtual const Type *sub( const Type *, const Type * ) const;
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
182 };
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
183
0
a61af66fc99e Initial load
duke
parents:
diff changeset
184 //------------------------------CmpLNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
185 // Compare 2 long values, returning condition codes (-1, 0 or 1).
a61af66fc99e Initial load
duke
parents:
diff changeset
186 class CmpLNode : public CmpNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
187 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
188 CmpLNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
189 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
190 virtual const Type *sub( const Type *, const Type * ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
191 };
a61af66fc99e Initial load
duke
parents:
diff changeset
192
a61af66fc99e Initial load
duke
parents:
diff changeset
193 //------------------------------CmpL3Node--------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
194 // Compare 2 long values, returning integer value (-1, 0 or 1).
a61af66fc99e Initial load
duke
parents:
diff changeset
195 class CmpL3Node : public CmpLNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
196 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
197 CmpL3Node( Node *in1, Node *in2 ) : CmpLNode(in1,in2) {
a61af66fc99e Initial load
duke
parents:
diff changeset
198 // Since it is not consumed by Bools, it is not really a Cmp.
a61af66fc99e Initial load
duke
parents:
diff changeset
199 init_class_id(Class_Sub);
a61af66fc99e Initial load
duke
parents:
diff changeset
200 }
a61af66fc99e Initial load
duke
parents:
diff changeset
201 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
202 virtual uint ideal_reg() const { return Op_RegI; }
a61af66fc99e Initial load
duke
parents:
diff changeset
203 };
a61af66fc99e Initial load
duke
parents:
diff changeset
204
a61af66fc99e Initial load
duke
parents:
diff changeset
205 //------------------------------CmpFNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
206 // Compare 2 float values, returning condition codes (-1, 0 or 1).
a61af66fc99e Initial load
duke
parents:
diff changeset
207 // This implements the Java bytecode fcmpl, so unordered returns -1.
a61af66fc99e Initial load
duke
parents:
diff changeset
208 // Operands may not commute.
a61af66fc99e Initial load
duke
parents:
diff changeset
209 class CmpFNode : public CmpNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
210 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
211 CmpFNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
212 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
213 virtual const Type *sub( const Type *, const Type * ) const { ShouldNotReachHere(); return NULL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
214 const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
215 };
a61af66fc99e Initial load
duke
parents:
diff changeset
216
a61af66fc99e Initial load
duke
parents:
diff changeset
217 //------------------------------CmpF3Node--------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
218 // Compare 2 float values, returning integer value (-1, 0 or 1).
a61af66fc99e Initial load
duke
parents:
diff changeset
219 // This implements the Java bytecode fcmpl, so unordered returns -1.
a61af66fc99e Initial load
duke
parents:
diff changeset
220 // Operands may not commute.
a61af66fc99e Initial load
duke
parents:
diff changeset
221 class CmpF3Node : public CmpFNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
222 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
223 CmpF3Node( Node *in1, Node *in2 ) : CmpFNode(in1,in2) {
a61af66fc99e Initial load
duke
parents:
diff changeset
224 // Since it is not consumed by Bools, it is not really a Cmp.
a61af66fc99e Initial load
duke
parents:
diff changeset
225 init_class_id(Class_Sub);
a61af66fc99e Initial load
duke
parents:
diff changeset
226 }
a61af66fc99e Initial load
duke
parents:
diff changeset
227 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
228 // Since it is not consumed by Bools, it is not really a Cmp.
a61af66fc99e Initial load
duke
parents:
diff changeset
229 virtual uint ideal_reg() const { return Op_RegI; }
a61af66fc99e Initial load
duke
parents:
diff changeset
230 };
a61af66fc99e Initial load
duke
parents:
diff changeset
231
a61af66fc99e Initial load
duke
parents:
diff changeset
232
a61af66fc99e Initial load
duke
parents:
diff changeset
233 //------------------------------CmpDNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
234 // Compare 2 double values, returning condition codes (-1, 0 or 1).
a61af66fc99e Initial load
duke
parents:
diff changeset
235 // This implements the Java bytecode dcmpl, so unordered returns -1.
a61af66fc99e Initial load
duke
parents:
diff changeset
236 // Operands may not commute.
a61af66fc99e Initial load
duke
parents:
diff changeset
237 class CmpDNode : public CmpNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
238 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
239 CmpDNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
240 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
241 virtual const Type *sub( const Type *, const Type * ) const { ShouldNotReachHere(); return NULL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
242 const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
243 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
244 };
a61af66fc99e Initial load
duke
parents:
diff changeset
245
a61af66fc99e Initial load
duke
parents:
diff changeset
246 //------------------------------CmpD3Node--------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
247 // Compare 2 double values, returning integer value (-1, 0 or 1).
a61af66fc99e Initial load
duke
parents:
diff changeset
248 // This implements the Java bytecode dcmpl, so unordered returns -1.
a61af66fc99e Initial load
duke
parents:
diff changeset
249 // Operands may not commute.
a61af66fc99e Initial load
duke
parents:
diff changeset
250 class CmpD3Node : public CmpDNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
251 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
252 CmpD3Node( Node *in1, Node *in2 ) : CmpDNode(in1,in2) {
a61af66fc99e Initial load
duke
parents:
diff changeset
253 // Since it is not consumed by Bools, it is not really a Cmp.
a61af66fc99e Initial load
duke
parents:
diff changeset
254 init_class_id(Class_Sub);
a61af66fc99e Initial load
duke
parents:
diff changeset
255 }
a61af66fc99e Initial load
duke
parents:
diff changeset
256 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
257 virtual uint ideal_reg() const { return Op_RegI; }
a61af66fc99e Initial load
duke
parents:
diff changeset
258 };
a61af66fc99e Initial load
duke
parents:
diff changeset
259
a61af66fc99e Initial load
duke
parents:
diff changeset
260
a61af66fc99e Initial load
duke
parents:
diff changeset
261 //------------------------------BoolTest---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
262 // Convert condition codes to a boolean test value (0 or -1).
a61af66fc99e Initial load
duke
parents:
diff changeset
263 // We pick the values as 3 bits; the low order 2 bits we compare against the
a61af66fc99e Initial load
duke
parents:
diff changeset
264 // condition codes, the high bit flips the sense of the result.
a61af66fc99e Initial load
duke
parents:
diff changeset
265 struct BoolTest VALUE_OBJ_CLASS_SPEC {
12323
c9ccd7b85f20 8024924: Intrinsify java.lang.Math.addExact
rbackman
parents: 8076
diff changeset
266 enum mask { eq = 0, ne = 4, le = 5, ge = 7, lt = 3, gt = 1, overflow = 2, no_overflow = 6, illegal = 8 };
0
a61af66fc99e Initial load
duke
parents:
diff changeset
267 mask _test;
a61af66fc99e Initial load
duke
parents:
diff changeset
268 BoolTest( mask btm ) : _test(btm) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
269 const Type *cc2logical( const Type *CC ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
270 // Commute the test. I use a small table lookup. The table is created as
a61af66fc99e Initial load
duke
parents:
diff changeset
271 // a simple char array where each element is the ASCII version of a 'mask'
a61af66fc99e Initial load
duke
parents:
diff changeset
272 // enum from above.
12323
c9ccd7b85f20 8024924: Intrinsify java.lang.Math.addExact
rbackman
parents: 8076
diff changeset
273 mask commute( ) const { return mask("032147658"[_test]-'0'); }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
274 mask negate( ) const { return mask(_test^4); }
12323
c9ccd7b85f20 8024924: Intrinsify java.lang.Math.addExact
rbackman
parents: 8076
diff changeset
275 bool is_canonical( ) const { return (_test == BoolTest::ne || _test == BoolTest::lt || _test == BoolTest::le || _test == BoolTest::overflow); }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
276 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
277 void dump_on(outputStream *st) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
278 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
279 };
a61af66fc99e Initial load
duke
parents:
diff changeset
280
a61af66fc99e Initial load
duke
parents:
diff changeset
281 //------------------------------BoolNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
282 // A Node to convert a Condition Codes to a Logical result.
a61af66fc99e Initial load
duke
parents:
diff changeset
283 class BoolNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
284 virtual uint hash() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
285 virtual uint cmp( const Node &n ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
286 virtual uint size_of() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
287 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
288 const BoolTest _test;
a61af66fc99e Initial load
duke
parents:
diff changeset
289 BoolNode( Node *cc, BoolTest::mask t): _test(t), Node(0,cc) {
a61af66fc99e Initial load
duke
parents:
diff changeset
290 init_class_id(Class_Bool);
a61af66fc99e Initial load
duke
parents:
diff changeset
291 }
a61af66fc99e Initial load
duke
parents:
diff changeset
292 // Convert an arbitrary int value to a Bool or other suitable predicate.
a61af66fc99e Initial load
duke
parents:
diff changeset
293 static Node* make_predicate(Node* test_value, PhaseGVN* phase);
a61af66fc99e Initial load
duke
parents:
diff changeset
294 // Convert self back to an integer value.
a61af66fc99e Initial load
duke
parents:
diff changeset
295 Node* as_int_value(PhaseGVN* phase);
a61af66fc99e Initial load
duke
parents:
diff changeset
296 // Invert sense of self, returning new Bool.
a61af66fc99e Initial load
duke
parents:
diff changeset
297 BoolNode* negate(PhaseGVN* phase);
a61af66fc99e Initial load
duke
parents:
diff changeset
298 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
299 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
300 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
301 virtual const Type *bottom_type() const { return TypeInt::BOOL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
302 uint match_edge(uint idx) const { return 0; }
a61af66fc99e Initial load
duke
parents:
diff changeset
303 virtual uint ideal_reg() const { return Op_RegI; }
a61af66fc99e Initial load
duke
parents:
diff changeset
304
a61af66fc99e Initial load
duke
parents:
diff changeset
305 bool is_counted_loop_exit_test();
a61af66fc99e Initial load
duke
parents:
diff changeset
306 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
307 virtual void dump_spec(outputStream *st) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
308 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
309 };
a61af66fc99e Initial load
duke
parents:
diff changeset
310
a61af66fc99e Initial load
duke
parents:
diff changeset
311 //------------------------------AbsNode----------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
312 // Abstract class for absolute value. Mostly used to get a handy wrapper
a61af66fc99e Initial load
duke
parents:
diff changeset
313 // for finding this pattern in the graph.
a61af66fc99e Initial load
duke
parents:
diff changeset
314 class AbsNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
315 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
316 AbsNode( Node *value ) : Node(0,value) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
317 };
a61af66fc99e Initial load
duke
parents:
diff changeset
318
a61af66fc99e Initial load
duke
parents:
diff changeset
319 //------------------------------AbsINode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
320 // Absolute value an integer. Since a naive graph involves control flow, we
a61af66fc99e Initial load
duke
parents:
diff changeset
321 // "match" it in the ideal world (so the control flow can be removed).
a61af66fc99e Initial load
duke
parents:
diff changeset
322 class AbsINode : public AbsNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
323 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
324 AbsINode( Node *in1 ) : AbsNode(in1) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
325 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
326 const Type *bottom_type() const { return TypeInt::INT; }
a61af66fc99e Initial load
duke
parents:
diff changeset
327 virtual uint ideal_reg() const { return Op_RegI; }
a61af66fc99e Initial load
duke
parents:
diff changeset
328 };
a61af66fc99e Initial load
duke
parents:
diff changeset
329
a61af66fc99e Initial load
duke
parents:
diff changeset
330 //------------------------------AbsFNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
331 // Absolute value a float, a common float-point idiom with a cheap hardware
a61af66fc99e Initial load
duke
parents:
diff changeset
332 // implemention on most chips. Since a naive graph involves control flow, we
a61af66fc99e Initial load
duke
parents:
diff changeset
333 // "match" it in the ideal world (so the control flow can be removed).
a61af66fc99e Initial load
duke
parents:
diff changeset
334 class AbsFNode : public AbsNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
335 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
336 AbsFNode( Node *in1 ) : AbsNode(in1) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
337 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
338 const Type *bottom_type() const { return Type::FLOAT; }
a61af66fc99e Initial load
duke
parents:
diff changeset
339 virtual uint ideal_reg() const { return Op_RegF; }
a61af66fc99e Initial load
duke
parents:
diff changeset
340 };
a61af66fc99e Initial load
duke
parents:
diff changeset
341
a61af66fc99e Initial load
duke
parents:
diff changeset
342 //------------------------------AbsDNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
343 // Absolute value a double, a common float-point idiom with a cheap hardware
a61af66fc99e Initial load
duke
parents:
diff changeset
344 // implemention on most chips. Since a naive graph involves control flow, we
a61af66fc99e Initial load
duke
parents:
diff changeset
345 // "match" it in the ideal world (so the control flow can be removed).
a61af66fc99e Initial load
duke
parents:
diff changeset
346 class AbsDNode : public AbsNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
347 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
348 AbsDNode( Node *in1 ) : AbsNode(in1) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
349 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
350 const Type *bottom_type() const { return Type::DOUBLE; }
a61af66fc99e Initial load
duke
parents:
diff changeset
351 virtual uint ideal_reg() const { return Op_RegD; }
a61af66fc99e Initial load
duke
parents:
diff changeset
352 };
a61af66fc99e Initial load
duke
parents:
diff changeset
353
a61af66fc99e Initial load
duke
parents:
diff changeset
354
a61af66fc99e Initial load
duke
parents:
diff changeset
355 //------------------------------CmpLTMaskNode----------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
356 // If p < q, return -1 else return 0. Nice for flow-free idioms.
a61af66fc99e Initial load
duke
parents:
diff changeset
357 class CmpLTMaskNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
358 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
359 CmpLTMaskNode( Node *p, Node *q ) : Node(0, p, q) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
360 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
361 const Type *bottom_type() const { return TypeInt::INT; }
a61af66fc99e Initial load
duke
parents:
diff changeset
362 virtual uint ideal_reg() const { return Op_RegI; }
a61af66fc99e Initial load
duke
parents:
diff changeset
363 };
a61af66fc99e Initial load
duke
parents:
diff changeset
364
a61af66fc99e Initial load
duke
parents:
diff changeset
365
a61af66fc99e Initial load
duke
parents:
diff changeset
366 //------------------------------NegNode----------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
367 class NegNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
368 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
369 NegNode( Node *in1 ) : Node(0,in1) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
370 };
a61af66fc99e Initial load
duke
parents:
diff changeset
371
a61af66fc99e Initial load
duke
parents:
diff changeset
372 //------------------------------NegFNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
373 // Negate value a float. Negating 0.0 returns -0.0, but subtracting from
a61af66fc99e Initial load
duke
parents:
diff changeset
374 // zero returns +0.0 (per JVM spec on 'fneg' bytecode). As subtraction
a61af66fc99e Initial load
duke
parents:
diff changeset
375 // cannot be used to replace negation we have to implement negation as ideal
a61af66fc99e Initial load
duke
parents:
diff changeset
376 // node; note that negation and addition can replace subtraction.
a61af66fc99e Initial load
duke
parents:
diff changeset
377 class NegFNode : public NegNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
378 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
379 NegFNode( Node *in1 ) : NegNode(in1) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
380 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
381 const Type *bottom_type() const { return Type::FLOAT; }
a61af66fc99e Initial load
duke
parents:
diff changeset
382 virtual uint ideal_reg() const { return Op_RegF; }
a61af66fc99e Initial load
duke
parents:
diff changeset
383 };
a61af66fc99e Initial load
duke
parents:
diff changeset
384
a61af66fc99e Initial load
duke
parents:
diff changeset
385 //------------------------------NegDNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
386 // Negate value a double. Negating 0.0 returns -0.0, but subtracting from
a61af66fc99e Initial load
duke
parents:
diff changeset
387 // zero returns +0.0 (per JVM spec on 'dneg' bytecode). As subtraction
a61af66fc99e Initial load
duke
parents:
diff changeset
388 // cannot be used to replace negation we have to implement negation as ideal
a61af66fc99e Initial load
duke
parents:
diff changeset
389 // node; note that negation and addition can replace subtraction.
a61af66fc99e Initial load
duke
parents:
diff changeset
390 class NegDNode : public NegNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
391 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
392 NegDNode( Node *in1 ) : NegNode(in1) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
393 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
394 const Type *bottom_type() const { return Type::DOUBLE; }
a61af66fc99e Initial load
duke
parents:
diff changeset
395 virtual uint ideal_reg() const { return Op_RegD; }
a61af66fc99e Initial load
duke
parents:
diff changeset
396 };
a61af66fc99e Initial load
duke
parents:
diff changeset
397
a61af66fc99e Initial load
duke
parents:
diff changeset
398 //------------------------------CosDNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
399 // Cosinus of a double
a61af66fc99e Initial load
duke
parents:
diff changeset
400 class CosDNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
401 public:
8076
c59b7900a2bd 8007959: Use expensive node logic for more math nodes
roland
parents: 8048
diff changeset
402 CosDNode(Compile* C, Node *c, Node *in1) : Node(c, in1) {
c59b7900a2bd 8007959: Use expensive node logic for more math nodes
roland
parents: 8048
diff changeset
403 init_flags(Flag_is_expensive);
c59b7900a2bd 8007959: Use expensive node logic for more math nodes
roland
parents: 8048
diff changeset
404 C->add_expensive_node(this);
c59b7900a2bd 8007959: Use expensive node logic for more math nodes
roland
parents: 8048
diff changeset
405 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
406 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
407 const Type *bottom_type() const { return Type::DOUBLE; }
a61af66fc99e Initial load
duke
parents:
diff changeset
408 virtual uint ideal_reg() const { return Op_RegD; }
a61af66fc99e Initial load
duke
parents:
diff changeset
409 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
410 };
a61af66fc99e Initial load
duke
parents:
diff changeset
411
a61af66fc99e Initial load
duke
parents:
diff changeset
412 //------------------------------CosDNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
413 // Sinus of a double
a61af66fc99e Initial load
duke
parents:
diff changeset
414 class SinDNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
415 public:
8076
c59b7900a2bd 8007959: Use expensive node logic for more math nodes
roland
parents: 8048
diff changeset
416 SinDNode(Compile* C, Node *c, Node *in1) : Node(c, in1) {
c59b7900a2bd 8007959: Use expensive node logic for more math nodes
roland
parents: 8048
diff changeset
417 init_flags(Flag_is_expensive);
c59b7900a2bd 8007959: Use expensive node logic for more math nodes
roland
parents: 8048
diff changeset
418 C->add_expensive_node(this);
c59b7900a2bd 8007959: Use expensive node logic for more math nodes
roland
parents: 8048
diff changeset
419 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
420 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
421 const Type *bottom_type() const { return Type::DOUBLE; }
a61af66fc99e Initial load
duke
parents:
diff changeset
422 virtual uint ideal_reg() const { return Op_RegD; }
a61af66fc99e Initial load
duke
parents:
diff changeset
423 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
424 };
a61af66fc99e Initial load
duke
parents:
diff changeset
425
a61af66fc99e Initial load
duke
parents:
diff changeset
426
a61af66fc99e Initial load
duke
parents:
diff changeset
427 //------------------------------TanDNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
428 // tangens of a double
a61af66fc99e Initial load
duke
parents:
diff changeset
429 class TanDNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
430 public:
8076
c59b7900a2bd 8007959: Use expensive node logic for more math nodes
roland
parents: 8048
diff changeset
431 TanDNode(Compile* C, Node *c,Node *in1) : Node(c, in1) {
c59b7900a2bd 8007959: Use expensive node logic for more math nodes
roland
parents: 8048
diff changeset
432 init_flags(Flag_is_expensive);
c59b7900a2bd 8007959: Use expensive node logic for more math nodes
roland
parents: 8048
diff changeset
433 C->add_expensive_node(this);
c59b7900a2bd 8007959: Use expensive node logic for more math nodes
roland
parents: 8048
diff changeset
434 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
435 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
436 const Type *bottom_type() const { return Type::DOUBLE; }
a61af66fc99e Initial load
duke
parents:
diff changeset
437 virtual uint ideal_reg() const { return Op_RegD; }
a61af66fc99e Initial load
duke
parents:
diff changeset
438 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
439 };
a61af66fc99e Initial load
duke
parents:
diff changeset
440
a61af66fc99e Initial load
duke
parents:
diff changeset
441
a61af66fc99e Initial load
duke
parents:
diff changeset
442 //------------------------------AtanDNode--------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
443 // arcus tangens of a double
a61af66fc99e Initial load
duke
parents:
diff changeset
444 class AtanDNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
445 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
446 AtanDNode(Node *c, Node *in1, Node *in2 ) : Node(c, in1, in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
447 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
448 const Type *bottom_type() const { return Type::DOUBLE; }
a61af66fc99e Initial load
duke
parents:
diff changeset
449 virtual uint ideal_reg() const { return Op_RegD; }
a61af66fc99e Initial load
duke
parents:
diff changeset
450 };
a61af66fc99e Initial load
duke
parents:
diff changeset
451
a61af66fc99e Initial load
duke
parents:
diff changeset
452
a61af66fc99e Initial load
duke
parents:
diff changeset
453 //------------------------------SqrtDNode--------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
454 // square root a double
a61af66fc99e Initial load
duke
parents:
diff changeset
455 class SqrtDNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
456 public:
8076
c59b7900a2bd 8007959: Use expensive node logic for more math nodes
roland
parents: 8048
diff changeset
457 SqrtDNode(Compile* C, Node *c, Node *in1) : Node(c, in1) {
c59b7900a2bd 8007959: Use expensive node logic for more math nodes
roland
parents: 8048
diff changeset
458 init_flags(Flag_is_expensive);
c59b7900a2bd 8007959: Use expensive node logic for more math nodes
roland
parents: 8048
diff changeset
459 C->add_expensive_node(this);
c59b7900a2bd 8007959: Use expensive node logic for more math nodes
roland
parents: 8048
diff changeset
460 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
461 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
462 const Type *bottom_type() const { return Type::DOUBLE; }
a61af66fc99e Initial load
duke
parents:
diff changeset
463 virtual uint ideal_reg() const { return Op_RegD; }
a61af66fc99e Initial load
duke
parents:
diff changeset
464 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
465 };
a61af66fc99e Initial load
duke
parents:
diff changeset
466
a61af66fc99e Initial load
duke
parents:
diff changeset
467 //------------------------------ExpDNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
468 // Exponentiate a double
a61af66fc99e Initial load
duke
parents:
diff changeset
469 class ExpDNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
470 public:
8048
8b3da8d14c93 7197327: 40% regression on 8 b41 comp 8 b40 on specjvm2008.mpegaudio on oob
roland
parents: 6842
diff changeset
471 ExpDNode(Compile* C, Node *c, Node *in1) : Node(c, in1) {
8b3da8d14c93 7197327: 40% regression on 8 b41 comp 8 b40 on specjvm2008.mpegaudio on oob
roland
parents: 6842
diff changeset
472 init_flags(Flag_is_expensive);
8b3da8d14c93 7197327: 40% regression on 8 b41 comp 8 b40 on specjvm2008.mpegaudio on oob
roland
parents: 6842
diff changeset
473 C->add_expensive_node(this);
8b3da8d14c93 7197327: 40% regression on 8 b41 comp 8 b40 on specjvm2008.mpegaudio on oob
roland
parents: 6842
diff changeset
474 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
475 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
476 const Type *bottom_type() const { return Type::DOUBLE; }
a61af66fc99e Initial load
duke
parents:
diff changeset
477 virtual uint ideal_reg() const { return Op_RegD; }
a61af66fc99e Initial load
duke
parents:
diff changeset
478 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
479 };
a61af66fc99e Initial load
duke
parents:
diff changeset
480
a61af66fc99e Initial load
duke
parents:
diff changeset
481 //------------------------------LogDNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
482 // Log_e of a double
a61af66fc99e Initial load
duke
parents:
diff changeset
483 class LogDNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
484 public:
8076
c59b7900a2bd 8007959: Use expensive node logic for more math nodes
roland
parents: 8048
diff changeset
485 LogDNode(Compile* C, Node *c, Node *in1) : Node(c, in1) {
c59b7900a2bd 8007959: Use expensive node logic for more math nodes
roland
parents: 8048
diff changeset
486 init_flags(Flag_is_expensive);
c59b7900a2bd 8007959: Use expensive node logic for more math nodes
roland
parents: 8048
diff changeset
487 C->add_expensive_node(this);
c59b7900a2bd 8007959: Use expensive node logic for more math nodes
roland
parents: 8048
diff changeset
488 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
489 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
490 const Type *bottom_type() const { return Type::DOUBLE; }
a61af66fc99e Initial load
duke
parents:
diff changeset
491 virtual uint ideal_reg() const { return Op_RegD; }
a61af66fc99e Initial load
duke
parents:
diff changeset
492 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
493 };
a61af66fc99e Initial load
duke
parents:
diff changeset
494
a61af66fc99e Initial load
duke
parents:
diff changeset
495 //------------------------------Log10DNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
496 // Log_10 of a double
a61af66fc99e Initial load
duke
parents:
diff changeset
497 class Log10DNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
498 public:
8076
c59b7900a2bd 8007959: Use expensive node logic for more math nodes
roland
parents: 8048
diff changeset
499 Log10DNode(Compile* C, Node *c, Node *in1) : Node(c, in1) {
c59b7900a2bd 8007959: Use expensive node logic for more math nodes
roland
parents: 8048
diff changeset
500 init_flags(Flag_is_expensive);
c59b7900a2bd 8007959: Use expensive node logic for more math nodes
roland
parents: 8048
diff changeset
501 C->add_expensive_node(this);
c59b7900a2bd 8007959: Use expensive node logic for more math nodes
roland
parents: 8048
diff changeset
502 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
503 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
504 const Type *bottom_type() const { return Type::DOUBLE; }
a61af66fc99e Initial load
duke
parents:
diff changeset
505 virtual uint ideal_reg() const { return Op_RegD; }
a61af66fc99e Initial load
duke
parents:
diff changeset
506 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
507 };
a61af66fc99e Initial load
duke
parents:
diff changeset
508
a61af66fc99e Initial load
duke
parents:
diff changeset
509 //------------------------------PowDNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
510 // Raise a double to a double power
a61af66fc99e Initial load
duke
parents:
diff changeset
511 class PowDNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
512 public:
8048
8b3da8d14c93 7197327: 40% regression on 8 b41 comp 8 b40 on specjvm2008.mpegaudio on oob
roland
parents: 6842
diff changeset
513 PowDNode(Compile* C, Node *c, Node *in1, Node *in2 ) : Node(c, in1, in2) {
8b3da8d14c93 7197327: 40% regression on 8 b41 comp 8 b40 on specjvm2008.mpegaudio on oob
roland
parents: 6842
diff changeset
514 init_flags(Flag_is_expensive);
8b3da8d14c93 7197327: 40% regression on 8 b41 comp 8 b40 on specjvm2008.mpegaudio on oob
roland
parents: 6842
diff changeset
515 C->add_expensive_node(this);
8b3da8d14c93 7197327: 40% regression on 8 b41 comp 8 b40 on specjvm2008.mpegaudio on oob
roland
parents: 6842
diff changeset
516 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
517 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
518 const Type *bottom_type() const { return Type::DOUBLE; }
a61af66fc99e Initial load
duke
parents:
diff changeset
519 virtual uint ideal_reg() const { return Op_RegD; }
a61af66fc99e Initial load
duke
parents:
diff changeset
520 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
521 };
a61af66fc99e Initial load
duke
parents:
diff changeset
522
a61af66fc99e Initial load
duke
parents:
diff changeset
523 //-------------------------------ReverseBytesINode--------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
524 // reverse bytes of an integer
a61af66fc99e Initial load
duke
parents:
diff changeset
525 class ReverseBytesINode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
526 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
527 ReverseBytesINode(Node *c, Node *in1) : Node(c, in1) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
528 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
529 const Type *bottom_type() const { return TypeInt::INT; }
a61af66fc99e Initial load
duke
parents:
diff changeset
530 virtual uint ideal_reg() const { return Op_RegI; }
a61af66fc99e Initial load
duke
parents:
diff changeset
531 };
a61af66fc99e Initial load
duke
parents:
diff changeset
532
a61af66fc99e Initial load
duke
parents:
diff changeset
533 //-------------------------------ReverseBytesLNode--------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
534 // reverse bytes of a long
a61af66fc99e Initial load
duke
parents:
diff changeset
535 class ReverseBytesLNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
536 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
537 ReverseBytesLNode(Node *c, Node *in1) : Node(c, in1) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
538 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
539 const Type *bottom_type() const { return TypeLong::LONG; }
a61af66fc99e Initial load
duke
parents:
diff changeset
540 virtual uint ideal_reg() const { return Op_RegL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
541 };
1396
d7f654633cfe 6946040: add intrinsic for short and char reverseBytes
never
parents: 196
diff changeset
542
d7f654633cfe 6946040: add intrinsic for short and char reverseBytes
never
parents: 196
diff changeset
543 //-------------------------------ReverseBytesUSNode--------------------------------
d7f654633cfe 6946040: add intrinsic for short and char reverseBytes
never
parents: 196
diff changeset
544 // reverse bytes of an unsigned short / char
d7f654633cfe 6946040: add intrinsic for short and char reverseBytes
never
parents: 196
diff changeset
545 class ReverseBytesUSNode : public Node {
d7f654633cfe 6946040: add intrinsic for short and char reverseBytes
never
parents: 196
diff changeset
546 public:
d7f654633cfe 6946040: add intrinsic for short and char reverseBytes
never
parents: 196
diff changeset
547 ReverseBytesUSNode(Node *c, Node *in1) : Node(c, in1) {}
d7f654633cfe 6946040: add intrinsic for short and char reverseBytes
never
parents: 196
diff changeset
548 virtual int Opcode() const;
d7f654633cfe 6946040: add intrinsic for short and char reverseBytes
never
parents: 196
diff changeset
549 const Type *bottom_type() const { return TypeInt::CHAR; }
d7f654633cfe 6946040: add intrinsic for short and char reverseBytes
never
parents: 196
diff changeset
550 virtual uint ideal_reg() const { return Op_RegI; }
d7f654633cfe 6946040: add intrinsic for short and char reverseBytes
never
parents: 196
diff changeset
551 };
d7f654633cfe 6946040: add intrinsic for short and char reverseBytes
never
parents: 196
diff changeset
552
d7f654633cfe 6946040: add intrinsic for short and char reverseBytes
never
parents: 196
diff changeset
553 //-------------------------------ReverseBytesSNode--------------------------------
d7f654633cfe 6946040: add intrinsic for short and char reverseBytes
never
parents: 196
diff changeset
554 // reverse bytes of a short
d7f654633cfe 6946040: add intrinsic for short and char reverseBytes
never
parents: 196
diff changeset
555 class ReverseBytesSNode : public Node {
d7f654633cfe 6946040: add intrinsic for short and char reverseBytes
never
parents: 196
diff changeset
556 public:
d7f654633cfe 6946040: add intrinsic for short and char reverseBytes
never
parents: 196
diff changeset
557 ReverseBytesSNode(Node *c, Node *in1) : Node(c, in1) {}
d7f654633cfe 6946040: add intrinsic for short and char reverseBytes
never
parents: 196
diff changeset
558 virtual int Opcode() const;
d7f654633cfe 6946040: add intrinsic for short and char reverseBytes
never
parents: 196
diff changeset
559 const Type *bottom_type() const { return TypeInt::SHORT; }
d7f654633cfe 6946040: add intrinsic for short and char reverseBytes
never
parents: 196
diff changeset
560 virtual uint ideal_reg() const { return Op_RegI; }
d7f654633cfe 6946040: add intrinsic for short and char reverseBytes
never
parents: 196
diff changeset
561 };
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
562
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
563 #endif // SHARE_VM_OPTO_SUBNODE_HPP