< prev index next >

src/hotspot/share/opto/divnode.cpp

Print this page




1294   DivModINode* divmod = new DivModINode(n->in(0), n->in(1), n->in(2));
1295   Node*        dproj  = new ProjNode(divmod, DivModNode::div_proj_num);
1296   Node*        mproj  = new ProjNode(divmod, DivModNode::mod_proj_num);
1297   return divmod;
1298 }
1299 
1300 //------------------------------make------------------------------------------
1301 DivModLNode* DivModLNode::make(Node* div_or_mod) {
1302   Node* n = div_or_mod;
1303   assert(n->Opcode() == Op_DivL || n->Opcode() == Op_ModL,
1304          "only div or mod input pattern accepted");
1305 
1306   DivModLNode* divmod = new DivModLNode(n->in(0), n->in(1), n->in(2));
1307   Node*        dproj  = new ProjNode(divmod, DivModNode::div_proj_num);
1308   Node*        mproj  = new ProjNode(divmod, DivModNode::mod_proj_num);
1309   return divmod;
1310 }
1311 
1312 //------------------------------match------------------------------------------
1313 // return result(s) along with their RegMask info
1314 Node *DivModINode::match( const ProjNode *proj, const Matcher *match ) {
1315   uint ideal_reg = proj->ideal_reg();
1316   RegMask rm;
1317   if (proj->_con == div_proj_num) {
1318     rm = match->divI_proj_mask();
1319   } else {
1320     assert(proj->_con == mod_proj_num, "must be div or mod projection");
1321     rm = match->modI_proj_mask();
1322   }
1323   return new MachProjNode(this, proj->_con, rm, ideal_reg);
1324 }
1325 
1326 
1327 //------------------------------match------------------------------------------
1328 // return result(s) along with their RegMask info
1329 Node *DivModLNode::match( const ProjNode *proj, const Matcher *match ) {
1330   uint ideal_reg = proj->ideal_reg();
1331   RegMask rm;
1332   if (proj->_con == div_proj_num) {
1333     rm = match->divL_proj_mask();
1334   } else {
1335     assert(proj->_con == mod_proj_num, "must be div or mod projection");
1336     rm = match->modL_proj_mask();
1337   }
1338   return new MachProjNode(this, proj->_con, rm, ideal_reg);
1339 }


1294   DivModINode* divmod = new DivModINode(n->in(0), n->in(1), n->in(2));
1295   Node*        dproj  = new ProjNode(divmod, DivModNode::div_proj_num);
1296   Node*        mproj  = new ProjNode(divmod, DivModNode::mod_proj_num);
1297   return divmod;
1298 }
1299 
1300 //------------------------------make------------------------------------------
1301 DivModLNode* DivModLNode::make(Node* div_or_mod) {
1302   Node* n = div_or_mod;
1303   assert(n->Opcode() == Op_DivL || n->Opcode() == Op_ModL,
1304          "only div or mod input pattern accepted");
1305 
1306   DivModLNode* divmod = new DivModLNode(n->in(0), n->in(1), n->in(2));
1307   Node*        dproj  = new ProjNode(divmod, DivModNode::div_proj_num);
1308   Node*        mproj  = new ProjNode(divmod, DivModNode::mod_proj_num);
1309   return divmod;
1310 }
1311 
1312 //------------------------------match------------------------------------------
1313 // return result(s) along with their RegMask info
1314 Node *DivModINode::match(const ProjNode *proj, const Matcher *match, const RegMask* mask) {
1315   uint ideal_reg = proj->ideal_reg();
1316   RegMask rm;
1317   if (proj->_con == div_proj_num) {
1318     rm = match->divI_proj_mask();
1319   } else {
1320     assert(proj->_con == mod_proj_num, "must be div or mod projection");
1321     rm = match->modI_proj_mask();
1322   }
1323   return new MachProjNode(this, proj->_con, rm, ideal_reg);
1324 }
1325 
1326 
1327 //------------------------------match------------------------------------------
1328 // return result(s) along with their RegMask info
1329 Node *DivModLNode::match(const ProjNode *proj, const Matcher *match, const RegMask* mask) {
1330   uint ideal_reg = proj->ideal_reg();
1331   RegMask rm;
1332   if (proj->_con == div_proj_num) {
1333     rm = match->divL_proj_mask();
1334   } else {
1335     assert(proj->_con == mod_proj_num, "must be div or mod projection");
1336     rm = match->modL_proj_mask();
1337   }
1338   return new MachProjNode(this, proj->_con, rm, ideal_reg);
1339 }
< prev index next >