< prev index next >

src/share/vm/opto/subnode.cpp

Print this page




1460       return true;
1461     }
1462   }
1463   return false;
1464 }
1465 
1466 //=============================================================================
1467 //------------------------------Value------------------------------------------
1468 // Compute sqrt
1469 const Type *SqrtDNode::Value( PhaseTransform *phase ) const {
1470   const Type *t1 = phase->type( in(1) );
1471   if( t1 == Type::TOP ) return Type::TOP;
1472   if( t1->base() != Type::DoubleCon ) return Type::DOUBLE;
1473   double d = t1->getd();
1474   if( d < 0.0 ) return Type::DOUBLE;
1475   return TypeD::make( sqrt( d ) );
1476 }
1477 
1478 //=============================================================================
1479 //------------------------------Value------------------------------------------
1480 // Compute cos
1481 const Type *CosDNode::Value( PhaseTransform *phase ) const {
1482   const Type *t1 = phase->type( in(1) );
1483   if( t1 == Type::TOP ) return Type::TOP;
1484   if( t1->base() != Type::DoubleCon ) return Type::DOUBLE;
1485   double d = t1->getd();
1486   return TypeD::make( StubRoutines::intrinsic_cos( d ) );
1487 }
1488 
1489 //=============================================================================
1490 //------------------------------Value------------------------------------------
1491 // Compute sin
1492 const Type *SinDNode::Value( PhaseTransform *phase ) const {
1493   const Type *t1 = phase->type( in(1) );
1494   if( t1 == Type::TOP ) return Type::TOP;
1495   if( t1->base() != Type::DoubleCon ) return Type::DOUBLE;
1496   double d = t1->getd();
1497   return TypeD::make( StubRoutines::intrinsic_sin( d ) );
1498 }
1499 
1500 //=============================================================================
1501 //------------------------------Value------------------------------------------
1502 // Compute tan
1503 const Type *TanDNode::Value( PhaseTransform *phase ) const {
1504   const Type *t1 = phase->type( in(1) );
1505   if( t1 == Type::TOP ) return Type::TOP;
1506   if( t1->base() != Type::DoubleCon ) return Type::DOUBLE;
1507   double d = t1->getd();
1508   return TypeD::make( StubRoutines::intrinsic_tan( d ) );
1509 }
1510 
1511 //=============================================================================
1512 //------------------------------Value------------------------------------------
1513 // Compute log10
1514 const Type *Log10DNode::Value( PhaseTransform *phase ) const {
1515   const Type *t1 = phase->type( in(1) );
1516   if( t1 == Type::TOP ) return Type::TOP;
1517   if( t1->base() != Type::DoubleCon ) return Type::DOUBLE;
1518   double d = t1->getd();
1519   return TypeD::make( StubRoutines::intrinsic_log10( d ) );
1520 }
1521 


1460       return true;
1461     }
1462   }
1463   return false;
1464 }
1465 
1466 //=============================================================================
1467 //------------------------------Value------------------------------------------
1468 // Compute sqrt
1469 const Type *SqrtDNode::Value( PhaseTransform *phase ) const {
1470   const Type *t1 = phase->type( in(1) );
1471   if( t1 == Type::TOP ) return Type::TOP;
1472   if( t1->base() != Type::DoubleCon ) return Type::DOUBLE;
1473   double d = t1->getd();
1474   if( d < 0.0 ) return Type::DOUBLE;
1475   return TypeD::make( sqrt( d ) );
1476 }
1477 
1478 //=============================================================================
1479 //------------------------------Value------------------------------------------






















1480 // Compute tan
1481 const Type *TanDNode::Value( PhaseTransform *phase ) const {
1482   const Type *t1 = phase->type( in(1) );
1483   if( t1 == Type::TOP ) return Type::TOP;
1484   if( t1->base() != Type::DoubleCon ) return Type::DOUBLE;
1485   double d = t1->getd();
1486   return TypeD::make( StubRoutines::intrinsic_tan( d ) );
1487 }
1488 
1489 //=============================================================================
1490 //------------------------------Value------------------------------------------
1491 // Compute log10
1492 const Type *Log10DNode::Value( PhaseTransform *phase ) const {
1493   const Type *t1 = phase->type( in(1) );
1494   if( t1 == Type::TOP ) return Type::TOP;
1495   if( t1->base() != Type::DoubleCon ) return Type::DOUBLE;
1496   double d = t1->getd();
1497   return TypeD::make( StubRoutines::intrinsic_log10( d ) );
1498 }
1499 
< prev index next >