< prev index next >
src/share/vm/opto/movenode.cpp
Print this page
*** 119,129 ****
}
//------------------------------Identity---------------------------------------
// Conditional-move is an identity if both inputs are the same, or the test
// true or false.
! Node *CMoveNode::Identity( PhaseTransform *phase ) {
if( phase->eqv(in(IfFalse),in(IfTrue)) ) // C-moving identical inputs?
return in(IfFalse); // Then it doesn't matter
if( phase->type(in(Condition)) == TypeInt::ZERO )
return in(IfFalse); // Always pick left(false) input
if( phase->type(in(Condition)) == TypeInt::ONE )
--- 119,129 ----
}
//------------------------------Identity---------------------------------------
// Conditional-move is an identity if both inputs are the same, or the test
// true or false.
! Node* CMoveNode::Identity(PhaseGVN* phase) {
if( phase->eqv(in(IfFalse),in(IfTrue)) ) // C-moving identical inputs?
return in(IfFalse); // Then it doesn't matter
if( phase->type(in(Condition)) == TypeInt::ZERO )
return in(IfFalse); // Always pick left(false) input
if( phase->type(in(Condition)) == TypeInt::ONE )
*** 147,157 ****
return this;
}
//------------------------------Value------------------------------------------
// Result is the meet of inputs
! const Type *CMoveNode::Value( PhaseTransform *phase ) const {
if( phase->type(in(Condition)) == Type::TOP )
return Type::TOP;
return phase->type(in(IfFalse))->meet_speculative(phase->type(in(IfTrue)));
}
--- 147,157 ----
return this;
}
//------------------------------Value------------------------------------------
// Result is the meet of inputs
! const Type* CMoveNode::Value(PhaseGVN* phase) const {
if( phase->type(in(Condition)) == Type::TOP )
return Type::TOP;
return phase->type(in(IfFalse))->meet_speculative(phase->type(in(IfTrue)));
}
*** 349,392 ****
return abs;
}
//------------------------------Value------------------------------------------
! const Type *MoveL2DNode::Value( PhaseTransform *phase ) const {
const Type *t = phase->type( in(1) );
if( t == Type::TOP ) return Type::TOP;
const TypeLong *tl = t->is_long();
if( !tl->is_con() ) return bottom_type();
JavaValue v;
v.set_jlong(tl->get_con());
return TypeD::make( v.get_jdouble() );
}
//------------------------------Value------------------------------------------
! const Type *MoveI2FNode::Value( PhaseTransform *phase ) const {
const Type *t = phase->type( in(1) );
if( t == Type::TOP ) return Type::TOP;
const TypeInt *ti = t->is_int();
if( !ti->is_con() ) return bottom_type();
JavaValue v;
v.set_jint(ti->get_con());
return TypeF::make( v.get_jfloat() );
}
//------------------------------Value------------------------------------------
! const Type *MoveF2INode::Value( PhaseTransform *phase ) const {
const Type *t = phase->type( in(1) );
if( t == Type::TOP ) return Type::TOP;
if( t == Type::FLOAT ) return TypeInt::INT;
const TypeF *tf = t->is_float_constant();
JavaValue v;
v.set_jfloat(tf->getf());
return TypeInt::make( v.get_jint() );
}
//------------------------------Value------------------------------------------
! const Type *MoveD2LNode::Value( PhaseTransform *phase ) const {
const Type *t = phase->type( in(1) );
if( t == Type::TOP ) return Type::TOP;
if( t == Type::DOUBLE ) return TypeLong::LONG;
const TypeD *td = t->is_double_constant();
JavaValue v;
--- 349,392 ----
return abs;
}
//------------------------------Value------------------------------------------
! const Type* MoveL2DNode::Value(PhaseGVN* phase) const {
const Type *t = phase->type( in(1) );
if( t == Type::TOP ) return Type::TOP;
const TypeLong *tl = t->is_long();
if( !tl->is_con() ) return bottom_type();
JavaValue v;
v.set_jlong(tl->get_con());
return TypeD::make( v.get_jdouble() );
}
//------------------------------Value------------------------------------------
! const Type* MoveI2FNode::Value(PhaseGVN* phase) const {
const Type *t = phase->type( in(1) );
if( t == Type::TOP ) return Type::TOP;
const TypeInt *ti = t->is_int();
if( !ti->is_con() ) return bottom_type();
JavaValue v;
v.set_jint(ti->get_con());
return TypeF::make( v.get_jfloat() );
}
//------------------------------Value------------------------------------------
! const Type* MoveF2INode::Value(PhaseGVN* phase) const {
const Type *t = phase->type( in(1) );
if( t == Type::TOP ) return Type::TOP;
if( t == Type::FLOAT ) return TypeInt::INT;
const TypeF *tf = t->is_float_constant();
JavaValue v;
v.set_jfloat(tf->getf());
return TypeInt::make( v.get_jint() );
}
//------------------------------Value------------------------------------------
! const Type* MoveD2LNode::Value(PhaseGVN* phase) const {
const Type *t = phase->type( in(1) );
if( t == Type::TOP ) return Type::TOP;
if( t == Type::DOUBLE ) return TypeLong::LONG;
const TypeD *td = t->is_double_constant();
JavaValue v;
< prev index next >