author | kvn |
Mon, 14 May 2012 09:36:00 -0700 | |
changeset 12623 | 09fcb0dc71ad |
parent 10508 | 233d2e7c462d |
child 13895 | f6dfe4123709 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
7397 | 2 |
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. |
1 | 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 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
2862
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
2862
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
2862
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#ifndef SHARE_VM_OPTO_CONNODE_HPP |
26 |
#define SHARE_VM_OPTO_CONNODE_HPP |
|
27 |
||
28 |
#include "opto/node.hpp" |
|
29 |
#include "opto/opcodes.hpp" |
|
30 |
#include "opto/type.hpp" |
|
31 |
||
1 | 32 |
class PhaseTransform; |
33 |
class MachNode; |
|
34 |
||
35 |
//------------------------------ConNode---------------------------------------- |
|
36 |
// Simple constants |
|
37 |
class ConNode : public TypeNode { |
|
38 |
public: |
|
39 |
ConNode( const Type *t ) : TypeNode(t,1) { |
|
40 |
init_req(0, (Node*)Compile::current()->root()); |
|
41 |
init_flags(Flag_is_Con); |
|
42 |
} |
|
43 |
virtual int Opcode() const; |
|
44 |
virtual uint hash() const; |
|
45 |
virtual const RegMask &out_RegMask() const { return RegMask::Empty; } |
|
46 |
virtual const RegMask &in_RegMask(uint) const { return RegMask::Empty; } |
|
47 |
||
48 |
// Polymorphic factory method: |
|
49 |
static ConNode* make( Compile* C, const Type *t ); |
|
50 |
}; |
|
51 |
||
52 |
//------------------------------ConINode--------------------------------------- |
|
53 |
// Simple integer constants |
|
54 |
class ConINode : public ConNode { |
|
55 |
public: |
|
56 |
ConINode( const TypeInt *t ) : ConNode(t) {} |
|
57 |
virtual int Opcode() const; |
|
58 |
||
59 |
// Factory method: |
|
60 |
static ConINode* make( Compile* C, int con ) { |
|
61 |
return new (C, 1) ConINode( TypeInt::make(con) ); |
|
62 |
} |
|
63 |
||
64 |
}; |
|
65 |
||
66 |
//------------------------------ConPNode--------------------------------------- |
|
67 |
// Simple pointer constants |
|
68 |
class ConPNode : public ConNode { |
|
69 |
public: |
|
70 |
ConPNode( const TypePtr *t ) : ConNode(t) {} |
|
71 |
virtual int Opcode() const; |
|
72 |
||
73 |
// Factory methods: |
|
74 |
static ConPNode* make( Compile *C ,address con ) { |
|
75 |
if (con == NULL) |
|
76 |
return new (C, 1) ConPNode( TypePtr::NULL_PTR ) ; |
|
77 |
else |
|
78 |
return new (C, 1) ConPNode( TypeRawPtr::make(con) ); |
|
79 |
} |
|
80 |
}; |
|
81 |
||
82 |
||
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
83 |
//------------------------------ConNNode-------------------------------------- |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
84 |
// Simple narrow oop constants |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
85 |
class ConNNode : public ConNode { |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
86 |
public: |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
87 |
ConNNode( const TypeNarrowOop *t ) : ConNode(t) {} |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
88 |
virtual int Opcode() const; |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
89 |
}; |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
90 |
|
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
91 |
|
1 | 92 |
//------------------------------ConLNode--------------------------------------- |
93 |
// Simple long constants |
|
94 |
class ConLNode : public ConNode { |
|
95 |
public: |
|
96 |
ConLNode( const TypeLong *t ) : ConNode(t) {} |
|
97 |
virtual int Opcode() const; |
|
98 |
||
99 |
// Factory method: |
|
100 |
static ConLNode* make( Compile *C ,jlong con ) { |
|
101 |
return new (C, 1) ConLNode( TypeLong::make(con) ); |
|
102 |
} |
|
103 |
||
104 |
}; |
|
105 |
||
106 |
//------------------------------ConFNode--------------------------------------- |
|
107 |
// Simple float constants |
|
108 |
class ConFNode : public ConNode { |
|
109 |
public: |
|
110 |
ConFNode( const TypeF *t ) : ConNode(t) {} |
|
111 |
virtual int Opcode() const; |
|
112 |
||
113 |
// Factory method: |
|
114 |
static ConFNode* make( Compile *C, float con ) { |
|
115 |
return new (C, 1) ConFNode( TypeF::make(con) ); |
|
116 |
} |
|
117 |
||
118 |
}; |
|
119 |
||
120 |
//------------------------------ConDNode--------------------------------------- |
|
121 |
// Simple double constants |
|
122 |
class ConDNode : public ConNode { |
|
123 |
public: |
|
124 |
ConDNode( const TypeD *t ) : ConNode(t) {} |
|
125 |
virtual int Opcode() const; |
|
126 |
||
127 |
// Factory method: |
|
128 |
static ConDNode* make( Compile *C, double con ) { |
|
129 |
return new (C, 1) ConDNode( TypeD::make(con) ); |
|
130 |
} |
|
131 |
||
132 |
}; |
|
133 |
||
134 |
//------------------------------BinaryNode------------------------------------- |
|
135 |
// Place holder for the 2 conditional inputs to a CMove. CMove needs 4 |
|
136 |
// inputs: the Bool (for the lt/gt/eq/ne bits), the flags (result of some |
|
137 |
// compare), and the 2 values to select between. The Matcher requires a |
|
138 |
// binary tree so we break it down like this: |
|
139 |
// (CMove (Binary bol cmp) (Binary src1 src2)) |
|
140 |
class BinaryNode : public Node { |
|
141 |
public: |
|
142 |
BinaryNode( Node *n1, Node *n2 ) : Node(0,n1,n2) { } |
|
143 |
virtual int Opcode() const; |
|
144 |
virtual uint ideal_reg() const { return 0; } |
|
145 |
}; |
|
146 |
||
147 |
//------------------------------CMoveNode-------------------------------------- |
|
148 |
// Conditional move |
|
149 |
class CMoveNode : public TypeNode { |
|
150 |
public: |
|
151 |
enum { Control, // When is it safe to do this cmove? |
|
152 |
Condition, // Condition controlling the cmove |
|
153 |
IfFalse, // Value if condition is false |
|
154 |
IfTrue }; // Value if condition is true |
|
155 |
CMoveNode( Node *bol, Node *left, Node *right, const Type *t ) : TypeNode(t,4) |
|
156 |
{ |
|
157 |
init_class_id(Class_CMove); |
|
158 |
// all inputs are nullified in Node::Node(int) |
|
159 |
// init_req(Control,NULL); |
|
160 |
init_req(Condition,bol); |
|
161 |
init_req(IfFalse,left); |
|
162 |
init_req(IfTrue,right); |
|
163 |
} |
|
164 |
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); |
|
165 |
virtual const Type *Value( PhaseTransform *phase ) const; |
|
166 |
virtual Node *Identity( PhaseTransform *phase ); |
|
167 |
static CMoveNode *make( Compile *C, Node *c, Node *bol, Node *left, Node *right, const Type *t ); |
|
168 |
// Helper function to spot cmove graph shapes |
|
169 |
static Node *is_cmove_id( PhaseTransform *phase, Node *cmp, Node *t, Node *f, BoolNode *b ); |
|
170 |
}; |
|
171 |
||
172 |
//------------------------------CMoveDNode------------------------------------- |
|
173 |
class CMoveDNode : public CMoveNode { |
|
174 |
public: |
|
175 |
CMoveDNode( Node *bol, Node *left, Node *right, const Type* t) : CMoveNode(bol,left,right,t){} |
|
176 |
virtual int Opcode() const; |
|
177 |
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); |
|
178 |
}; |
|
179 |
||
180 |
//------------------------------CMoveFNode------------------------------------- |
|
181 |
class CMoveFNode : public CMoveNode { |
|
182 |
public: |
|
183 |
CMoveFNode( Node *bol, Node *left, Node *right, const Type* t ) : CMoveNode(bol,left,right,t) {} |
|
184 |
virtual int Opcode() const; |
|
185 |
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); |
|
186 |
}; |
|
187 |
||
188 |
//------------------------------CMoveINode------------------------------------- |
|
189 |
class CMoveINode : public CMoveNode { |
|
190 |
public: |
|
191 |
CMoveINode( Node *bol, Node *left, Node *right, const TypeInt *ti ) : CMoveNode(bol,left,right,ti){} |
|
192 |
virtual int Opcode() const; |
|
193 |
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); |
|
194 |
}; |
|
195 |
||
196 |
//------------------------------CMoveLNode------------------------------------- |
|
197 |
class CMoveLNode : public CMoveNode { |
|
198 |
public: |
|
199 |
CMoveLNode(Node *bol, Node *left, Node *right, const TypeLong *tl ) : CMoveNode(bol,left,right,tl){} |
|
200 |
virtual int Opcode() const; |
|
201 |
}; |
|
202 |
||
203 |
//------------------------------CMovePNode------------------------------------- |
|
204 |
class CMovePNode : public CMoveNode { |
|
205 |
public: |
|
206 |
CMovePNode( Node *c, Node *bol, Node *left, Node *right, const TypePtr* t ) : CMoveNode(bol,left,right,t) { init_req(Control,c); } |
|
207 |
virtual int Opcode() const; |
|
208 |
}; |
|
209 |
||
590
2954744d7bba
6703890: Compressed Oops: add LoadNKlass node to generate narrow oops (32-bits) compare instructions
kvn
parents:
589
diff
changeset
|
210 |
//------------------------------CMoveNNode------------------------------------- |
2954744d7bba
6703890: Compressed Oops: add LoadNKlass node to generate narrow oops (32-bits) compare instructions
kvn
parents:
589
diff
changeset
|
211 |
class CMoveNNode : public CMoveNode { |
2954744d7bba
6703890: Compressed Oops: add LoadNKlass node to generate narrow oops (32-bits) compare instructions
kvn
parents:
589
diff
changeset
|
212 |
public: |
2954744d7bba
6703890: Compressed Oops: add LoadNKlass node to generate narrow oops (32-bits) compare instructions
kvn
parents:
589
diff
changeset
|
213 |
CMoveNNode( Node *c, Node *bol, Node *left, Node *right, const Type* t ) : CMoveNode(bol,left,right,t) { init_req(Control,c); } |
2954744d7bba
6703890: Compressed Oops: add LoadNKlass node to generate narrow oops (32-bits) compare instructions
kvn
parents:
589
diff
changeset
|
214 |
virtual int Opcode() const; |
2954744d7bba
6703890: Compressed Oops: add LoadNKlass node to generate narrow oops (32-bits) compare instructions
kvn
parents:
589
diff
changeset
|
215 |
}; |
2954744d7bba
6703890: Compressed Oops: add LoadNKlass node to generate narrow oops (32-bits) compare instructions
kvn
parents:
589
diff
changeset
|
216 |
|
2954744d7bba
6703890: Compressed Oops: add LoadNKlass node to generate narrow oops (32-bits) compare instructions
kvn
parents:
589
diff
changeset
|
217 |
//------------------------------ConstraintCastNode----------------------------- |
1 | 218 |
// cast to a different range |
219 |
class ConstraintCastNode: public TypeNode { |
|
220 |
public: |
|
221 |
ConstraintCastNode (Node *n, const Type *t ): TypeNode(t,2) { |
|
222 |
init_class_id(Class_ConstraintCast); |
|
223 |
init_req(1, n); |
|
224 |
} |
|
225 |
virtual Node *Identity( PhaseTransform *phase ); |
|
226 |
virtual const Type *Value( PhaseTransform *phase ) const; |
|
227 |
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); |
|
228 |
virtual int Opcode() const; |
|
229 |
virtual uint ideal_reg() const = 0; |
|
230 |
virtual Node *Ideal_DU_postCCP( PhaseCCP * ); |
|
231 |
}; |
|
232 |
||
233 |
//------------------------------CastIINode------------------------------------- |
|
234 |
// cast integer to integer (different range) |
|
235 |
class CastIINode: public ConstraintCastNode { |
|
236 |
public: |
|
237 |
CastIINode (Node *n, const Type *t ): ConstraintCastNode(n,t) {} |
|
238 |
virtual int Opcode() const; |
|
239 |
virtual uint ideal_reg() const { return Op_RegI; } |
|
240 |
}; |
|
241 |
||
242 |
//------------------------------CastPPNode------------------------------------- |
|
243 |
// cast pointer to pointer (different type) |
|
244 |
class CastPPNode: public ConstraintCastNode { |
|
245 |
public: |
|
373
427fb4ca6a1e
6625997: CastPP, CheckCastPP and Proj nodes are not dead loop safe
kvn
parents:
371
diff
changeset
|
246 |
CastPPNode (Node *n, const Type *t ): ConstraintCastNode(n, t) {} |
1 | 247 |
virtual int Opcode() const; |
248 |
virtual uint ideal_reg() const { return Op_RegP; } |
|
249 |
virtual Node *Ideal_DU_postCCP( PhaseCCP * ); |
|
250 |
}; |
|
251 |
||
252 |
//------------------------------CheckCastPPNode-------------------------------- |
|
253 |
// for _checkcast, cast pointer to pointer (different type), without JOIN, |
|
254 |
class CheckCastPPNode: public TypeNode { |
|
255 |
public: |
|
256 |
CheckCastPPNode( Node *c, Node *n, const Type *t ) : TypeNode(t,2) { |
|
257 |
init_class_id(Class_CheckCastPP); |
|
258 |
init_req(0, c); |
|
259 |
init_req(1, n); |
|
260 |
} |
|
373
427fb4ca6a1e
6625997: CastPP, CheckCastPP and Proj nodes are not dead loop safe
kvn
parents:
371
diff
changeset
|
261 |
|
1 | 262 |
virtual Node *Identity( PhaseTransform *phase ); |
263 |
virtual const Type *Value( PhaseTransform *phase ) const; |
|
264 |
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); |
|
265 |
virtual int Opcode() const; |
|
266 |
virtual uint ideal_reg() const { return Op_RegP; } |
|
267 |
// No longer remove CheckCast after CCP as it gives me a place to hang |
|
268 |
// the proper address type - which is required to compute anti-deps. |
|
269 |
//virtual Node *Ideal_DU_postCCP( PhaseCCP * ); |
|
270 |
}; |
|
271 |
||
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
272 |
|
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
273 |
//------------------------------EncodeP-------------------------------- |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
274 |
// Encodes an oop pointers into its compressed form |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
275 |
// Takes an extra argument which is the real heap base as a long which |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
276 |
// may be useful for code generation in the backend. |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
277 |
class EncodePNode : public TypeNode { |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
278 |
public: |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
279 |
EncodePNode(Node* value, const Type* type): |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
280 |
TypeNode(type, 2) { |
594
9f4474e5dbaf
6705887: Compressed Oops: generate x64 addressing and implicit null checks with narrow oops
kvn
parents:
590
diff
changeset
|
281 |
init_class_id(Class_EncodeP); |
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
282 |
init_req(0, NULL); |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
283 |
init_req(1, value); |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
284 |
} |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
285 |
virtual int Opcode() const; |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
286 |
virtual Node *Identity( PhaseTransform *phase ); |
371
1aacedc9db7c
6689060: Escape Analysis does not work with Compressed Oops
kvn
parents:
360
diff
changeset
|
287 |
virtual const Type *Value( PhaseTransform *phase ) const; |
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
288 |
virtual uint ideal_reg() const { return Op_RegN; } |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
289 |
|
589 | 290 |
virtual Node *Ideal_DU_postCCP( PhaseCCP *ccp ); |
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
291 |
}; |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
292 |
|
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
293 |
//------------------------------DecodeN-------------------------------- |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
294 |
// Converts a narrow oop into a real oop ptr. |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
295 |
// Takes an extra argument which is the real heap base as a long which |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
296 |
// may be useful for code generation in the backend. |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
297 |
class DecodeNNode : public TypeNode { |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
298 |
public: |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
299 |
DecodeNNode(Node* value, const Type* type): |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
300 |
TypeNode(type, 2) { |
594
9f4474e5dbaf
6705887: Compressed Oops: generate x64 addressing and implicit null checks with narrow oops
kvn
parents:
590
diff
changeset
|
301 |
init_class_id(Class_DecodeN); |
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
302 |
init_req(0, NULL); |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
303 |
init_req(1, value); |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
304 |
} |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
305 |
virtual int Opcode() const; |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
306 |
virtual Node *Identity( PhaseTransform *phase ); |
371
1aacedc9db7c
6689060: Escape Analysis does not work with Compressed Oops
kvn
parents:
360
diff
changeset
|
307 |
virtual const Type *Value( PhaseTransform *phase ) const; |
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
308 |
virtual uint ideal_reg() const { return Op_RegP; } |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
309 |
}; |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
310 |
|
1 | 311 |
//------------------------------Conv2BNode------------------------------------- |
312 |
// Convert int/pointer to a Boolean. Map zero to zero, all else to 1. |
|
313 |
class Conv2BNode : public Node { |
|
314 |
public: |
|
315 |
Conv2BNode( Node *i ) : Node(0,i) {} |
|
316 |
virtual int Opcode() const; |
|
317 |
virtual const Type *bottom_type() const { return TypeInt::BOOL; } |
|
318 |
virtual Node *Identity( PhaseTransform *phase ); |
|
319 |
virtual const Type *Value( PhaseTransform *phase ) const; |
|
320 |
virtual uint ideal_reg() const { return Op_RegI; } |
|
321 |
}; |
|
322 |
||
323 |
// The conversions operations are all Alpha sorted. Please keep it that way! |
|
324 |
//------------------------------ConvD2FNode------------------------------------ |
|
325 |
// Convert double to float |
|
326 |
class ConvD2FNode : public Node { |
|
327 |
public: |
|
328 |
ConvD2FNode( Node *in1 ) : Node(0,in1) {} |
|
329 |
virtual int Opcode() const; |
|
330 |
virtual const Type *bottom_type() const { return Type::FLOAT; } |
|
331 |
virtual const Type *Value( PhaseTransform *phase ) const; |
|
332 |
virtual Node *Identity( PhaseTransform *phase ); |
|
333 |
virtual uint ideal_reg() const { return Op_RegF; } |
|
334 |
}; |
|
335 |
||
336 |
//------------------------------ConvD2INode------------------------------------ |
|
337 |
// Convert Double to Integer |
|
338 |
class ConvD2INode : public Node { |
|
339 |
public: |
|
340 |
ConvD2INode( Node *in1 ) : Node(0,in1) {} |
|
341 |
virtual int Opcode() const; |
|
342 |
virtual const Type *bottom_type() const { return TypeInt::INT; } |
|
343 |
virtual const Type *Value( PhaseTransform *phase ) const; |
|
344 |
virtual Node *Identity( PhaseTransform *phase ); |
|
345 |
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); |
|
346 |
virtual uint ideal_reg() const { return Op_RegI; } |
|
347 |
}; |
|
348 |
||
349 |
//------------------------------ConvD2LNode------------------------------------ |
|
350 |
// Convert Double to Long |
|
351 |
class ConvD2LNode : public Node { |
|
352 |
public: |
|
353 |
ConvD2LNode( Node *dbl ) : Node(0,dbl) {} |
|
354 |
virtual int Opcode() const; |
|
355 |
virtual const Type *bottom_type() const { return TypeLong::LONG; } |
|
356 |
virtual const Type *Value( PhaseTransform *phase ) const; |
|
357 |
virtual Node *Identity( PhaseTransform *phase ); |
|
358 |
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); |
|
359 |
virtual uint ideal_reg() const { return Op_RegL; } |
|
360 |
}; |
|
361 |
||
362 |
//------------------------------ConvF2DNode------------------------------------ |
|
363 |
// Convert Float to a Double. |
|
364 |
class ConvF2DNode : public Node { |
|
365 |
public: |
|
366 |
ConvF2DNode( Node *in1 ) : Node(0,in1) {} |
|
367 |
virtual int Opcode() const; |
|
368 |
virtual const Type *bottom_type() const { return Type::DOUBLE; } |
|
369 |
virtual const Type *Value( PhaseTransform *phase ) const; |
|
370 |
virtual uint ideal_reg() const { return Op_RegD; } |
|
371 |
}; |
|
372 |
||
373 |
//------------------------------ConvF2INode------------------------------------ |
|
374 |
// Convert float to integer |
|
375 |
class ConvF2INode : public Node { |
|
376 |
public: |
|
377 |
ConvF2INode( Node *in1 ) : Node(0,in1) {} |
|
378 |
virtual int Opcode() const; |
|
379 |
virtual const Type *bottom_type() const { return TypeInt::INT; } |
|
380 |
virtual const Type *Value( PhaseTransform *phase ) const; |
|
381 |
virtual Node *Identity( PhaseTransform *phase ); |
|
382 |
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); |
|
383 |
virtual uint ideal_reg() const { return Op_RegI; } |
|
384 |
}; |
|
385 |
||
386 |
//------------------------------ConvF2LNode------------------------------------ |
|
387 |
// Convert float to long |
|
388 |
class ConvF2LNode : public Node { |
|
389 |
public: |
|
390 |
ConvF2LNode( Node *in1 ) : Node(0,in1) {} |
|
391 |
virtual int Opcode() const; |
|
392 |
virtual const Type *bottom_type() const { return TypeLong::LONG; } |
|
393 |
virtual const Type *Value( PhaseTransform *phase ) const; |
|
394 |
virtual Node *Identity( PhaseTransform *phase ); |
|
395 |
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); |
|
396 |
virtual uint ideal_reg() const { return Op_RegL; } |
|
397 |
}; |
|
398 |
||
399 |
//------------------------------ConvI2DNode------------------------------------ |
|
400 |
// Convert Integer to Double |
|
401 |
class ConvI2DNode : public Node { |
|
402 |
public: |
|
403 |
ConvI2DNode( Node *in1 ) : Node(0,in1) {} |
|
404 |
virtual int Opcode() const; |
|
405 |
virtual const Type *bottom_type() const { return Type::DOUBLE; } |
|
406 |
virtual const Type *Value( PhaseTransform *phase ) const; |
|
407 |
virtual uint ideal_reg() const { return Op_RegD; } |
|
408 |
}; |
|
409 |
||
410 |
//------------------------------ConvI2FNode------------------------------------ |
|
411 |
// Convert Integer to Float |
|
412 |
class ConvI2FNode : public Node { |
|
413 |
public: |
|
414 |
ConvI2FNode( Node *in1 ) : Node(0,in1) {} |
|
415 |
virtual int Opcode() const; |
|
416 |
virtual const Type *bottom_type() const { return Type::FLOAT; } |
|
417 |
virtual const Type *Value( PhaseTransform *phase ) const; |
|
418 |
virtual Node *Identity( PhaseTransform *phase ); |
|
419 |
virtual uint ideal_reg() const { return Op_RegF; } |
|
420 |
}; |
|
421 |
||
422 |
//------------------------------ConvI2LNode------------------------------------ |
|
423 |
// Convert integer to long |
|
424 |
class ConvI2LNode : public TypeNode { |
|
425 |
public: |
|
426 |
ConvI2LNode(Node *in1, const TypeLong* t = TypeLong::INT) |
|
427 |
: TypeNode(t, 2) |
|
428 |
{ init_req(1, in1); } |
|
429 |
virtual int Opcode() const; |
|
430 |
virtual const Type *Value( PhaseTransform *phase ) const; |
|
431 |
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); |
|
432 |
virtual uint ideal_reg() const { return Op_RegL; } |
|
433 |
}; |
|
434 |
||
435 |
//------------------------------ConvL2DNode------------------------------------ |
|
436 |
// Convert Long to Double |
|
437 |
class ConvL2DNode : public Node { |
|
438 |
public: |
|
439 |
ConvL2DNode( Node *in1 ) : Node(0,in1) {} |
|
440 |
virtual int Opcode() const; |
|
441 |
virtual const Type *bottom_type() const { return Type::DOUBLE; } |
|
442 |
virtual const Type *Value( PhaseTransform *phase ) const; |
|
443 |
virtual uint ideal_reg() const { return Op_RegD; } |
|
444 |
}; |
|
445 |
||
446 |
//------------------------------ConvL2FNode------------------------------------ |
|
447 |
// Convert Long to Float |
|
448 |
class ConvL2FNode : public Node { |
|
449 |
public: |
|
450 |
ConvL2FNode( Node *in1 ) : Node(0,in1) {} |
|
451 |
virtual int Opcode() const; |
|
452 |
virtual const Type *bottom_type() const { return Type::FLOAT; } |
|
453 |
virtual const Type *Value( PhaseTransform *phase ) const; |
|
454 |
virtual uint ideal_reg() const { return Op_RegF; } |
|
455 |
}; |
|
456 |
||
457 |
//------------------------------ConvL2INode------------------------------------ |
|
458 |
// Convert long to integer |
|
459 |
class ConvL2INode : public Node { |
|
460 |
public: |
|
461 |
ConvL2INode( Node *in1 ) : Node(0,in1) {} |
|
462 |
virtual int Opcode() const; |
|
463 |
virtual const Type *bottom_type() const { return TypeInt::INT; } |
|
464 |
virtual Node *Identity( PhaseTransform *phase ); |
|
465 |
virtual const Type *Value( PhaseTransform *phase ) const; |
|
466 |
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); |
|
467 |
virtual uint ideal_reg() const { return Op_RegI; } |
|
468 |
}; |
|
469 |
||
470 |
//------------------------------CastX2PNode------------------------------------- |
|
471 |
// convert a machine-pointer-sized integer to a raw pointer |
|
472 |
class CastX2PNode : public Node { |
|
473 |
public: |
|
474 |
CastX2PNode( Node *n ) : Node(NULL, n) {} |
|
475 |
virtual int Opcode() const; |
|
476 |
virtual const Type *Value( PhaseTransform *phase ) const; |
|
477 |
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); |
|
478 |
virtual Node *Identity( PhaseTransform *phase ); |
|
479 |
virtual uint ideal_reg() const { return Op_RegP; } |
|
480 |
virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM; } |
|
481 |
}; |
|
482 |
||
483 |
//------------------------------CastP2XNode------------------------------------- |
|
484 |
// Used in both 32-bit and 64-bit land. |
|
485 |
// Used for card-marks and unsafe pointer math. |
|
486 |
class CastP2XNode : public Node { |
|
487 |
public: |
|
488 |
CastP2XNode( Node *ctrl, Node *n ) : Node(ctrl, n) {} |
|
489 |
virtual int Opcode() const; |
|
490 |
virtual const Type *Value( PhaseTransform *phase ) const; |
|
491 |
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); |
|
492 |
virtual Node *Identity( PhaseTransform *phase ); |
|
493 |
virtual uint ideal_reg() const { return Op_RegX; } |
|
494 |
virtual const Type *bottom_type() const { return TypeX_X; } |
|
495 |
// Return false to keep node from moving away from an associated card mark. |
|
496 |
virtual bool depends_only_on_test() const { return false; } |
|
497 |
}; |
|
498 |
||
499 |
//------------------------------ThreadLocalNode-------------------------------- |
|
500 |
// Ideal Node which returns the base of ThreadLocalStorage. |
|
501 |
class ThreadLocalNode : public Node { |
|
502 |
public: |
|
503 |
ThreadLocalNode( ) : Node((Node*)Compile::current()->root()) {} |
|
504 |
virtual int Opcode() const; |
|
505 |
virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM;} |
|
506 |
virtual uint ideal_reg() const { return Op_RegP; } |
|
507 |
}; |
|
508 |
||
509 |
//------------------------------LoadReturnPCNode------------------------------- |
|
510 |
class LoadReturnPCNode: public Node { |
|
511 |
public: |
|
512 |
LoadReturnPCNode(Node *c) : Node(c) { } |
|
513 |
virtual int Opcode() const; |
|
514 |
virtual uint ideal_reg() const { return Op_RegP; } |
|
515 |
}; |
|
516 |
||
517 |
||
518 |
//-----------------------------RoundFloatNode---------------------------------- |
|
519 |
class RoundFloatNode: public Node { |
|
520 |
public: |
|
521 |
RoundFloatNode(Node* c, Node *in1): Node(c, in1) {} |
|
522 |
virtual int Opcode() const; |
|
523 |
virtual const Type *bottom_type() const { return Type::FLOAT; } |
|
524 |
virtual uint ideal_reg() const { return Op_RegF; } |
|
525 |
virtual Node *Identity( PhaseTransform *phase ); |
|
526 |
virtual const Type *Value( PhaseTransform *phase ) const; |
|
527 |
}; |
|
528 |
||
529 |
||
530 |
//-----------------------------RoundDoubleNode--------------------------------- |
|
531 |
class RoundDoubleNode: public Node { |
|
532 |
public: |
|
533 |
RoundDoubleNode(Node* c, Node *in1): Node(c, in1) {} |
|
534 |
virtual int Opcode() const; |
|
535 |
virtual const Type *bottom_type() const { return Type::DOUBLE; } |
|
536 |
virtual uint ideal_reg() const { return Op_RegD; } |
|
537 |
virtual Node *Identity( PhaseTransform *phase ); |
|
538 |
virtual const Type *Value( PhaseTransform *phase ) const; |
|
539 |
}; |
|
540 |
||
541 |
//------------------------------Opaque1Node------------------------------------ |
|
542 |
// A node to prevent unwanted optimizations. Allows constant folding. |
|
543 |
// Stops value-numbering, Ideal calls or Identity functions. |
|
544 |
class Opaque1Node : public Node { |
|
545 |
virtual uint hash() const ; // { return NO_HASH; } |
|
546 |
virtual uint cmp( const Node &n ) const; |
|
547 |
public: |
|
762
1b26adb5fea1
6715633: when matching a memory node the adr_type should not change
kvn
parents:
594
diff
changeset
|
548 |
Opaque1Node( Compile* C, Node *n ) : Node(0,n) { |
1b26adb5fea1
6715633: when matching a memory node the adr_type should not change
kvn
parents:
594
diff
changeset
|
549 |
// Put it on the Macro nodes list to removed during macro nodes expansion. |
1b26adb5fea1
6715633: when matching a memory node the adr_type should not change
kvn
parents:
594
diff
changeset
|
550 |
init_flags(Flag_is_macro); |
1b26adb5fea1
6715633: when matching a memory node the adr_type should not change
kvn
parents:
594
diff
changeset
|
551 |
C->add_macro_node(this); |
1b26adb5fea1
6715633: when matching a memory node the adr_type should not change
kvn
parents:
594
diff
changeset
|
552 |
} |
1 | 553 |
// Special version for the pre-loop to hold the original loop limit |
554 |
// which is consumed by range check elimination. |
|
762
1b26adb5fea1
6715633: when matching a memory node the adr_type should not change
kvn
parents:
594
diff
changeset
|
555 |
Opaque1Node( Compile* C, Node *n, Node* orig_limit ) : Node(0,n,orig_limit) { |
1b26adb5fea1
6715633: when matching a memory node the adr_type should not change
kvn
parents:
594
diff
changeset
|
556 |
// Put it on the Macro nodes list to removed during macro nodes expansion. |
1b26adb5fea1
6715633: when matching a memory node the adr_type should not change
kvn
parents:
594
diff
changeset
|
557 |
init_flags(Flag_is_macro); |
1b26adb5fea1
6715633: when matching a memory node the adr_type should not change
kvn
parents:
594
diff
changeset
|
558 |
C->add_macro_node(this); |
1b26adb5fea1
6715633: when matching a memory node the adr_type should not change
kvn
parents:
594
diff
changeset
|
559 |
} |
1 | 560 |
Node* original_loop_limit() { return req()==3 ? in(2) : NULL; } |
561 |
virtual int Opcode() const; |
|
562 |
virtual const Type *bottom_type() const { return TypeInt::INT; } |
|
563 |
virtual Node *Identity( PhaseTransform *phase ); |
|
564 |
}; |
|
565 |
||
566 |
//------------------------------Opaque2Node------------------------------------ |
|
567 |
// A node to prevent unwanted optimizations. Allows constant folding. Stops |
|
568 |
// value-numbering, most Ideal calls or Identity functions. This Node is |
|
569 |
// specifically designed to prevent the pre-increment value of a loop trip |
|
570 |
// counter from being live out of the bottom of the loop (hence causing the |
|
571 |
// pre- and post-increment values both being live and thus requiring an extra |
|
572 |
// temp register and an extra move). If we "accidentally" optimize through |
|
573 |
// this kind of a Node, we'll get slightly pessimal, but correct, code. Thus |
|
574 |
// it's OK to be slightly sloppy on optimizations here. |
|
575 |
class Opaque2Node : public Node { |
|
576 |
virtual uint hash() const ; // { return NO_HASH; } |
|
577 |
virtual uint cmp( const Node &n ) const; |
|
578 |
public: |
|
762
1b26adb5fea1
6715633: when matching a memory node the adr_type should not change
kvn
parents:
594
diff
changeset
|
579 |
Opaque2Node( Compile* C, Node *n ) : Node(0,n) { |
1b26adb5fea1
6715633: when matching a memory node the adr_type should not change
kvn
parents:
594
diff
changeset
|
580 |
// Put it on the Macro nodes list to removed during macro nodes expansion. |
1b26adb5fea1
6715633: when matching a memory node the adr_type should not change
kvn
parents:
594
diff
changeset
|
581 |
init_flags(Flag_is_macro); |
1b26adb5fea1
6715633: when matching a memory node the adr_type should not change
kvn
parents:
594
diff
changeset
|
582 |
C->add_macro_node(this); |
1b26adb5fea1
6715633: when matching a memory node the adr_type should not change
kvn
parents:
594
diff
changeset
|
583 |
} |
1 | 584 |
virtual int Opcode() const; |
585 |
virtual const Type *bottom_type() const { return TypeInt::INT; } |
|
586 |
}; |
|
587 |
||
588 |
//----------------------PartialSubtypeCheckNode-------------------------------- |
|
589 |
// The 2nd slow-half of a subtype check. Scan the subklass's 2ndary superklass |
|
590 |
// array for an instance of the superklass. Set a hidden internal cache on a |
|
591 |
// hit (cache is checked with exposed code in gen_subtype_check()). Return |
|
592 |
// not zero for a miss or zero for a hit. |
|
593 |
class PartialSubtypeCheckNode : public Node { |
|
594 |
public: |
|
595 |
PartialSubtypeCheckNode(Node* c, Node* sub, Node* super) : Node(c,sub,super) {} |
|
596 |
virtual int Opcode() const; |
|
597 |
virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM; } |
|
598 |
virtual uint ideal_reg() const { return Op_RegP; } |
|
599 |
}; |
|
600 |
||
601 |
// |
|
602 |
class MoveI2FNode : public Node { |
|
603 |
public: |
|
604 |
MoveI2FNode( Node *value ) : Node(0,value) {} |
|
605 |
virtual int Opcode() const; |
|
606 |
virtual const Type *bottom_type() const { return Type::FLOAT; } |
|
607 |
virtual uint ideal_reg() const { return Op_RegF; } |
|
608 |
virtual const Type* Value( PhaseTransform *phase ) const; |
|
609 |
}; |
|
610 |
||
611 |
class MoveL2DNode : public Node { |
|
612 |
public: |
|
613 |
MoveL2DNode( Node *value ) : Node(0,value) {} |
|
614 |
virtual int Opcode() const; |
|
615 |
virtual const Type *bottom_type() const { return Type::DOUBLE; } |
|
616 |
virtual uint ideal_reg() const { return Op_RegD; } |
|
617 |
virtual const Type* Value( PhaseTransform *phase ) const; |
|
618 |
}; |
|
619 |
||
620 |
class MoveF2INode : public Node { |
|
621 |
public: |
|
622 |
MoveF2INode( Node *value ) : Node(0,value) {} |
|
623 |
virtual int Opcode() const; |
|
624 |
virtual const Type *bottom_type() const { return TypeInt::INT; } |
|
625 |
virtual uint ideal_reg() const { return Op_RegI; } |
|
626 |
virtual const Type* Value( PhaseTransform *phase ) const; |
|
627 |
}; |
|
628 |
||
629 |
class MoveD2LNode : public Node { |
|
630 |
public: |
|
631 |
MoveD2LNode( Node *value ) : Node(0,value) {} |
|
632 |
virtual int Opcode() const; |
|
633 |
virtual const Type *bottom_type() const { return TypeLong::LONG; } |
|
634 |
virtual uint ideal_reg() const { return Op_RegL; } |
|
635 |
virtual const Type* Value( PhaseTransform *phase ) const; |
|
636 |
}; |
|
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
781
diff
changeset
|
637 |
|
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
638 |
//---------- CountBitsNode ----------------------------------------------------- |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
639 |
class CountBitsNode : public Node { |
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
781
diff
changeset
|
640 |
public: |
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
641 |
CountBitsNode(Node* in1) : Node(0, in1) {} |
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
781
diff
changeset
|
642 |
const Type* bottom_type() const { return TypeInt::INT; } |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
781
diff
changeset
|
643 |
virtual uint ideal_reg() const { return Op_RegI; } |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
781
diff
changeset
|
644 |
}; |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
781
diff
changeset
|
645 |
|
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
646 |
//---------- CountLeadingZerosINode -------------------------------------------- |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
647 |
// Count leading zeros (0-bit count starting from MSB) of an integer. |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
648 |
class CountLeadingZerosINode : public CountBitsNode { |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
649 |
public: |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
650 |
CountLeadingZerosINode(Node* in1) : CountBitsNode(in1) {} |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
651 |
virtual int Opcode() const; |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
652 |
virtual const Type* Value(PhaseTransform* phase) const; |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
653 |
}; |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
654 |
|
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
655 |
//---------- CountLeadingZerosLNode -------------------------------------------- |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
656 |
// Count leading zeros (0-bit count starting from MSB) of a long. |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
657 |
class CountLeadingZerosLNode : public CountBitsNode { |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
658 |
public: |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
659 |
CountLeadingZerosLNode(Node* in1) : CountBitsNode(in1) {} |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
660 |
virtual int Opcode() const; |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
661 |
virtual const Type* Value(PhaseTransform* phase) const; |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
662 |
}; |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
663 |
|
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
664 |
//---------- CountTrailingZerosINode ------------------------------------------- |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
665 |
// Count trailing zeros (0-bit count starting from LSB) of an integer. |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
666 |
class CountTrailingZerosINode : public CountBitsNode { |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
667 |
public: |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
668 |
CountTrailingZerosINode(Node* in1) : CountBitsNode(in1) {} |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
669 |
virtual int Opcode() const; |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
670 |
virtual const Type* Value(PhaseTransform* phase) const; |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
671 |
}; |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
672 |
|
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
673 |
//---------- CountTrailingZerosLNode ------------------------------------------- |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
674 |
// Count trailing zeros (0-bit count starting from LSB) of a long. |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
675 |
class CountTrailingZerosLNode : public CountBitsNode { |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
676 |
public: |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
677 |
CountTrailingZerosLNode(Node* in1) : CountBitsNode(in1) {} |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
678 |
virtual int Opcode() const; |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
679 |
virtual const Type* Value(PhaseTransform* phase) const; |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
680 |
}; |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
681 |
|
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
682 |
//---------- PopCountINode ----------------------------------------------------- |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
683 |
// Population count (bit count) of an integer. |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
684 |
class PopCountINode : public CountBitsNode { |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
685 |
public: |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
686 |
PopCountINode(Node* in1) : CountBitsNode(in1) {} |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
687 |
virtual int Opcode() const; |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
688 |
}; |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
689 |
|
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
781
diff
changeset
|
690 |
//---------- PopCountLNode ----------------------------------------------------- |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
781
diff
changeset
|
691 |
// Population count (bit count) of a long. |
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
692 |
class PopCountLNode : public CountBitsNode { |
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
781
diff
changeset
|
693 |
public: |
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2255
diff
changeset
|
694 |
PopCountLNode(Node* in1) : CountBitsNode(in1) {} |
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
781
diff
changeset
|
695 |
virtual int Opcode() const; |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
781
diff
changeset
|
696 |
}; |
7397 | 697 |
|
698 |
#endif // SHARE_VM_OPTO_CONNODE_HPP |