< prev index next >

src/hotspot/share/opto/subnode.hpp

Print this page




 262 
 263 //------------------------------CmpD3Node--------------------------------------
 264 // Compare 2 double values, returning integer value (-1, 0 or 1).
 265 // This implements the Java bytecode dcmpl, so unordered returns -1.
 266 // Operands may not commute.
 267 class CmpD3Node : public CmpDNode {
 268 public:
 269   CmpD3Node( Node *in1, Node *in2 ) : CmpDNode(in1,in2) {
 270     // Since it is not consumed by Bools, it is not really a Cmp.
 271     init_class_id(Class_Sub);
 272   }
 273   virtual int Opcode() const;
 274   virtual uint ideal_reg() const { return Op_RegI; }
 275 };
 276 
 277 
 278 //------------------------------BoolTest---------------------------------------
 279 // Convert condition codes to a boolean test value (0 or -1).
 280 // We pick the values as 3 bits; the low order 2 bits we compare against the
 281 // condition codes, the high bit flips the sense of the result.
 282 struct BoolTest VALUE_OBJ_CLASS_SPEC {
 283   enum mask { eq = 0, ne = 4, le = 5, ge = 7, lt = 3, gt = 1, overflow = 2, no_overflow = 6, illegal = 8 };
 284   mask _test;
 285   BoolTest( mask btm ) : _test(btm) {}
 286   const Type *cc2logical( const Type *CC ) const;
 287   // Commute the test.  I use a small table lookup.  The table is created as
 288   // a simple char array where each element is the ASCII version of a 'mask'
 289   // enum from above.
 290   mask commute( ) const { return mask("032147658"[_test]-'0'); }
 291   mask negate( ) const { return mask(_test^4); }
 292   bool is_canonical( ) const { return (_test == BoolTest::ne || _test == BoolTest::lt || _test == BoolTest::le || _test == BoolTest::overflow); }
 293   bool is_less( )  const { return _test == BoolTest::lt || _test == BoolTest::le; }
 294   bool is_greater( ) const { return _test == BoolTest::gt || _test == BoolTest::ge; }
 295   void dump_on(outputStream *st) const;
 296 };
 297 
 298 //------------------------------BoolNode---------------------------------------
 299 // A Node to convert a Condition Codes to a Logical result.
 300 class BoolNode : public Node {
 301   virtual uint hash() const;
 302   virtual uint cmp( const Node &n ) const;




 262 
 263 //------------------------------CmpD3Node--------------------------------------
 264 // Compare 2 double values, returning integer value (-1, 0 or 1).
 265 // This implements the Java bytecode dcmpl, so unordered returns -1.
 266 // Operands may not commute.
 267 class CmpD3Node : public CmpDNode {
 268 public:
 269   CmpD3Node( Node *in1, Node *in2 ) : CmpDNode(in1,in2) {
 270     // Since it is not consumed by Bools, it is not really a Cmp.
 271     init_class_id(Class_Sub);
 272   }
 273   virtual int Opcode() const;
 274   virtual uint ideal_reg() const { return Op_RegI; }
 275 };
 276 
 277 
 278 //------------------------------BoolTest---------------------------------------
 279 // Convert condition codes to a boolean test value (0 or -1).
 280 // We pick the values as 3 bits; the low order 2 bits we compare against the
 281 // condition codes, the high bit flips the sense of the result.
 282 struct BoolTest {
 283   enum mask { eq = 0, ne = 4, le = 5, ge = 7, lt = 3, gt = 1, overflow = 2, no_overflow = 6, illegal = 8 };
 284   mask _test;
 285   BoolTest( mask btm ) : _test(btm) {}
 286   const Type *cc2logical( const Type *CC ) const;
 287   // Commute the test.  I use a small table lookup.  The table is created as
 288   // a simple char array where each element is the ASCII version of a 'mask'
 289   // enum from above.
 290   mask commute( ) const { return mask("032147658"[_test]-'0'); }
 291   mask negate( ) const { return mask(_test^4); }
 292   bool is_canonical( ) const { return (_test == BoolTest::ne || _test == BoolTest::lt || _test == BoolTest::le || _test == BoolTest::overflow); }
 293   bool is_less( )  const { return _test == BoolTest::lt || _test == BoolTest::le; }
 294   bool is_greater( ) const { return _test == BoolTest::gt || _test == BoolTest::ge; }
 295   void dump_on(outputStream *st) const;
 296 };
 297 
 298 //------------------------------BoolNode---------------------------------------
 299 // A Node to convert a Condition Codes to a Logical result.
 300 class BoolNode : public Node {
 301   virtual uint hash() const;
 302   virtual uint cmp( const Node &n ) const;


< prev index next >