< prev index next >

src/share/vm/opto/mulnode.hpp

Print this page

        

*** 68,266 **** // Supplied function to return the additive identity type virtual const Type *add_id() const = 0; // Supplied function to return the additive opcode ! virtual int add_opcode() const = 0; // Supplied function to return the multiplicative opcode ! virtual int mul_opcode() const = 0; }; //------------------------------MulINode--------------------------------------- // Multiply 2 integers class MulINode : public MulNode { public: MulINode( Node *in1, Node *in2 ) : MulNode(in1,in2) {} ! virtual int Opcode() const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type *mul_ring( const Type *, const Type * ) const; const Type *mul_id() const { return TypeInt::ONE; } const Type *add_id() const { return TypeInt::ZERO; } ! int add_opcode() const { return Op_AddI; } ! int mul_opcode() const { return Op_MulI; } const Type *bottom_type() const { return TypeInt::INT; } ! virtual uint ideal_reg() const { return Op_RegI; } }; //------------------------------MulLNode--------------------------------------- // Multiply 2 longs class MulLNode : public MulNode { public: MulLNode( Node *in1, Node *in2 ) : MulNode(in1,in2) {} ! virtual int Opcode() const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type *mul_ring( const Type *, const Type * ) const; const Type *mul_id() const { return TypeLong::ONE; } const Type *add_id() const { return TypeLong::ZERO; } ! int add_opcode() const { return Op_AddL; } ! int mul_opcode() const { return Op_MulL; } const Type *bottom_type() const { return TypeLong::LONG; } ! virtual uint ideal_reg() const { return Op_RegL; } }; //------------------------------MulFNode--------------------------------------- // Multiply 2 floats class MulFNode : public MulNode { public: MulFNode( Node *in1, Node *in2 ) : MulNode(in1,in2) {} ! virtual int Opcode() const; virtual const Type *mul_ring( const Type *, const Type * ) const; const Type *mul_id() const { return TypeF::ONE; } const Type *add_id() const { return TypeF::ZERO; } ! int add_opcode() const { return Op_AddF; } ! int mul_opcode() const { return Op_MulF; } const Type *bottom_type() const { return Type::FLOAT; } ! virtual uint ideal_reg() const { return Op_RegF; } }; //------------------------------MulDNode--------------------------------------- // Multiply 2 doubles class MulDNode : public MulNode { public: MulDNode( Node *in1, Node *in2 ) : MulNode(in1,in2) {} ! virtual int Opcode() const; virtual const Type *mul_ring( const Type *, const Type * ) const; const Type *mul_id() const { return TypeD::ONE; } const Type *add_id() const { return TypeD::ZERO; } ! int add_opcode() const { return Op_AddD; } ! int mul_opcode() const { return Op_MulD; } const Type *bottom_type() const { return Type::DOUBLE; } ! virtual uint ideal_reg() const { return Op_RegD; } }; //-------------------------------MulHiLNode------------------------------------ // Upper 64 bits of a 64 bit by 64 bit multiply class MulHiLNode : public Node { public: MulHiLNode( Node *in1, Node *in2 ) : Node(0,in1,in2) {} ! virtual int Opcode() const; virtual const Type* Value(PhaseGVN* phase) const; const Type *bottom_type() const { return TypeLong::LONG; } ! virtual uint ideal_reg() const { return Op_RegL; } }; //------------------------------AndINode--------------------------------------- // Logically AND 2 integers. Included with the MUL nodes because it inherits // all the behavior of multiplication on a ring. class AndINode : public MulINode { public: AndINode( Node *in1, Node *in2 ) : MulINode(in1,in2) {} ! virtual int Opcode() const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual Node* Identity(PhaseGVN* phase); virtual const Type *mul_ring( const Type *, const Type * ) const; const Type *mul_id() const { return TypeInt::MINUS_1; } const Type *add_id() const { return TypeInt::ZERO; } ! int add_opcode() const { return Op_OrI; } ! int mul_opcode() const { return Op_AndI; } ! virtual uint ideal_reg() const { return Op_RegI; } }; //------------------------------AndINode--------------------------------------- // Logically AND 2 longs. Included with the MUL nodes because it inherits // all the behavior of multiplication on a ring. class AndLNode : public MulLNode { public: AndLNode( Node *in1, Node *in2 ) : MulLNode(in1,in2) {} ! virtual int Opcode() const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual Node* Identity(PhaseGVN* phase); virtual const Type *mul_ring( const Type *, const Type * ) const; const Type *mul_id() const { return TypeLong::MINUS_1; } const Type *add_id() const { return TypeLong::ZERO; } ! int add_opcode() const { return Op_OrL; } ! int mul_opcode() const { return Op_AndL; } ! virtual uint ideal_reg() const { return Op_RegL; } }; //------------------------------LShiftINode------------------------------------ // Logical shift left class LShiftINode : public Node { public: LShiftINode( Node *in1, Node *in2 ) : Node(0,in1,in2) {} ! virtual int Opcode() const; virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type* Value(PhaseGVN* phase) const; const Type *bottom_type() const { return TypeInt::INT; } ! virtual uint ideal_reg() const { return Op_RegI; } }; //------------------------------LShiftLNode------------------------------------ // Logical shift left class LShiftLNode : public Node { public: LShiftLNode( Node *in1, Node *in2 ) : Node(0,in1,in2) {} ! virtual int Opcode() const; virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type* Value(PhaseGVN* phase) const; const Type *bottom_type() const { return TypeLong::LONG; } ! virtual uint ideal_reg() const { return Op_RegL; } }; //------------------------------RShiftINode------------------------------------ // Signed shift right class RShiftINode : public Node { public: RShiftINode( Node *in1, Node *in2 ) : Node(0,in1,in2) {} ! virtual int Opcode() const; virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type* Value(PhaseGVN* phase) const; const Type *bottom_type() const { return TypeInt::INT; } ! virtual uint ideal_reg() const { return Op_RegI; } }; //------------------------------RShiftLNode------------------------------------ // Signed shift right class RShiftLNode : public Node { public: RShiftLNode( Node *in1, Node *in2 ) : Node(0,in1,in2) {} ! virtual int Opcode() const; virtual Node* Identity(PhaseGVN* phase); virtual const Type* Value(PhaseGVN* phase) const; const Type *bottom_type() const { return TypeLong::LONG; } ! virtual uint ideal_reg() const { return Op_RegL; } }; //------------------------------URShiftINode----------------------------------- // Logical shift right class URShiftINode : public Node { public: URShiftINode( Node *in1, Node *in2 ) : Node(0,in1,in2) {} ! virtual int Opcode() const; virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type* Value(PhaseGVN* phase) const; const Type *bottom_type() const { return TypeInt::INT; } ! virtual uint ideal_reg() const { return Op_RegI; } }; //------------------------------URShiftLNode----------------------------------- // Logical shift right class URShiftLNode : public Node { public: URShiftLNode( Node *in1, Node *in2 ) : Node(0,in1,in2) {} ! virtual int Opcode() const; virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type* Value(PhaseGVN* phase) const; const Type *bottom_type() const { return TypeLong::LONG; } ! virtual uint ideal_reg() const { return Op_RegL; } }; #endif // SHARE_VM_OPTO_MULNODE_HPP --- 68,266 ---- // Supplied function to return the additive identity type virtual const Type *add_id() const = 0; // Supplied function to return the additive opcode ! virtual Opcodes add_opcode() const = 0; // Supplied function to return the multiplicative opcode ! virtual Opcodes mul_opcode() const = 0; }; //------------------------------MulINode--------------------------------------- // Multiply 2 integers class MulINode : public MulNode { public: MulINode( Node *in1, Node *in2 ) : MulNode(in1,in2) {} ! virtual Opcodes Opcode() const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type *mul_ring( const Type *, const Type * ) const; const Type *mul_id() const { return TypeInt::ONE; } const Type *add_id() const { return TypeInt::ZERO; } ! Opcodes add_opcode() const { return Opcodes::Op_AddI; } ! Opcodes mul_opcode() const { return Opcodes::Op_MulI; } const Type *bottom_type() const { return TypeInt::INT; } ! virtual Opcodes ideal_reg() const { return Opcodes::Op_RegI; } }; //------------------------------MulLNode--------------------------------------- // Multiply 2 longs class MulLNode : public MulNode { public: MulLNode( Node *in1, Node *in2 ) : MulNode(in1,in2) {} ! virtual Opcodes Opcode() const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type *mul_ring( const Type *, const Type * ) const; const Type *mul_id() const { return TypeLong::ONE; } const Type *add_id() const { return TypeLong::ZERO; } ! Opcodes add_opcode() const { return Opcodes::Op_AddL; } ! Opcodes mul_opcode() const { return Opcodes::Op_MulL; } const Type *bottom_type() const { return TypeLong::LONG; } ! virtual Opcodes ideal_reg() const { return Opcodes::Op_RegL; } }; //------------------------------MulFNode--------------------------------------- // Multiply 2 floats class MulFNode : public MulNode { public: MulFNode( Node *in1, Node *in2 ) : MulNode(in1,in2) {} ! virtual Opcodes Opcode() const; virtual const Type *mul_ring( const Type *, const Type * ) const; const Type *mul_id() const { return TypeF::ONE; } const Type *add_id() const { return TypeF::ZERO; } ! Opcodes add_opcode() const { return Opcodes::Op_AddF; } ! Opcodes mul_opcode() const { return Opcodes::Op_MulF; } const Type *bottom_type() const { return Type::FLOAT; } ! virtual Opcodes ideal_reg() const { return Opcodes::Op_RegF; } }; //------------------------------MulDNode--------------------------------------- // Multiply 2 doubles class MulDNode : public MulNode { public: MulDNode( Node *in1, Node *in2 ) : MulNode(in1,in2) {} ! virtual Opcodes Opcode() const; virtual const Type *mul_ring( const Type *, const Type * ) const; const Type *mul_id() const { return TypeD::ONE; } const Type *add_id() const { return TypeD::ZERO; } ! Opcodes add_opcode() const { return Opcodes::Op_AddD; } ! Opcodes mul_opcode() const { return Opcodes::Op_MulD; } const Type *bottom_type() const { return Type::DOUBLE; } ! virtual Opcodes ideal_reg() const { return Opcodes::Op_RegD; } }; //-------------------------------MulHiLNode------------------------------------ // Upper 64 bits of a 64 bit by 64 bit multiply class MulHiLNode : public Node { public: MulHiLNode( Node *in1, Node *in2 ) : Node(0,in1,in2) {} ! virtual Opcodes Opcode() const; virtual const Type* Value(PhaseGVN* phase) const; const Type *bottom_type() const { return TypeLong::LONG; } ! virtual Opcodes ideal_reg() const { return Opcodes::Op_RegL; } }; //------------------------------AndINode--------------------------------------- // Logically AND 2 integers. Included with the MUL nodes because it inherits // all the behavior of multiplication on a ring. class AndINode : public MulINode { public: AndINode( Node *in1, Node *in2 ) : MulINode(in1,in2) {} ! virtual Opcodes Opcode() const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual Node* Identity(PhaseGVN* phase); virtual const Type *mul_ring( const Type *, const Type * ) const; const Type *mul_id() const { return TypeInt::MINUS_1; } const Type *add_id() const { return TypeInt::ZERO; } ! Opcodes add_opcode() const { return Opcodes::Op_OrI; } ! Opcodes mul_opcode() const { return Opcodes::Op_AndI; } ! virtual Opcodes ideal_reg() const { return Opcodes::Op_RegI; } }; //------------------------------AndINode--------------------------------------- // Logically AND 2 longs. Included with the MUL nodes because it inherits // all the behavior of multiplication on a ring. class AndLNode : public MulLNode { public: AndLNode( Node *in1, Node *in2 ) : MulLNode(in1,in2) {} ! virtual Opcodes Opcode() const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual Node* Identity(PhaseGVN* phase); virtual const Type *mul_ring( const Type *, const Type * ) const; const Type *mul_id() const { return TypeLong::MINUS_1; } const Type *add_id() const { return TypeLong::ZERO; } ! Opcodes add_opcode() const { return Opcodes::Op_OrL; } ! Opcodes mul_opcode() const { return Opcodes::Op_AndL; } ! virtual Opcodes ideal_reg() const { return Opcodes::Op_RegL; } }; //------------------------------LShiftINode------------------------------------ // Logical shift left class LShiftINode : public Node { public: LShiftINode( Node *in1, Node *in2 ) : Node(0,in1,in2) {} ! virtual Opcodes Opcode() const; virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type* Value(PhaseGVN* phase) const; const Type *bottom_type() const { return TypeInt::INT; } ! virtual Opcodes ideal_reg() const { return Opcodes::Op_RegI; } }; //------------------------------LShiftLNode------------------------------------ // Logical shift left class LShiftLNode : public Node { public: LShiftLNode( Node *in1, Node *in2 ) : Node(0,in1,in2) {} ! virtual Opcodes Opcode() const; virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type* Value(PhaseGVN* phase) const; const Type *bottom_type() const { return TypeLong::LONG; } ! virtual Opcodes ideal_reg() const { return Opcodes::Op_RegL; } }; //------------------------------RShiftINode------------------------------------ // Signed shift right class RShiftINode : public Node { public: RShiftINode( Node *in1, Node *in2 ) : Node(0,in1,in2) {} ! virtual Opcodes Opcode() const; virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type* Value(PhaseGVN* phase) const; const Type *bottom_type() const { return TypeInt::INT; } ! virtual Opcodes ideal_reg() const { return Opcodes::Op_RegI; } }; //------------------------------RShiftLNode------------------------------------ // Signed shift right class RShiftLNode : public Node { public: RShiftLNode( Node *in1, Node *in2 ) : Node(0,in1,in2) {} ! virtual Opcodes Opcode() const; virtual Node* Identity(PhaseGVN* phase); virtual const Type* Value(PhaseGVN* phase) const; const Type *bottom_type() const { return TypeLong::LONG; } ! virtual Opcodes ideal_reg() const { return Opcodes::Op_RegL; } }; //------------------------------URShiftINode----------------------------------- // Logical shift right class URShiftINode : public Node { public: URShiftINode( Node *in1, Node *in2 ) : Node(0,in1,in2) {} ! virtual Opcodes Opcode() const; virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type* Value(PhaseGVN* phase) const; const Type *bottom_type() const { return TypeInt::INT; } ! virtual Opcodes ideal_reg() const { return Opcodes::Op_RegI; } }; //------------------------------URShiftLNode----------------------------------- // Logical shift right class URShiftLNode : public Node { public: URShiftLNode( Node *in1, Node *in2 ) : Node(0,in1,in2) {} ! virtual Opcodes Opcode() const; virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type* Value(PhaseGVN* phase) const; const Type *bottom_type() const { return TypeLong::LONG; } ! virtual Opcodes ideal_reg() const { return Opcodes::Op_RegL; } }; #endif // SHARE_VM_OPTO_MULNODE_HPP
< prev index next >