< prev index next >

src/hotspot/share/opto/divnode.cpp

Print this page

1387   DivModINode* divmod = new DivModINode(n->in(0), n->in(1), n->in(2));
1388   Node*        dproj  = new ProjNode(divmod, DivModNode::div_proj_num);
1389   Node*        mproj  = new ProjNode(divmod, DivModNode::mod_proj_num);
1390   return divmod;
1391 }
1392 
1393 //------------------------------make------------------------------------------
1394 DivModLNode* DivModLNode::make(Node* div_or_mod) {
1395   Node* n = div_or_mod;
1396   assert(n->Opcode() == Op_DivL || n->Opcode() == Op_ModL,
1397          "only div or mod input pattern accepted");
1398 
1399   DivModLNode* divmod = new DivModLNode(n->in(0), n->in(1), n->in(2));
1400   Node*        dproj  = new ProjNode(divmod, DivModNode::div_proj_num);
1401   Node*        mproj  = new ProjNode(divmod, DivModNode::mod_proj_num);
1402   return divmod;
1403 }
1404 
1405 //------------------------------match------------------------------------------
1406 // return result(s) along with their RegMask info
1407 Node *DivModINode::match( const ProjNode *proj, const Matcher *match ) {
1408   uint ideal_reg = proj->ideal_reg();
1409   RegMask rm;
1410   if (proj->_con == div_proj_num) {
1411     rm = match->divI_proj_mask();
1412   } else {
1413     assert(proj->_con == mod_proj_num, "must be div or mod projection");
1414     rm = match->modI_proj_mask();
1415   }
1416   return new MachProjNode(this, proj->_con, rm, ideal_reg);
1417 }
1418 
1419 
1420 //------------------------------match------------------------------------------
1421 // return result(s) along with their RegMask info
1422 Node *DivModLNode::match( const ProjNode *proj, const Matcher *match ) {
1423   uint ideal_reg = proj->ideal_reg();
1424   RegMask rm;
1425   if (proj->_con == div_proj_num) {
1426     rm = match->divL_proj_mask();
1427   } else {
1428     assert(proj->_con == mod_proj_num, "must be div or mod projection");
1429     rm = match->modL_proj_mask();
1430   }
1431   return new MachProjNode(this, proj->_con, rm, ideal_reg);
1432 }
1433 
1434 //------------------------------make------------------------------------------
1435 UDivModINode* UDivModINode::make(Node* div_or_mod) {
1436   Node* n = div_or_mod;
1437   assert(n->Opcode() == Op_UDivI || n->Opcode() == Op_UModI,
1438          "only div or mod input pattern accepted");
1439 
1440   UDivModINode* divmod = new UDivModINode(n->in(0), n->in(1), n->in(2));
1441   Node*        dproj  = new ProjNode(divmod, DivModNode::div_proj_num);
1442   Node*        mproj  = new ProjNode(divmod, DivModNode::mod_proj_num);
1443   return divmod;
1444 }
1445 
1446 //------------------------------make------------------------------------------
1447 UDivModLNode* UDivModLNode::make(Node* div_or_mod) {
1448   Node* n = div_or_mod;
1449   assert(n->Opcode() == Op_UDivL || n->Opcode() == Op_UModL,
1450          "only div or mod input pattern accepted");
1451 
1452   UDivModLNode* divmod = new UDivModLNode(n->in(0), n->in(1), n->in(2));
1453   Node*        dproj  = new ProjNode(divmod, DivModNode::div_proj_num);
1454   Node*        mproj  = new ProjNode(divmod, DivModNode::mod_proj_num);
1455   return divmod;
1456 }
1457 
1458 //------------------------------match------------------------------------------
1459 // return result(s) along with their RegMask info
1460 Node* UDivModINode::match( const ProjNode *proj, const Matcher *match ) {
1461   uint ideal_reg = proj->ideal_reg();
1462   RegMask rm;
1463   if (proj->_con == div_proj_num) {
1464     rm = match->divI_proj_mask();
1465   } else {
1466     assert(proj->_con == mod_proj_num, "must be div or mod projection");
1467     rm = match->modI_proj_mask();
1468   }
1469   return new MachProjNode(this, proj->_con, rm, ideal_reg);
1470 }
1471 
1472 
1473 //------------------------------match------------------------------------------
1474 // return result(s) along with their RegMask info
1475 Node* UDivModLNode::match( const ProjNode *proj, const Matcher *match ) {
1476   uint ideal_reg = proj->ideal_reg();
1477   RegMask rm;
1478   if (proj->_con == div_proj_num) {
1479     rm = match->divL_proj_mask();
1480   } else {
1481     assert(proj->_con == mod_proj_num, "must be div or mod projection");
1482     rm = match->modL_proj_mask();
1483   }
1484   return new MachProjNode(this, proj->_con, rm, ideal_reg);
1485 }

1387   DivModINode* divmod = new DivModINode(n->in(0), n->in(1), n->in(2));
1388   Node*        dproj  = new ProjNode(divmod, DivModNode::div_proj_num);
1389   Node*        mproj  = new ProjNode(divmod, DivModNode::mod_proj_num);
1390   return divmod;
1391 }
1392 
1393 //------------------------------make------------------------------------------
1394 DivModLNode* DivModLNode::make(Node* div_or_mod) {
1395   Node* n = div_or_mod;
1396   assert(n->Opcode() == Op_DivL || n->Opcode() == Op_ModL,
1397          "only div or mod input pattern accepted");
1398 
1399   DivModLNode* divmod = new DivModLNode(n->in(0), n->in(1), n->in(2));
1400   Node*        dproj  = new ProjNode(divmod, DivModNode::div_proj_num);
1401   Node*        mproj  = new ProjNode(divmod, DivModNode::mod_proj_num);
1402   return divmod;
1403 }
1404 
1405 //------------------------------match------------------------------------------
1406 // return result(s) along with their RegMask info
1407 Node *DivModINode::match(const ProjNode *proj, const Matcher *match, const RegMask* mask) {
1408   uint ideal_reg = proj->ideal_reg();
1409   RegMask rm;
1410   if (proj->_con == div_proj_num) {
1411     rm = match->divI_proj_mask();
1412   } else {
1413     assert(proj->_con == mod_proj_num, "must be div or mod projection");
1414     rm = match->modI_proj_mask();
1415   }
1416   return new MachProjNode(this, proj->_con, rm, ideal_reg);
1417 }
1418 
1419 
1420 //------------------------------match------------------------------------------
1421 // return result(s) along with their RegMask info
1422 Node *DivModLNode::match(const ProjNode *proj, const Matcher *match, const RegMask* mask) {
1423   uint ideal_reg = proj->ideal_reg();
1424   RegMask rm;
1425   if (proj->_con == div_proj_num) {
1426     rm = match->divL_proj_mask();
1427   } else {
1428     assert(proj->_con == mod_proj_num, "must be div or mod projection");
1429     rm = match->modL_proj_mask();
1430   }
1431   return new MachProjNode(this, proj->_con, rm, ideal_reg);
1432 }
1433 
1434 //------------------------------make------------------------------------------
1435 UDivModINode* UDivModINode::make(Node* div_or_mod) {
1436   Node* n = div_or_mod;
1437   assert(n->Opcode() == Op_UDivI || n->Opcode() == Op_UModI,
1438          "only div or mod input pattern accepted");
1439 
1440   UDivModINode* divmod = new UDivModINode(n->in(0), n->in(1), n->in(2));
1441   Node*        dproj  = new ProjNode(divmod, DivModNode::div_proj_num);
1442   Node*        mproj  = new ProjNode(divmod, DivModNode::mod_proj_num);
1443   return divmod;
1444 }
1445 
1446 //------------------------------make------------------------------------------
1447 UDivModLNode* UDivModLNode::make(Node* div_or_mod) {
1448   Node* n = div_or_mod;
1449   assert(n->Opcode() == Op_UDivL || n->Opcode() == Op_UModL,
1450          "only div or mod input pattern accepted");
1451 
1452   UDivModLNode* divmod = new UDivModLNode(n->in(0), n->in(1), n->in(2));
1453   Node*        dproj  = new ProjNode(divmod, DivModNode::div_proj_num);
1454   Node*        mproj  = new ProjNode(divmod, DivModNode::mod_proj_num);
1455   return divmod;
1456 }
1457 
1458 //------------------------------match------------------------------------------
1459 // return result(s) along with their RegMask info
1460 Node* UDivModINode::match(const ProjNode* proj, const Matcher* match, const RegMask* mask) {
1461   uint ideal_reg = proj->ideal_reg();
1462   RegMask rm;
1463   if (proj->_con == div_proj_num) {
1464     rm = match->divI_proj_mask();
1465   } else {
1466     assert(proj->_con == mod_proj_num, "must be div or mod projection");
1467     rm = match->modI_proj_mask();
1468   }
1469   return new MachProjNode(this, proj->_con, rm, ideal_reg);
1470 }
1471 
1472 
1473 //------------------------------match------------------------------------------
1474 // return result(s) along with their RegMask info
1475 Node* UDivModLNode::match( const ProjNode* proj, const Matcher* match, const RegMask* mask) {
1476   uint ideal_reg = proj->ideal_reg();
1477   RegMask rm;
1478   if (proj->_con == div_proj_num) {
1479     rm = match->divL_proj_mask();
1480   } else {
1481     assert(proj->_con == mod_proj_num, "must be div or mod projection");
1482     rm = match->modL_proj_mask();
1483   }
1484   return new MachProjNode(this, proj->_con, rm, ideal_reg);
1485 }
< prev index next >