< prev index next >

src/hotspot/share/opto/subnode.hpp

Print this page

187   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
188   virtual const Type *sub( const Type *, const Type * ) const;
189 };
190 
191 //------------------------------CmpNNode--------------------------------------
192 // Compare 2 narrow oop values, returning condition codes (-1, 0 or 1).
193 class CmpNNode : public CmpNode {
194 public:
195   CmpNNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
196   virtual int Opcode() const;
197   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
198   virtual const Type *sub( const Type *, const Type * ) const;
199 };
200 
201 //------------------------------CmpLNode---------------------------------------
202 // Compare 2 long values, returning condition codes (-1, 0 or 1).
203 class CmpLNode : public CmpNode {
204 public:
205   CmpLNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
206   virtual int    Opcode() const;
207   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);

208   virtual const Type *sub( const Type *, const Type * ) const;

209 };
210 
211 //------------------------------CmpULNode---------------------------------------
212 // Compare 2 unsigned long values, returning condition codes (-1, 0 or 1).
213 class CmpULNode : public CmpNode {
214 public:
215   CmpULNode(Node* in1, Node* in2) : CmpNode(in1, in2) { }
216   virtual int Opcode() const;
217   virtual const Type* sub(const Type*, const Type*) const;
218 };
219 
220 //------------------------------CmpL3Node--------------------------------------
221 // Compare 2 long values, returning integer value (-1, 0 or 1).
222 class CmpL3Node : public CmpLNode {
223 public:
224   CmpL3Node( Node *in1, Node *in2 ) : CmpLNode(in1,in2) {
225     // Since it is not consumed by Bools, it is not really a Cmp.
226     init_class_id(Class_Sub);
227   }
228   virtual int Opcode() const;

279   virtual int Opcode() const;
280   virtual const Type *sub( const Type *, const Type * ) const { ShouldNotReachHere(); return NULL; }
281   const Type* Value(PhaseGVN* phase) const;
282   virtual Node  *Ideal(PhaseGVN *phase, bool can_reshape);
283 };
284 
285 //------------------------------CmpD3Node--------------------------------------
286 // Compare 2 double values, returning integer value (-1, 0 or 1).
287 // This implements the Java bytecode dcmpl, so unordered returns -1.
288 // Operands may not commute.
289 class CmpD3Node : public CmpDNode {
290 public:
291   CmpD3Node( Node *in1, Node *in2 ) : CmpDNode(in1,in2) {
292     // Since it is not consumed by Bools, it is not really a Cmp.
293     init_class_id(Class_Sub);
294   }
295   virtual int Opcode() const;
296   virtual uint ideal_reg() const { return Op_RegI; }
297 };
298 




















299 
300 //------------------------------BoolTest---------------------------------------
301 // Convert condition codes to a boolean test value (0 or -1).
302 // We pick the values as 3 bits; the low order 2 bits we compare against the
303 // condition codes, the high bit flips the sense of the result.
304 // For vector compares, additionally, the 4th bit indicates if the compare is unsigned
305 struct BoolTest {
306   enum mask { eq = 0, ne = 4, le = 5, ge = 7, lt = 3, gt = 1, overflow = 2, no_overflow = 6, never = 8, illegal = 9,
307               // The following values are used with vector compares
308               // A BoolTest value should not be constructed for such values
309               unsigned_compare = 16,
310               ule = unsigned_compare | le, uge = unsigned_compare | ge, ult = unsigned_compare | lt, ugt = unsigned_compare | gt };
311   mask _test;
312   BoolTest( mask btm ) : _test(btm) { assert((btm & unsigned_compare) == 0, "unsupported");}
313   const Type *cc2logical( const Type *CC ) const;
314   // Commute the test.  I use a small table lookup.  The table is created as
315   // a simple char array where each element is the ASCII version of a 'mask'
316   // enum from above.
317   mask commute( ) const { return mask("032147658"[_test]-'0'); }
318   mask negate( ) const { return mask(_test^4); }

187   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
188   virtual const Type *sub( const Type *, const Type * ) const;
189 };
190 
191 //------------------------------CmpNNode--------------------------------------
192 // Compare 2 narrow oop values, returning condition codes (-1, 0 or 1).
193 class CmpNNode : public CmpNode {
194 public:
195   CmpNNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
196   virtual int Opcode() const;
197   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
198   virtual const Type *sub( const Type *, const Type * ) const;
199 };
200 
201 //------------------------------CmpLNode---------------------------------------
202 // Compare 2 long values, returning condition codes (-1, 0 or 1).
203 class CmpLNode : public CmpNode {
204 public:
205   CmpLNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
206   virtual int    Opcode() const;
207   virtual Node* Ideal(PhaseGVN* phase, bool can_reshape);
208   virtual const Type* Value(PhaseGVN* phase) const;
209   virtual const Type *sub( const Type *, const Type * ) const;
210   bool is_double_null_check(PhaseGVN* phase, Node*& a, Node*& b) const;
211 };
212 
213 //------------------------------CmpULNode---------------------------------------
214 // Compare 2 unsigned long values, returning condition codes (-1, 0 or 1).
215 class CmpULNode : public CmpNode {
216 public:
217   CmpULNode(Node* in1, Node* in2) : CmpNode(in1, in2) { }
218   virtual int Opcode() const;
219   virtual const Type* sub(const Type*, const Type*) const;
220 };
221 
222 //------------------------------CmpL3Node--------------------------------------
223 // Compare 2 long values, returning integer value (-1, 0 or 1).
224 class CmpL3Node : public CmpLNode {
225 public:
226   CmpL3Node( Node *in1, Node *in2 ) : CmpLNode(in1,in2) {
227     // Since it is not consumed by Bools, it is not really a Cmp.
228     init_class_id(Class_Sub);
229   }
230   virtual int Opcode() const;

281   virtual int Opcode() const;
282   virtual const Type *sub( const Type *, const Type * ) const { ShouldNotReachHere(); return NULL; }
283   const Type* Value(PhaseGVN* phase) const;
284   virtual Node  *Ideal(PhaseGVN *phase, bool can_reshape);
285 };
286 
287 //------------------------------CmpD3Node--------------------------------------
288 // Compare 2 double values, returning integer value (-1, 0 or 1).
289 // This implements the Java bytecode dcmpl, so unordered returns -1.
290 // Operands may not commute.
291 class CmpD3Node : public CmpDNode {
292 public:
293   CmpD3Node( Node *in1, Node *in2 ) : CmpDNode(in1,in2) {
294     // Since it is not consumed by Bools, it is not really a Cmp.
295     init_class_id(Class_Sub);
296   }
297   virtual int Opcode() const;
298   virtual uint ideal_reg() const { return Op_RegI; }
299 };
300 
301 //--------------------------FlatArrayCheckNode---------------------------------
302 // Returns true if one of the input array objects or array klass ptrs (there
303 // can be multiple) is flat.
304 class FlatArrayCheckNode : public CmpNode {
305 public:
306   enum {
307     Control,
308     Memory,
309     ArrayOrKlass
310   };
311   FlatArrayCheckNode(Compile* C, Node* mem, Node* array_or_klass) : CmpNode(mem, array_or_klass) {
312     init_class_id(Class_FlatArrayCheck);
313     init_flags(Flag_is_macro);
314     C->add_macro_node(this);
315   }
316   virtual int Opcode() const;
317   virtual const Type* sub(const Type*, const Type*) const { ShouldNotReachHere(); return NULL; }
318   const Type* Value(PhaseGVN* phase) const;
319   virtual Node* Ideal(PhaseGVN* phase, bool can_reshape);
320 };
321 
322 //------------------------------BoolTest---------------------------------------
323 // Convert condition codes to a boolean test value (0 or -1).
324 // We pick the values as 3 bits; the low order 2 bits we compare against the
325 // condition codes, the high bit flips the sense of the result.
326 // For vector compares, additionally, the 4th bit indicates if the compare is unsigned
327 struct BoolTest {
328   enum mask { eq = 0, ne = 4, le = 5, ge = 7, lt = 3, gt = 1, overflow = 2, no_overflow = 6, never = 8, illegal = 9,
329               // The following values are used with vector compares
330               // A BoolTest value should not be constructed for such values
331               unsigned_compare = 16,
332               ule = unsigned_compare | le, uge = unsigned_compare | ge, ult = unsigned_compare | lt, ugt = unsigned_compare | gt };
333   mask _test;
334   BoolTest( mask btm ) : _test(btm) { assert((btm & unsigned_compare) == 0, "unsupported");}
335   const Type *cc2logical( const Type *CC ) const;
336   // Commute the test.  I use a small table lookup.  The table is created as
337   // a simple char array where each element is the ASCII version of a 'mask'
338   // enum from above.
339   mask commute( ) const { return mask("032147658"[_test]-'0'); }
340   mask negate( ) const { return mask(_test^4); }
< prev index next >