src/hotspot/share/opto/convertnode.cpp
changeset 48089 22c9856fc2c2
parent 47216 71c04702a3d5
child 53449 ea002b56e2f3
equal deleted inserted replaced
48088:2cd1c2b03782 48089:22c9856fc2c2
    69   const Type *t = phase->type( in(1) );
    69   const Type *t = phase->type( in(1) );
    70   if( t == Type::TOP ) return Type::TOP;
    70   if( t == Type::TOP ) return Type::TOP;
    71   if( t == Type::DOUBLE ) return Type::FLOAT;
    71   if( t == Type::DOUBLE ) return Type::FLOAT;
    72   const TypeD *td = t->is_double_constant();
    72   const TypeD *td = t->is_double_constant();
    73   return TypeF::make( (float)td->getd() );
    73   return TypeF::make( (float)td->getd() );
       
    74 }
       
    75 
       
    76 //------------------------------Ideal------------------------------------------
       
    77 // If we see pattern ConvF2D SomeDoubleOp ConvD2F, do operation as float.
       
    78 Node *ConvD2FNode::Ideal(PhaseGVN *phase, bool can_reshape) {
       
    79   if ( in(1)->Opcode() == Op_SqrtD ) {
       
    80     Node* sqrtd = in(1);
       
    81     if ( sqrtd->in(1)->Opcode() == Op_ConvF2D ) {
       
    82       if ( Matcher::match_rule_supported(Op_SqrtF) ) {
       
    83         Node* convf2d = sqrtd->in(1);
       
    84         return new SqrtFNode(phase->C, sqrtd->in(0), convf2d->in(1));
       
    85       }
       
    86     }
       
    87   }
       
    88   return NULL;
    74 }
    89 }
    75 
    90 
    76 //------------------------------Identity---------------------------------------
    91 //------------------------------Identity---------------------------------------
    77 // Float's can be converted to doubles with no loss of bits.  Hence
    92 // Float's can be converted to doubles with no loss of bits.  Hence
    78 // converting a float to a double and back to a float is a NOP.
    93 // converting a float to a double and back to a float is a NOP.