< prev index next >
src/share/vm/opto/subnode.hpp
Print this page
*** 67,77 ****
//------------------------------SubINode---------------------------------------
// Subtract 2 integers
class SubINode : public SubNode {
public:
SubINode( Node *in1, Node *in2 ) : SubNode(in1,in2) {}
! virtual int Opcode() const;
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
virtual const Type *sub( const Type *, const Type * ) const;
const Type *add_id() const { return TypeInt::ZERO; }
const Type *bottom_type() const { return TypeInt::INT; }
virtual uint ideal_reg() const { return Op_RegI; }
--- 67,77 ----
//------------------------------SubINode---------------------------------------
// Subtract 2 integers
class SubINode : public SubNode {
public:
SubINode( Node *in1, Node *in2 ) : SubNode(in1,in2) {}
! virtual uint Opcode() const;
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
virtual const Type *sub( const Type *, const Type * ) const;
const Type *add_id() const { return TypeInt::ZERO; }
const Type *bottom_type() const { return TypeInt::INT; }
virtual uint ideal_reg() const { return Op_RegI; }
*** 80,90 ****
//------------------------------SubLNode---------------------------------------
// Subtract 2 integers
class SubLNode : public SubNode {
public:
SubLNode( Node *in1, Node *in2 ) : SubNode(in1,in2) {}
! virtual int Opcode() const;
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
virtual const Type *sub( const Type *, const Type * ) const;
const Type *add_id() const { return TypeLong::ZERO; }
const Type *bottom_type() const { return TypeLong::LONG; }
virtual uint ideal_reg() const { return Op_RegL; }
--- 80,90 ----
//------------------------------SubLNode---------------------------------------
// Subtract 2 integers
class SubLNode : public SubNode {
public:
SubLNode( Node *in1, Node *in2 ) : SubNode(in1,in2) {}
! virtual uint Opcode() const;
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
virtual const Type *sub( const Type *, const Type * ) const;
const Type *add_id() const { return TypeLong::ZERO; }
const Type *bottom_type() const { return TypeLong::LONG; }
virtual uint ideal_reg() const { return Op_RegL; }
*** 104,114 ****
//------------------------------SubFNode---------------------------------------
// Subtract 2 doubles
class SubFNode : public SubFPNode {
public:
SubFNode( Node *in1, Node *in2 ) : SubFPNode(in1,in2) {}
! virtual int Opcode() const;
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
virtual const Type *sub( const Type *, const Type * ) const;
const Type *add_id() const { return TypeF::ZERO; }
const Type *bottom_type() const { return Type::FLOAT; }
virtual uint ideal_reg() const { return Op_RegF; }
--- 104,114 ----
//------------------------------SubFNode---------------------------------------
// Subtract 2 doubles
class SubFNode : public SubFPNode {
public:
SubFNode( Node *in1, Node *in2 ) : SubFPNode(in1,in2) {}
! virtual uint Opcode() const;
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
virtual const Type *sub( const Type *, const Type * ) const;
const Type *add_id() const { return TypeF::ZERO; }
const Type *bottom_type() const { return Type::FLOAT; }
virtual uint ideal_reg() const { return Op_RegF; }
*** 118,128 ****
//------------------------------SubDNode---------------------------------------
// Subtract 2 doubles
class SubDNode : public SubFPNode {
public:
SubDNode( Node *in1, Node *in2 ) : SubFPNode(in1,in2) {}
! virtual int Opcode() const;
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
virtual const Type *sub( const Type *, const Type * ) const;
const Type *add_id() const { return TypeD::ZERO; }
const Type *bottom_type() const { return Type::DOUBLE; }
virtual uint ideal_reg() const { return Op_RegD; }
--- 118,128 ----
//------------------------------SubDNode---------------------------------------
// Subtract 2 doubles
class SubDNode : public SubFPNode {
public:
SubDNode( Node *in1, Node *in2 ) : SubFPNode(in1,in2) {}
! virtual uint Opcode() const;
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
virtual const Type *sub( const Type *, const Type * ) const;
const Type *add_id() const { return TypeD::ZERO; }
const Type *bottom_type() const { return Type::DOUBLE; }
virtual uint ideal_reg() const { return Op_RegD; }
*** 151,202 ****
//------------------------------CmpINode---------------------------------------
// Compare 2 signed values, returning condition codes (-1, 0 or 1).
class CmpINode : public CmpNode {
public:
CmpINode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
! virtual int Opcode() const;
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
virtual const Type *sub( const Type *, const Type * ) const;
};
//------------------------------CmpUNode---------------------------------------
// Compare 2 unsigned values (integer or pointer), returning condition codes (-1, 0 or 1).
class CmpUNode : public CmpNode {
public:
CmpUNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
! virtual int Opcode() const;
virtual const Type *sub( const Type *, const Type * ) const;
const Type* Value(PhaseGVN* phase) const;
bool is_index_range_check() const;
};
//------------------------------CmpPNode---------------------------------------
// Compare 2 pointer values, returning condition codes (-1, 0 or 1).
class CmpPNode : public CmpNode {
public:
CmpPNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
! virtual int Opcode() const;
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
virtual const Type *sub( const Type *, const Type * ) const;
};
//------------------------------CmpNNode--------------------------------------
// Compare 2 narrow oop values, returning condition codes (-1, 0 or 1).
class CmpNNode : public CmpNode {
public:
CmpNNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
! virtual int Opcode() const;
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
virtual const Type *sub( const Type *, const Type * ) const;
};
//------------------------------CmpLNode---------------------------------------
// Compare 2 long values, returning condition codes (-1, 0 or 1).
class CmpLNode : public CmpNode {
public:
CmpLNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
! virtual int Opcode() const;
virtual const Type *sub( const Type *, const Type * ) const;
};
//------------------------------CmpL3Node--------------------------------------
// Compare 2 long values, returning integer value (-1, 0 or 1).
--- 151,202 ----
//------------------------------CmpINode---------------------------------------
// Compare 2 signed values, returning condition codes (-1, 0 or 1).
class CmpINode : public CmpNode {
public:
CmpINode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
! virtual uint Opcode() const;
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
virtual const Type *sub( const Type *, const Type * ) const;
};
//------------------------------CmpUNode---------------------------------------
// Compare 2 unsigned values (integer or pointer), returning condition codes (-1, 0 or 1).
class CmpUNode : public CmpNode {
public:
CmpUNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
! virtual uint Opcode() const;
virtual const Type *sub( const Type *, const Type * ) const;
const Type* Value(PhaseGVN* phase) const;
bool is_index_range_check() const;
};
//------------------------------CmpPNode---------------------------------------
// Compare 2 pointer values, returning condition codes (-1, 0 or 1).
class CmpPNode : public CmpNode {
public:
CmpPNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
! virtual uint Opcode() const;
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
virtual const Type *sub( const Type *, const Type * ) const;
};
//------------------------------CmpNNode--------------------------------------
// Compare 2 narrow oop values, returning condition codes (-1, 0 or 1).
class CmpNNode : public CmpNode {
public:
CmpNNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
! virtual uint Opcode() const;
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
virtual const Type *sub( const Type *, const Type * ) const;
};
//------------------------------CmpLNode---------------------------------------
// Compare 2 long values, returning condition codes (-1, 0 or 1).
class CmpLNode : public CmpNode {
public:
CmpLNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
! virtual uint Opcode() const;
virtual const Type *sub( const Type *, const Type * ) const;
};
//------------------------------CmpL3Node--------------------------------------
// Compare 2 long values, returning integer value (-1, 0 or 1).
*** 204,225 ****
public:
CmpL3Node( Node *in1, Node *in2 ) : CmpLNode(in1,in2) {
// Since it is not consumed by Bools, it is not really a Cmp.
init_class_id(Class_Sub);
}
! virtual int Opcode() const;
virtual uint ideal_reg() const { return Op_RegI; }
};
//------------------------------CmpFNode---------------------------------------
// Compare 2 float values, returning condition codes (-1, 0 or 1).
// This implements the Java bytecode fcmpl, so unordered returns -1.
// Operands may not commute.
class CmpFNode : public CmpNode {
public:
CmpFNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
! virtual int Opcode() const;
virtual const Type *sub( const Type *, const Type * ) const { ShouldNotReachHere(); return NULL; }
const Type* Value(PhaseGVN* phase) const;
};
//------------------------------CmpF3Node--------------------------------------
--- 204,225 ----
public:
CmpL3Node( Node *in1, Node *in2 ) : CmpLNode(in1,in2) {
// Since it is not consumed by Bools, it is not really a Cmp.
init_class_id(Class_Sub);
}
! virtual uint Opcode() const;
virtual uint ideal_reg() const { return Op_RegI; }
};
//------------------------------CmpFNode---------------------------------------
// Compare 2 float values, returning condition codes (-1, 0 or 1).
// This implements the Java bytecode fcmpl, so unordered returns -1.
// Operands may not commute.
class CmpFNode : public CmpNode {
public:
CmpFNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
! virtual uint Opcode() const;
virtual const Type *sub( const Type *, const Type * ) const { ShouldNotReachHere(); return NULL; }
const Type* Value(PhaseGVN* phase) const;
};
//------------------------------CmpF3Node--------------------------------------
*** 230,240 ****
public:
CmpF3Node( Node *in1, Node *in2 ) : CmpFNode(in1,in2) {
// Since it is not consumed by Bools, it is not really a Cmp.
init_class_id(Class_Sub);
}
! virtual int Opcode() const;
// Since it is not consumed by Bools, it is not really a Cmp.
virtual uint ideal_reg() const { return Op_RegI; }
};
--- 230,240 ----
public:
CmpF3Node( Node *in1, Node *in2 ) : CmpFNode(in1,in2) {
// Since it is not consumed by Bools, it is not really a Cmp.
init_class_id(Class_Sub);
}
! virtual uint Opcode() const;
// Since it is not consumed by Bools, it is not really a Cmp.
virtual uint ideal_reg() const { return Op_RegI; }
};
*** 243,253 ****
// This implements the Java bytecode dcmpl, so unordered returns -1.
// Operands may not commute.
class CmpDNode : public CmpNode {
public:
CmpDNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
! virtual int Opcode() const;
virtual const Type *sub( const Type *, const Type * ) const { ShouldNotReachHere(); return NULL; }
const Type* Value(PhaseGVN* phase) const;
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
};
--- 243,253 ----
// This implements the Java bytecode dcmpl, so unordered returns -1.
// Operands may not commute.
class CmpDNode : public CmpNode {
public:
CmpDNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
! virtual uint Opcode() const;
virtual const Type *sub( const Type *, const Type * ) const { ShouldNotReachHere(); return NULL; }
const Type* Value(PhaseGVN* phase) const;
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
};
*** 259,269 ****
public:
CmpD3Node( Node *in1, Node *in2 ) : CmpDNode(in1,in2) {
// Since it is not consumed by Bools, it is not really a Cmp.
init_class_id(Class_Sub);
}
! virtual int Opcode() const;
virtual uint ideal_reg() const { return Op_RegI; }
};
//------------------------------BoolTest---------------------------------------
--- 259,269 ----
public:
CmpD3Node( Node *in1, Node *in2 ) : CmpDNode(in1,in2) {
// Since it is not consumed by Bools, it is not really a Cmp.
init_class_id(Class_Sub);
}
! virtual uint Opcode() const;
virtual uint ideal_reg() const { return Op_RegI; }
};
//------------------------------BoolTest---------------------------------------
*** 305,315 ****
static Node* make_predicate(Node* test_value, PhaseGVN* phase);
// Convert self back to an integer value.
Node* as_int_value(PhaseGVN* phase);
// Invert sense of self, returning new Bool.
BoolNode* negate(PhaseGVN* phase);
! virtual int Opcode() const;
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
virtual const Type* Value(PhaseGVN* phase) const;
virtual const Type *bottom_type() const { return TypeInt::BOOL; }
uint match_edge(uint idx) const { return 0; }
virtual uint ideal_reg() const { return Op_RegI; }
--- 305,315 ----
static Node* make_predicate(Node* test_value, PhaseGVN* phase);
// Convert self back to an integer value.
Node* as_int_value(PhaseGVN* phase);
// Invert sense of self, returning new Bool.
BoolNode* negate(PhaseGVN* phase);
! virtual uint Opcode() const;
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
virtual const Type* Value(PhaseGVN* phase) const;
virtual const Type *bottom_type() const { return TypeInt::BOOL; }
uint match_edge(uint idx) const { return 0; }
virtual uint ideal_reg() const { return Op_RegI; }
*** 333,343 ****
// Absolute value an integer. Since a naive graph involves control flow, we
// "match" it in the ideal world (so the control flow can be removed).
class AbsINode : public AbsNode {
public:
AbsINode( Node *in1 ) : AbsNode(in1) {}
! virtual int Opcode() const;
const Type *bottom_type() const { return TypeInt::INT; }
virtual uint ideal_reg() const { return Op_RegI; }
};
//------------------------------AbsFNode---------------------------------------
--- 333,343 ----
// Absolute value an integer. Since a naive graph involves control flow, we
// "match" it in the ideal world (so the control flow can be removed).
class AbsINode : public AbsNode {
public:
AbsINode( Node *in1 ) : AbsNode(in1) {}
! virtual uint Opcode() const;
const Type *bottom_type() const { return TypeInt::INT; }
virtual uint ideal_reg() const { return Op_RegI; }
};
//------------------------------AbsFNode---------------------------------------
*** 345,355 ****
// implemention on most chips. Since a naive graph involves control flow, we
// "match" it in the ideal world (so the control flow can be removed).
class AbsFNode : public AbsNode {
public:
AbsFNode( Node *in1 ) : AbsNode(in1) {}
! virtual int Opcode() const;
const Type *bottom_type() const { return Type::FLOAT; }
virtual uint ideal_reg() const { return Op_RegF; }
};
//------------------------------AbsDNode---------------------------------------
--- 345,355 ----
// implemention on most chips. Since a naive graph involves control flow, we
// "match" it in the ideal world (so the control flow can be removed).
class AbsFNode : public AbsNode {
public:
AbsFNode( Node *in1 ) : AbsNode(in1) {}
! virtual uint Opcode() const;
const Type *bottom_type() const { return Type::FLOAT; }
virtual uint ideal_reg() const { return Op_RegF; }
};
//------------------------------AbsDNode---------------------------------------
*** 357,378 ****
// implemention on most chips. Since a naive graph involves control flow, we
// "match" it in the ideal world (so the control flow can be removed).
class AbsDNode : public AbsNode {
public:
AbsDNode( Node *in1 ) : AbsNode(in1) {}
! virtual int Opcode() const;
const Type *bottom_type() const { return Type::DOUBLE; }
virtual uint ideal_reg() const { return Op_RegD; }
};
//------------------------------CmpLTMaskNode----------------------------------
// If p < q, return -1 else return 0. Nice for flow-free idioms.
class CmpLTMaskNode : public Node {
public:
CmpLTMaskNode( Node *p, Node *q ) : Node(0, p, q) {}
! virtual int Opcode() const;
const Type *bottom_type() const { return TypeInt::INT; }
virtual uint ideal_reg() const { return Op_RegI; }
};
--- 357,378 ----
// implemention on most chips. Since a naive graph involves control flow, we
// "match" it in the ideal world (so the control flow can be removed).
class AbsDNode : public AbsNode {
public:
AbsDNode( Node *in1 ) : AbsNode(in1) {}
! virtual uint Opcode() const;
const Type *bottom_type() const { return Type::DOUBLE; }
virtual uint ideal_reg() const { return Op_RegD; }
};
//------------------------------CmpLTMaskNode----------------------------------
// If p < q, return -1 else return 0. Nice for flow-free idioms.
class CmpLTMaskNode : public Node {
public:
CmpLTMaskNode( Node *p, Node *q ) : Node(0, p, q) {}
! virtual uint Opcode() const;
const Type *bottom_type() const { return TypeInt::INT; }
virtual uint ideal_reg() const { return Op_RegI; }
};
*** 388,398 ****
// cannot be used to replace negation we have to implement negation as ideal
// node; note that negation and addition can replace subtraction.
class NegFNode : public NegNode {
public:
NegFNode( Node *in1 ) : NegNode(in1) {}
! virtual int Opcode() const;
const Type *bottom_type() const { return Type::FLOAT; }
virtual uint ideal_reg() const { return Op_RegF; }
};
//------------------------------NegDNode---------------------------------------
--- 388,398 ----
// cannot be used to replace negation we have to implement negation as ideal
// node; note that negation and addition can replace subtraction.
class NegFNode : public NegNode {
public:
NegFNode( Node *in1 ) : NegNode(in1) {}
! virtual uint Opcode() const;
const Type *bottom_type() const { return Type::FLOAT; }
virtual uint ideal_reg() const { return Op_RegF; }
};
//------------------------------NegDNode---------------------------------------
*** 401,421 ****
// cannot be used to replace negation we have to implement negation as ideal
// node; note that negation and addition can replace subtraction.
class NegDNode : public NegNode {
public:
NegDNode( Node *in1 ) : NegNode(in1) {}
! virtual int Opcode() const;
const Type *bottom_type() const { return Type::DOUBLE; }
virtual uint ideal_reg() const { return Op_RegD; }
};
//------------------------------AtanDNode--------------------------------------
// arcus tangens of a double
class AtanDNode : public Node {
public:
AtanDNode(Node *c, Node *in1, Node *in2 ) : Node(c, in1, in2) {}
! virtual int Opcode() const;
const Type *bottom_type() const { return Type::DOUBLE; }
virtual uint ideal_reg() const { return Op_RegD; }
};
--- 401,421 ----
// cannot be used to replace negation we have to implement negation as ideal
// node; note that negation and addition can replace subtraction.
class NegDNode : public NegNode {
public:
NegDNode( Node *in1 ) : NegNode(in1) {}
! virtual uint Opcode() const;
const Type *bottom_type() const { return Type::DOUBLE; }
virtual uint ideal_reg() const { return Op_RegD; }
};
//------------------------------AtanDNode--------------------------------------
// arcus tangens of a double
class AtanDNode : public Node {
public:
AtanDNode(Node *c, Node *in1, Node *in2 ) : Node(c, in1, in2) {}
! virtual uint Opcode() const;
const Type *bottom_type() const { return Type::DOUBLE; }
virtual uint ideal_reg() const { return Op_RegD; }
};
*** 425,476 ****
public:
SqrtDNode(Compile* C, Node *c, Node *in1) : Node(c, in1) {
init_flags(Flag_is_expensive);
C->add_expensive_node(this);
}
! virtual int Opcode() const;
const Type *bottom_type() const { return Type::DOUBLE; }
virtual uint ideal_reg() const { return Op_RegD; }
virtual const Type* Value(PhaseGVN* phase) const;
};
//-------------------------------ReverseBytesINode--------------------------------
// reverse bytes of an integer
class ReverseBytesINode : public Node {
public:
ReverseBytesINode(Node *c, Node *in1) : Node(c, in1) {}
! virtual int Opcode() const;
const Type *bottom_type() const { return TypeInt::INT; }
virtual uint ideal_reg() const { return Op_RegI; }
};
//-------------------------------ReverseBytesLNode--------------------------------
// reverse bytes of a long
class ReverseBytesLNode : public Node {
public:
ReverseBytesLNode(Node *c, Node *in1) : Node(c, in1) {}
! virtual int Opcode() const;
const Type *bottom_type() const { return TypeLong::LONG; }
virtual uint ideal_reg() const { return Op_RegL; }
};
//-------------------------------ReverseBytesUSNode--------------------------------
// reverse bytes of an unsigned short / char
class ReverseBytesUSNode : public Node {
public:
ReverseBytesUSNode(Node *c, Node *in1) : Node(c, in1) {}
! virtual int Opcode() const;
const Type *bottom_type() const { return TypeInt::CHAR; }
virtual uint ideal_reg() const { return Op_RegI; }
};
//-------------------------------ReverseBytesSNode--------------------------------
// reverse bytes of a short
class ReverseBytesSNode : public Node {
public:
ReverseBytesSNode(Node *c, Node *in1) : Node(c, in1) {}
! virtual int Opcode() const;
const Type *bottom_type() const { return TypeInt::SHORT; }
virtual uint ideal_reg() const { return Op_RegI; }
};
#endif // SHARE_VM_OPTO_SUBNODE_HPP
--- 425,476 ----
public:
SqrtDNode(Compile* C, Node *c, Node *in1) : Node(c, in1) {
init_flags(Flag_is_expensive);
C->add_expensive_node(this);
}
! virtual uint Opcode() const;
const Type *bottom_type() const { return Type::DOUBLE; }
virtual uint ideal_reg() const { return Op_RegD; }
virtual const Type* Value(PhaseGVN* phase) const;
};
//-------------------------------ReverseBytesINode--------------------------------
// reverse bytes of an integer
class ReverseBytesINode : public Node {
public:
ReverseBytesINode(Node *c, Node *in1) : Node(c, in1) {}
! virtual uint Opcode() const;
const Type *bottom_type() const { return TypeInt::INT; }
virtual uint ideal_reg() const { return Op_RegI; }
};
//-------------------------------ReverseBytesLNode--------------------------------
// reverse bytes of a long
class ReverseBytesLNode : public Node {
public:
ReverseBytesLNode(Node *c, Node *in1) : Node(c, in1) {}
! virtual uint Opcode() const;
const Type *bottom_type() const { return TypeLong::LONG; }
virtual uint ideal_reg() const { return Op_RegL; }
};
//-------------------------------ReverseBytesUSNode--------------------------------
// reverse bytes of an unsigned short / char
class ReverseBytesUSNode : public Node {
public:
ReverseBytesUSNode(Node *c, Node *in1) : Node(c, in1) {}
! virtual uint Opcode() const;
const Type *bottom_type() const { return TypeInt::CHAR; }
virtual uint ideal_reg() const { return Op_RegI; }
};
//-------------------------------ReverseBytesSNode--------------------------------
// reverse bytes of a short
class ReverseBytesSNode : public Node {
public:
ReverseBytesSNode(Node *c, Node *in1) : Node(c, in1) {}
! virtual uint Opcode() const;
const Type *bottom_type() const { return TypeInt::SHORT; }
virtual uint ideal_reg() const { return Op_RegI; }
};
#endif // SHARE_VM_OPTO_SUBNODE_HPP
< prev index next >