< prev index next >
src/share/vm/opto/mulnode.cpp
Print this page
*** 44,54 ****
return (uintptr_t)in(1) + (uintptr_t)in(2) + Opcode();
}
//------------------------------Identity---------------------------------------
// Multiplying a one preserves the other argument
! Node *MulNode::Identity( PhaseTransform *phase ) {
register const Type *one = mul_id(); // The multiplicative identity
if( phase->type( in(1) )->higher_equal( one ) ) return in(2);
if( phase->type( in(2) )->higher_equal( one ) ) return in(1);
return this;
--- 44,54 ----
return (uintptr_t)in(1) + (uintptr_t)in(2) + Opcode();
}
//------------------------------Identity---------------------------------------
// Multiplying a one preserves the other argument
! Node* MulNode::Identity(PhaseGVN* phase) {
register const Type *one = mul_id(); // The multiplicative identity
if( phase->type( in(1) )->higher_equal( one ) ) return in(2);
if( phase->type( in(2) )->higher_equal( one ) ) return in(1);
return this;
*** 137,147 ****
return progress;
}
//------------------------------Value-----------------------------------------
! const Type *MulNode::Value( PhaseTransform *phase ) const {
const Type *t1 = phase->type( in(1) );
const Type *t2 = phase->type( in(2) );
// Either input is TOP ==> the result is TOP
if( t1 == Type::TOP ) return Type::TOP;
if( t2 == Type::TOP ) return Type::TOP;
--- 137,147 ----
return progress;
}
//------------------------------Value-----------------------------------------
! const Type* MulNode::Value(PhaseGVN* phase) const {
const Type *t1 = phase->type( in(1) );
const Type *t2 = phase->type( in(2) );
// Either input is TOP ==> the result is TOP
if( t1 == Type::TOP ) return Type::TOP;
if( t2 == Type::TOP ) return Type::TOP;
*** 379,389 ****
return TypeD::make( t0->getd() * t1->getd() );
}
//=============================================================================
//------------------------------Value------------------------------------------
! const Type *MulHiLNode::Value( PhaseTransform *phase ) const {
// Either input is TOP ==> the result is TOP
const Type *t1 = phase->type( in(1) );
const Type *t2 = phase->type( in(2) );
if( t1 == Type::TOP ) return Type::TOP;
if( t2 == Type::TOP ) return Type::TOP;
--- 379,389 ----
return TypeD::make( t0->getd() * t1->getd() );
}
//=============================================================================
//------------------------------Value------------------------------------------
! const Type* MulHiLNode::Value(PhaseGVN* phase) const {
// Either input is TOP ==> the result is TOP
const Type *t1 = phase->type( in(1) );
const Type *t2 = phase->type( in(2) );
if( t1 == Type::TOP ) return Type::TOP;
if( t2 == Type::TOP ) return Type::TOP;
*** 430,440 ****
return TypeInt::INT; // No constants to be had
}
//------------------------------Identity---------------------------------------
// Masking off the high bits of an unsigned load is not required
! Node *AndINode::Identity( PhaseTransform *phase ) {
// x & x => x
if (phase->eqv(in(1), in(2))) return in(1);
Node* in1 = in(1);
--- 430,440 ----
return TypeInt::INT; // No constants to be had
}
//------------------------------Identity---------------------------------------
// Masking off the high bits of an unsigned load is not required
! Node* AndINode::Identity(PhaseGVN* phase) {
// x & x => x
if (phase->eqv(in(1), in(2))) return in(1);
Node* in1 = in(1);
*** 560,570 ****
return TypeLong::LONG; // No constants to be had
}
//------------------------------Identity---------------------------------------
// Masking off the high bits of an unsigned load is not required
! Node *AndLNode::Identity( PhaseTransform *phase ) {
// x & x => x
if (phase->eqv(in(1), in(2))) return in(1);
Node *usr = in(1);
--- 560,570 ----
return TypeLong::LONG; // No constants to be had
}
//------------------------------Identity---------------------------------------
// Masking off the high bits of an unsigned load is not required
! Node* AndLNode::Identity(PhaseGVN* phase) {
// x & x => x
if (phase->eqv(in(1), in(2))) return in(1);
Node *usr = in(1);
*** 637,647 ****
return MulNode::Ideal(phase, can_reshape);
}
//=============================================================================
//------------------------------Identity---------------------------------------
! Node *LShiftINode::Identity( PhaseTransform *phase ) {
const TypeInt *ti = phase->type( in(2) )->isa_int(); // shift count is an int
return ( ti && ti->is_con() && ( ti->get_con() & ( BitsPerInt - 1 ) ) == 0 ) ? in(1) : this;
}
//------------------------------Ideal------------------------------------------
--- 637,647 ----
return MulNode::Ideal(phase, can_reshape);
}
//=============================================================================
//------------------------------Identity---------------------------------------
! Node* LShiftINode::Identity(PhaseGVN* phase) {
const TypeInt *ti = phase->type( in(2) )->isa_int(); // shift count is an int
return ( ti && ti->is_con() && ( ti->get_con() & ( BitsPerInt - 1 ) ) == 0 ) ? in(1) : this;
}
//------------------------------Ideal------------------------------------------
*** 702,712 ****
return NULL;
}
//------------------------------Value------------------------------------------
// A LShiftINode shifts its input2 left by input1 amount.
! const Type *LShiftINode::Value( PhaseTransform *phase ) const {
const Type *t1 = phase->type( in(1) );
const Type *t2 = phase->type( in(2) );
// Either input is TOP ==> the result is TOP
if( t1 == Type::TOP ) return Type::TOP;
if( t2 == Type::TOP ) return Type::TOP;
--- 702,712 ----
return NULL;
}
//------------------------------Value------------------------------------------
// A LShiftINode shifts its input2 left by input1 amount.
! const Type* LShiftINode::Value(PhaseGVN* phase) const {
const Type *t1 = phase->type( in(1) );
const Type *t2 = phase->type( in(2) );
// Either input is TOP ==> the result is TOP
if( t1 == Type::TOP ) return Type::TOP;
if( t2 == Type::TOP ) return Type::TOP;
*** 749,759 ****
return TypeInt::make( (jint)r1->get_con() << (jint)shift );
}
//=============================================================================
//------------------------------Identity---------------------------------------
! Node *LShiftLNode::Identity( PhaseTransform *phase ) {
const TypeInt *ti = phase->type( in(2) )->isa_int(); // shift count is an int
return ( ti && ti->is_con() && ( ti->get_con() & ( BitsPerLong - 1 ) ) == 0 ) ? in(1) : this;
}
//------------------------------Ideal------------------------------------------
--- 749,759 ----
return TypeInt::make( (jint)r1->get_con() << (jint)shift );
}
//=============================================================================
//------------------------------Identity---------------------------------------
! Node* LShiftLNode::Identity(PhaseGVN* phase) {
const TypeInt *ti = phase->type( in(2) )->isa_int(); // shift count is an int
return ( ti && ti->is_con() && ( ti->get_con() & ( BitsPerLong - 1 ) ) == 0 ) ? in(1) : this;
}
//------------------------------Ideal------------------------------------------
*** 811,821 ****
return NULL;
}
//------------------------------Value------------------------------------------
// A LShiftLNode shifts its input2 left by input1 amount.
! const Type *LShiftLNode::Value( PhaseTransform *phase ) const {
const Type *t1 = phase->type( in(1) );
const Type *t2 = phase->type( in(2) );
// Either input is TOP ==> the result is TOP
if( t1 == Type::TOP ) return Type::TOP;
if( t2 == Type::TOP ) return Type::TOP;
--- 811,821 ----
return NULL;
}
//------------------------------Value------------------------------------------
// A LShiftLNode shifts its input2 left by input1 amount.
! const Type* LShiftLNode::Value(PhaseGVN* phase) const {
const Type *t1 = phase->type( in(1) );
const Type *t2 = phase->type( in(2) );
// Either input is TOP ==> the result is TOP
if( t1 == Type::TOP ) return Type::TOP;
if( t2 == Type::TOP ) return Type::TOP;
*** 858,868 ****
return TypeLong::make( (jlong)r1->get_con() << (jint)shift );
}
//=============================================================================
//------------------------------Identity---------------------------------------
! Node *RShiftINode::Identity( PhaseTransform *phase ) {
const TypeInt *t2 = phase->type(in(2))->isa_int();
if( !t2 ) return this;
if ( t2->is_con() && ( t2->get_con() & ( BitsPerInt - 1 ) ) == 0 )
return in(1);
--- 858,868 ----
return TypeLong::make( (jlong)r1->get_con() << (jint)shift );
}
//=============================================================================
//------------------------------Identity---------------------------------------
! Node* RShiftINode::Identity(PhaseGVN* phase) {
const TypeInt *t2 = phase->type(in(2))->isa_int();
if( !t2 ) return this;
if ( t2->is_con() && ( t2->get_con() & ( BitsPerInt - 1 ) ) == 0 )
return in(1);
*** 957,967 ****
return NULL;
}
//------------------------------Value------------------------------------------
// A RShiftINode shifts its input2 right by input1 amount.
! const Type *RShiftINode::Value( PhaseTransform *phase ) const {
const Type *t1 = phase->type( in(1) );
const Type *t2 = phase->type( in(2) );
// Either input is TOP ==> the result is TOP
if( t1 == Type::TOP ) return Type::TOP;
if( t2 == Type::TOP ) return Type::TOP;
--- 957,967 ----
return NULL;
}
//------------------------------Value------------------------------------------
// A RShiftINode shifts its input2 right by input1 amount.
! const Type* RShiftINode::Value(PhaseGVN* phase) const {
const Type *t1 = phase->type( in(1) );
const Type *t2 = phase->type( in(2) );
// Either input is TOP ==> the result is TOP
if( t1 == Type::TOP ) return Type::TOP;
if( t2 == Type::TOP ) return Type::TOP;
*** 1012,1029 ****
return TypeInt::make( r1->get_con() >> (r2->get_con()&31) );
}
//=============================================================================
//------------------------------Identity---------------------------------------
! Node *RShiftLNode::Identity( PhaseTransform *phase ) {
const TypeInt *ti = phase->type( in(2) )->isa_int(); // shift count is an int
return ( ti && ti->is_con() && ( ti->get_con() & ( BitsPerLong - 1 ) ) == 0 ) ? in(1) : this;
}
//------------------------------Value------------------------------------------
// A RShiftLNode shifts its input2 right by input1 amount.
! const Type *RShiftLNode::Value( PhaseTransform *phase ) const {
const Type *t1 = phase->type( in(1) );
const Type *t2 = phase->type( in(2) );
// Either input is TOP ==> the result is TOP
if( t1 == Type::TOP ) return Type::TOP;
if( t2 == Type::TOP ) return Type::TOP;
--- 1012,1029 ----
return TypeInt::make( r1->get_con() >> (r2->get_con()&31) );
}
//=============================================================================
//------------------------------Identity---------------------------------------
! Node* RShiftLNode::Identity(PhaseGVN* phase) {
const TypeInt *ti = phase->type( in(2) )->isa_int(); // shift count is an int
return ( ti && ti->is_con() && ( ti->get_con() & ( BitsPerLong - 1 ) ) == 0 ) ? in(1) : this;
}
//------------------------------Value------------------------------------------
// A RShiftLNode shifts its input2 right by input1 amount.
! const Type* RShiftLNode::Value(PhaseGVN* phase) const {
const Type *t1 = phase->type( in(1) );
const Type *t2 = phase->type( in(2) );
// Either input is TOP ==> the result is TOP
if( t1 == Type::TOP ) return Type::TOP;
if( t2 == Type::TOP ) return Type::TOP;
*** 1070,1080 ****
return TypeLong::LONG; // Give up
}
//=============================================================================
//------------------------------Identity---------------------------------------
! Node *URShiftINode::Identity( PhaseTransform *phase ) {
const TypeInt *ti = phase->type( in(2) )->isa_int();
if ( ti && ti->is_con() && ( ti->get_con() & ( BitsPerInt - 1 ) ) == 0 ) return in(1);
// Check for "((x << LogBytesPerWord) + (wordSize-1)) >> LogBytesPerWord" which is just "x".
// Happens during new-array length computation.
--- 1070,1080 ----
return TypeLong::LONG; // Give up
}
//=============================================================================
//------------------------------Identity---------------------------------------
! Node* URShiftINode::Identity(PhaseGVN* phase) {
const TypeInt *ti = phase->type( in(2) )->isa_int();
if ( ti && ti->is_con() && ( ti->get_con() & ( BitsPerInt - 1 ) ) == 0 ) return in(1);
// Check for "((x << LogBytesPerWord) + (wordSize-1)) >> LogBytesPerWord" which is just "x".
// Happens during new-array length computation.
*** 1166,1176 ****
return NULL;
}
//------------------------------Value------------------------------------------
// A URShiftINode shifts its input2 right by input1 amount.
! const Type *URShiftINode::Value( PhaseTransform *phase ) const {
// (This is a near clone of RShiftINode::Value.)
const Type *t1 = phase->type( in(1) );
const Type *t2 = phase->type( in(2) );
// Either input is TOP ==> the result is TOP
if( t1 == Type::TOP ) return Type::TOP;
--- 1166,1176 ----
return NULL;
}
//------------------------------Value------------------------------------------
// A URShiftINode shifts its input2 right by input1 amount.
! const Type* URShiftINode::Value(PhaseGVN* phase) const {
// (This is a near clone of RShiftINode::Value.)
const Type *t1 = phase->type( in(1) );
const Type *t2 = phase->type( in(2) );
// Either input is TOP ==> the result is TOP
if( t1 == Type::TOP ) return Type::TOP;
*** 1240,1250 ****
return TypeInt::INT;
}
//=============================================================================
//------------------------------Identity---------------------------------------
! Node *URShiftLNode::Identity( PhaseTransform *phase ) {
const TypeInt *ti = phase->type( in(2) )->isa_int(); // shift count is an int
return ( ti && ti->is_con() && ( ti->get_con() & ( BitsPerLong - 1 ) ) == 0 ) ? in(1) : this;
}
//------------------------------Ideal------------------------------------------
--- 1240,1250 ----
return TypeInt::INT;
}
//=============================================================================
//------------------------------Identity---------------------------------------
! Node* URShiftLNode::Identity(PhaseGVN* phase) {
const TypeInt *ti = phase->type( in(2) )->isa_int(); // shift count is an int
return ( ti && ti->is_con() && ( ti->get_con() & ( BitsPerLong - 1 ) ) == 0 ) ? in(1) : this;
}
//------------------------------Ideal------------------------------------------
*** 1295,1305 ****
return NULL;
}
//------------------------------Value------------------------------------------
// A URShiftINode shifts its input2 right by input1 amount.
! const Type *URShiftLNode::Value( PhaseTransform *phase ) const {
// (This is a near clone of RShiftLNode::Value.)
const Type *t1 = phase->type( in(1) );
const Type *t2 = phase->type( in(2) );
// Either input is TOP ==> the result is TOP
if( t1 == Type::TOP ) return Type::TOP;
--- 1295,1305 ----
return NULL;
}
//------------------------------Value------------------------------------------
// A URShiftINode shifts its input2 right by input1 amount.
! const Type* URShiftLNode::Value(PhaseGVN* phase) const {
// (This is a near clone of RShiftLNode::Value.)
const Type *t1 = phase->type( in(1) );
const Type *t2 = phase->type( in(2) );
// Either input is TOP ==> the result is TOP
if( t1 == Type::TOP ) return Type::TOP;
< prev index next >