< prev index next >

src/share/vm/opto/convertnode.hpp

Print this page




  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_OPTO_CONVERTNODE_HPP
  26 #define SHARE_VM_OPTO_CONVERTNODE_HPP
  27 
  28 #include "opto/node.hpp"
  29 #include "opto/opcodes.hpp"
  30 
  31 
  32 //------------------------------Conv2BNode-------------------------------------
  33 // Convert int/pointer to a Boolean.  Map zero to zero, all else to 1.
  34 class Conv2BNode : public Node {
  35   public:
  36   Conv2BNode( Node *i ) : Node(0,i) {}
  37   virtual int Opcode() const;
  38   virtual const Type *bottom_type() const { return TypeInt::BOOL; }
  39   virtual Node* Identity(PhaseGVN* phase);
  40   virtual const Type* Value(PhaseGVN* phase) const;
  41   virtual uint  ideal_reg() const { return Op_RegI; }
  42 };
  43 
  44 // The conversions operations are all Alpha sorted.  Please keep it that way!
  45 //------------------------------ConvD2FNode------------------------------------
  46 // Convert double to float
  47 class ConvD2FNode : public Node {
  48   public:
  49   ConvD2FNode( Node *in1 ) : Node(0,in1) {}
  50   virtual int Opcode() const;
  51   virtual const Type *bottom_type() const { return Type::FLOAT; }
  52   virtual const Type* Value(PhaseGVN* phase) const;
  53   virtual Node* Identity(PhaseGVN* phase);
  54   virtual uint  ideal_reg() const { return Op_RegF; }
  55 };
  56 
  57 //------------------------------ConvD2INode------------------------------------
  58 // Convert Double to Integer
  59 class ConvD2INode : public Node {
  60   public:
  61   ConvD2INode( Node *in1 ) : Node(0,in1) {}
  62   virtual int Opcode() const;
  63   virtual const Type *bottom_type() const { return TypeInt::INT; }
  64   virtual const Type* Value(PhaseGVN* phase) const;
  65   virtual Node* Identity(PhaseGVN* phase);
  66   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
  67   virtual uint  ideal_reg() const { return Op_RegI; }
  68 };
  69 
  70 //------------------------------ConvD2LNode------------------------------------
  71 // Convert Double to Long
  72 class ConvD2LNode : public Node {
  73   public:
  74   ConvD2LNode( Node *dbl ) : Node(0,dbl) {}
  75   virtual int Opcode() const;
  76   virtual const Type *bottom_type() const { return TypeLong::LONG; }
  77   virtual const Type* Value(PhaseGVN* phase) const;
  78   virtual Node* Identity(PhaseGVN* phase);
  79   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
  80   virtual uint ideal_reg() const { return Op_RegL; }
  81 };
  82 
  83 //------------------------------ConvF2DNode------------------------------------
  84 // Convert Float to a Double.
  85 class ConvF2DNode : public Node {
  86   public:
  87   ConvF2DNode( Node *in1 ) : Node(0,in1) {}
  88   virtual int Opcode() const;
  89   virtual const Type *bottom_type() const { return Type::DOUBLE; }
  90   virtual const Type* Value(PhaseGVN* phase) const;
  91   virtual uint  ideal_reg() const { return Op_RegD; }
  92 };
  93 
  94 //------------------------------ConvF2INode------------------------------------
  95 // Convert float to integer
  96 class ConvF2INode : public Node {
  97   public:
  98   ConvF2INode( Node *in1 ) : Node(0,in1) {}
  99   virtual int Opcode() const;
 100   virtual const Type *bottom_type() const { return TypeInt::INT; }
 101   virtual const Type* Value(PhaseGVN* phase) const;
 102   virtual Node* Identity(PhaseGVN* phase);
 103   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
 104   virtual uint  ideal_reg() const { return Op_RegI; }
 105 };
 106 
 107 //------------------------------ConvF2LNode------------------------------------
 108 // Convert float to long
 109 class ConvF2LNode : public Node {
 110   public:
 111   ConvF2LNode( Node *in1 ) : Node(0,in1) {}
 112   virtual int Opcode() const;
 113   virtual const Type *bottom_type() const { return TypeLong::LONG; }
 114   virtual const Type* Value(PhaseGVN* phase) const;
 115   virtual Node* Identity(PhaseGVN* phase);
 116   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
 117   virtual uint  ideal_reg() const { return Op_RegL; }
 118 };
 119 
 120 //------------------------------ConvI2DNode------------------------------------
 121 // Convert Integer to Double
 122 class ConvI2DNode : public Node {
 123   public:
 124   ConvI2DNode( Node *in1 ) : Node(0,in1) {}
 125   virtual int Opcode() const;
 126   virtual const Type *bottom_type() const { return Type::DOUBLE; }
 127   virtual const Type* Value(PhaseGVN* phase) const;
 128   virtual uint  ideal_reg() const { return Op_RegD; }
 129 };
 130 
 131 //------------------------------ConvI2FNode------------------------------------
 132 // Convert Integer to Float
 133 class ConvI2FNode : public Node {
 134   public:
 135   ConvI2FNode( Node *in1 ) : Node(0,in1) {}
 136   virtual int Opcode() const;
 137   virtual const Type *bottom_type() const { return Type::FLOAT; }
 138   virtual const Type* Value(PhaseGVN* phase) const;
 139   virtual Node* Identity(PhaseGVN* phase);
 140   virtual uint  ideal_reg() const { return Op_RegF; }
 141 };
 142 
 143 //------------------------------ConvI2LNode------------------------------------
 144 // Convert integer to long
 145 class ConvI2LNode : public TypeNode {
 146   public:
 147   ConvI2LNode(Node *in1, const TypeLong* t = TypeLong::INT)
 148   : TypeNode(t, 2)
 149   { init_req(1, in1); }
 150   virtual int Opcode() const;
 151   virtual const Type* Value(PhaseGVN* phase) const;
 152   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
 153   virtual uint  ideal_reg() const { return Op_RegL; }
 154 };
 155 
 156 //------------------------------ConvL2DNode------------------------------------
 157 // Convert Long to Double
 158 class ConvL2DNode : public Node {
 159   public:
 160   ConvL2DNode( Node *in1 ) : Node(0,in1) {}
 161   virtual int Opcode() const;
 162   virtual const Type *bottom_type() const { return Type::DOUBLE; }
 163   virtual const Type* Value(PhaseGVN* phase) const;
 164   virtual uint ideal_reg() const { return Op_RegD; }
 165 };
 166 
 167 //------------------------------ConvL2FNode------------------------------------
 168 // Convert Long to Float
 169 class ConvL2FNode : public Node {
 170   public:
 171   ConvL2FNode( Node *in1 ) : Node(0,in1) {}
 172   virtual int Opcode() const;
 173   virtual const Type *bottom_type() const { return Type::FLOAT; }
 174   virtual const Type* Value(PhaseGVN* phase) const;
 175   virtual uint  ideal_reg() const { return Op_RegF; }
 176 };
 177 
 178 //------------------------------ConvL2INode------------------------------------
 179 // Convert long to integer
 180 class ConvL2INode : public Node {
 181   public:
 182   ConvL2INode( Node *in1 ) : Node(0,in1) {}
 183   virtual int Opcode() const;
 184   virtual const Type *bottom_type() const { return TypeInt::INT; }
 185   virtual Node* Identity(PhaseGVN* phase);
 186   virtual const Type* Value(PhaseGVN* phase) const;
 187   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
 188   virtual uint  ideal_reg() const { return Op_RegI; }
 189 };
 190 
 191 //-----------------------------RoundFloatNode----------------------------------
 192 class RoundFloatNode: public Node {
 193   public:
 194   RoundFloatNode(Node* c, Node *in1): Node(c, in1) {}
 195   virtual int   Opcode() const;
 196   virtual const Type *bottom_type() const { return Type::FLOAT; }
 197   virtual uint  ideal_reg() const { return Op_RegF; }
 198   virtual Node* Identity(PhaseGVN* phase);
 199   virtual const Type* Value(PhaseGVN* phase) const;
 200 };
 201 
 202 
 203 //-----------------------------RoundDoubleNode---------------------------------
 204 class RoundDoubleNode: public Node {
 205   public:
 206   RoundDoubleNode(Node* c, Node *in1): Node(c, in1) {}
 207   virtual int   Opcode() const;
 208   virtual const Type *bottom_type() const { return Type::DOUBLE; }
 209   virtual uint  ideal_reg() const { return Op_RegD; }
 210   virtual Node* Identity(PhaseGVN* phase);
 211   virtual const Type* Value(PhaseGVN* phase) const;
 212 };
 213 
 214 
 215 #endif // SHARE_VM_OPTO_CONVERTNODE_HPP


  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_OPTO_CONVERTNODE_HPP
  26 #define SHARE_VM_OPTO_CONVERTNODE_HPP
  27 
  28 #include "opto/node.hpp"
  29 #include "opto/opcodes.hpp"
  30 
  31 
  32 //------------------------------Conv2BNode-------------------------------------
  33 // Convert int/pointer to a Boolean.  Map zero to zero, all else to 1.
  34 class Conv2BNode : public Node {
  35   public:
  36   Conv2BNode( Node *i ) : Node(0,i) {}
  37   virtual Opcodes Opcode() const;
  38   virtual const Type *bottom_type() const { return TypeInt::BOOL; }
  39   virtual Node* Identity(PhaseGVN* phase);
  40   virtual const Type* Value(PhaseGVN* phase) const;
  41   virtual Opcodes ideal_reg() const { return Opcodes::Op_RegI; }
  42 };
  43 
  44 // The conversions operations are all Alpha sorted.  Please keep it that way!
  45 //------------------------------ConvD2FNode------------------------------------
  46 // Convert double to float
  47 class ConvD2FNode : public Node {
  48   public:
  49   ConvD2FNode( Node *in1 ) : Node(0,in1) {}
  50   virtual Opcodes Opcode() const;
  51   virtual const Type *bottom_type() const { return Type::FLOAT; }
  52   virtual const Type* Value(PhaseGVN* phase) const;
  53   virtual Node* Identity(PhaseGVN* phase);
  54   virtual Opcodes ideal_reg() const { return Opcodes::Op_RegF; }
  55 };
  56 
  57 //------------------------------ConvD2INode------------------------------------
  58 // Convert Double to Integer
  59 class ConvD2INode : public Node {
  60   public:
  61   ConvD2INode( Node *in1 ) : Node(0,in1) {}
  62   virtual Opcodes Opcode() const;
  63   virtual const Type *bottom_type() const { return TypeInt::INT; }
  64   virtual const Type* Value(PhaseGVN* phase) const;
  65   virtual Node* Identity(PhaseGVN* phase);
  66   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
  67   virtual Opcodes ideal_reg() const { return Opcodes::Op_RegI; }
  68 };
  69 
  70 //------------------------------ConvD2LNode------------------------------------
  71 // Convert Double to Long
  72 class ConvD2LNode : public Node {
  73   public:
  74   ConvD2LNode( Node *dbl ) : Node(0,dbl) {}
  75   virtual Opcodes Opcode() const;
  76   virtual const Type *bottom_type() const { return TypeLong::LONG; }
  77   virtual const Type* Value(PhaseGVN* phase) const;
  78   virtual Node* Identity(PhaseGVN* phase);
  79   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
  80   virtual Opcodes ideal_reg() const { return Opcodes::Op_RegL; }
  81 };
  82 
  83 //------------------------------ConvF2DNode------------------------------------
  84 // Convert Float to a Double.
  85 class ConvF2DNode : public Node {
  86   public:
  87   ConvF2DNode( Node *in1 ) : Node(0,in1) {}
  88   virtual Opcodes Opcode() const;
  89   virtual const Type *bottom_type() const { return Type::DOUBLE; }
  90   virtual const Type* Value(PhaseGVN* phase) const;
  91   virtual Opcodes ideal_reg() const { return Opcodes::Op_RegD; }
  92 };
  93 
  94 //------------------------------ConvF2INode------------------------------------
  95 // Convert float to integer
  96 class ConvF2INode : public Node {
  97   public:
  98   ConvF2INode( Node *in1 ) : Node(0,in1) {}
  99   virtual Opcodes Opcode() const;
 100   virtual const Type *bottom_type() const { return TypeInt::INT; }
 101   virtual const Type* Value(PhaseGVN* phase) const;
 102   virtual Node* Identity(PhaseGVN* phase);
 103   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
 104   virtual Opcodes ideal_reg() const { return Opcodes::Op_RegI; }
 105 };
 106 
 107 //------------------------------ConvF2LNode------------------------------------
 108 // Convert float to long
 109 class ConvF2LNode : public Node {
 110   public:
 111   ConvF2LNode( Node *in1 ) : Node(0,in1) {}
 112   virtual Opcodes Opcode() const;
 113   virtual const Type *bottom_type() const { return TypeLong::LONG; }
 114   virtual const Type* Value(PhaseGVN* phase) const;
 115   virtual Node* Identity(PhaseGVN* phase);
 116   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
 117   virtual Opcodes ideal_reg() const { return Opcodes::Op_RegL; }
 118 };
 119 
 120 //------------------------------ConvI2DNode------------------------------------
 121 // Convert Integer to Double
 122 class ConvI2DNode : public Node {
 123   public:
 124   ConvI2DNode( Node *in1 ) : Node(0,in1) {}
 125   virtual Opcodes Opcode() const;
 126   virtual const Type *bottom_type() const { return Type::DOUBLE; }
 127   virtual const Type* Value(PhaseGVN* phase) const;
 128   virtual Opcodes ideal_reg() const { return Opcodes::Op_RegD; }
 129 };
 130 
 131 //------------------------------ConvI2FNode------------------------------------
 132 // Convert Integer to Float
 133 class ConvI2FNode : public Node {
 134   public:
 135   ConvI2FNode( Node *in1 ) : Node(0,in1) {}
 136   virtual Opcodes Opcode() const;
 137   virtual const Type *bottom_type() const { return Type::FLOAT; }
 138   virtual const Type* Value(PhaseGVN* phase) const;
 139   virtual Node* Identity(PhaseGVN* phase);
 140   virtual Opcodes ideal_reg() const { return Opcodes::Op_RegF; }
 141 };
 142 
 143 //------------------------------ConvI2LNode------------------------------------
 144 // Convert integer to long
 145 class ConvI2LNode : public TypeNode {
 146   public:
 147   ConvI2LNode(Node *in1, const TypeLong* t = TypeLong::INT)
 148   : TypeNode(t, 2)
 149   { init_req(1, in1); }
 150   virtual Opcodes Opcode() const;
 151   virtual const Type* Value(PhaseGVN* phase) const;
 152   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
 153   virtual Opcodes ideal_reg() const { return Opcodes::Op_RegL; }
 154 };
 155 
 156 //------------------------------ConvL2DNode------------------------------------
 157 // Convert Long to Double
 158 class ConvL2DNode : public Node {
 159   public:
 160   ConvL2DNode( Node *in1 ) : Node(0,in1) {}
 161   virtual Opcodes Opcode() const;
 162   virtual const Type *bottom_type() const { return Type::DOUBLE; }
 163   virtual const Type* Value(PhaseGVN* phase) const;
 164   virtual Opcodes ideal_reg() const { return Opcodes::Op_RegD; }
 165 };
 166 
 167 //------------------------------ConvL2FNode------------------------------------
 168 // Convert Long to Float
 169 class ConvL2FNode : public Node {
 170   public:
 171   ConvL2FNode( Node *in1 ) : Node(0,in1) {}
 172   virtual Opcodes Opcode() const;
 173   virtual const Type *bottom_type() const { return Type::FLOAT; }
 174   virtual const Type* Value(PhaseGVN* phase) const;
 175   virtual Opcodes ideal_reg() const { return Opcodes::Op_RegF; }
 176 };
 177 
 178 //------------------------------ConvL2INode------------------------------------
 179 // Convert long to integer
 180 class ConvL2INode : public Node {
 181   public:
 182   ConvL2INode( Node *in1 ) : Node(0,in1) {}
 183   virtual Opcodes Opcode() const;
 184   virtual const Type *bottom_type() const { return TypeInt::INT; }
 185   virtual Node* Identity(PhaseGVN* phase);
 186   virtual const Type* Value(PhaseGVN* phase) const;
 187   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
 188   virtual Opcodes ideal_reg() const { return Opcodes::Op_RegI; }
 189 };
 190 
 191 //-----------------------------RoundFloatNode----------------------------------
 192 class RoundFloatNode: public Node {
 193   public:
 194   RoundFloatNode(Node* c, Node *in1): Node(c, in1) {}
 195   virtual Opcodes  Opcode() const;
 196   virtual const Type *bottom_type() const { return Type::FLOAT; }
 197   virtual Opcodes ideal_reg() const { return Opcodes::Op_RegF; }
 198   virtual Node* Identity(PhaseGVN* phase);
 199   virtual const Type* Value(PhaseGVN* phase) const;
 200 };
 201 
 202 
 203 //-----------------------------RoundDoubleNode---------------------------------
 204 class RoundDoubleNode: public Node {
 205   public:
 206   RoundDoubleNode(Node* c, Node *in1): Node(c, in1) {}
 207   virtual Opcodes  Opcode() const;
 208   virtual const Type *bottom_type() const { return Type::DOUBLE; }
 209   virtual Opcodes ideal_reg() const { return Opcodes::Op_RegD; }
 210   virtual Node* Identity(PhaseGVN* phase);
 211   virtual const Type* Value(PhaseGVN* phase) const;
 212 };
 213 
 214 
 215 #endif // SHARE_VM_OPTO_CONVERTNODE_HPP
< prev index next >