< prev index next >

src/share/vm/opto/subnode.cpp

Print this page




1520   for( DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++ ) {
1521     Node* use = fast_out(i);
1522     if (use->is_CountedLoopEnd()) {
1523       return true;
1524     }
1525   }
1526   return false;
1527 }
1528 
1529 //=============================================================================
1530 //------------------------------Value------------------------------------------
1531 // Compute sqrt
1532 const Type* SqrtDNode::Value(PhaseGVN* phase) const {
1533   const Type *t1 = phase->type( in(1) );
1534   if( t1 == Type::TOP ) return Type::TOP;
1535   if( t1->base() != Type::DoubleCon ) return Type::DOUBLE;
1536   double d = t1->getd();
1537   if( d < 0.0 ) return Type::DOUBLE;
1538   return TypeD::make( sqrt( d ) );
1539 }



















































1520   for( DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++ ) {
1521     Node* use = fast_out(i);
1522     if (use->is_CountedLoopEnd()) {
1523       return true;
1524     }
1525   }
1526   return false;
1527 }
1528 
1529 //=============================================================================
1530 //------------------------------Value------------------------------------------
1531 // Compute sqrt
1532 const Type* SqrtDNode::Value(PhaseGVN* phase) const {
1533   const Type *t1 = phase->type( in(1) );
1534   if( t1 == Type::TOP ) return Type::TOP;
1535   if( t1->base() != Type::DoubleCon ) return Type::DOUBLE;
1536   double d = t1->getd();
1537   if( d < 0.0 ) return Type::DOUBLE;
1538   return TypeD::make( sqrt( d ) );
1539 }
1540 
1541 //=============================================================================
1542 //------------------------------match_edge-------------------------------------
1543  //Do not match memory edge
1544 uint FmaDNode::match_edge(uint idx) const {
1545 return idx == 1 || idx == 2; // FmaDNode c (Binary a b)
1546 }
1547 
1548 //------------------------------Value------------------------------------------
1549 const Type* FmaDNode::Value(PhaseGVN* phase) const {
1550   //return Type::DOUBLE;
1551   const Type *t1 = phase->type(in(1));
1552   if (t1 == Type::TOP) return Type::TOP;
1553   if (t1->base() != Type::DoubleCon) return Type::DOUBLE;
1554   const Type *t2 = phase->type(in(2));
1555   if (t2 == Type::TOP) return Type::TOP;
1556   if (t2->base() != Type::DoubleCon) return Type::DOUBLE;
1557   const Type *t3 = phase->type(in(3));
1558   if (t3 == Type::TOP) return Type::TOP;
1559   if (t3->base() != Type::DoubleCon) return Type::DOUBLE;
1560   double d1 = t1->getd();
1561   double d2 = t2->getd();
1562   double d3 = t3->getd();
1563   return TypeD::make(fma(d1, d2, d3));
1564 }
1565 
1566 //=============================================================================
1567 //------------------------------match_edge-------------------------------------
1568 //Do not match memory edge
1569 uint FmaFNode::match_edge(uint idx) const {
1570   return idx == 1 || idx == 2; // FmaFNode c (Binary a b)
1571 }
1572 
1573 //------------------------------Value------------------------------------------
1574 const Type* FmaFNode::Value(PhaseGVN* phase) const {
1575   const Type *t1 = phase->type(in(1));
1576   if (t1 == Type::TOP) return Type::TOP;
1577   if (t1->base() != Type::FloatCon) return Type::FLOAT;
1578   const Type *t2 = phase->type(in(2));
1579   if (t2 == Type::TOP) return Type::TOP;
1580   if (t2->base() != Type::FloatCon) return Type::FLOAT;
1581   const Type *t3 = phase->type(in(3));
1582   if (t3 == Type::TOP) return Type::TOP;
1583   if (t3->base() != Type::FloatCon) return Type::FLOAT;
1584   float f1 = t1->getf();
1585   float f2 = t2->getf();
1586   float f3 = t3->getf();
1587   return TypeD::make(fma(f1, f2, f3));
1588 }
< prev index next >