< prev index next >

src/hotspot/share/opto/divnode.cpp

Print this page

1277   DivModINode* divmod = new DivModINode(n->in(0), n->in(1), n->in(2));
1278   Node*        dproj  = new ProjNode(divmod, DivModNode::div_proj_num);
1279   Node*        mproj  = new ProjNode(divmod, DivModNode::mod_proj_num);
1280   return divmod;
1281 }
1282 
1283 //------------------------------make------------------------------------------
1284 DivModLNode* DivModLNode::make(Node* div_or_mod) {
1285   Node* n = div_or_mod;
1286   assert(n->Opcode() == Op_DivL || n->Opcode() == Op_ModL,
1287          "only div or mod input pattern accepted");
1288 
1289   DivModLNode* divmod = new DivModLNode(n->in(0), n->in(1), n->in(2));
1290   Node*        dproj  = new ProjNode(divmod, DivModNode::div_proj_num);
1291   Node*        mproj  = new ProjNode(divmod, DivModNode::mod_proj_num);
1292   return divmod;
1293 }
1294 
1295 //------------------------------match------------------------------------------
1296 // return result(s) along with their RegMask info
1297 Node *DivModINode::match( const ProjNode *proj, const Matcher *match ) {
1298   uint ideal_reg = proj->ideal_reg();
1299   RegMask rm;
1300   if (proj->_con == div_proj_num) {
1301     rm = match->divI_proj_mask();
1302   } else {
1303     assert(proj->_con == mod_proj_num, "must be div or mod projection");
1304     rm = match->modI_proj_mask();
1305   }
1306   return new MachProjNode(this, proj->_con, rm, ideal_reg);
1307 }
1308 
1309 
1310 //------------------------------match------------------------------------------
1311 // return result(s) along with their RegMask info
1312 Node *DivModLNode::match( const ProjNode *proj, const Matcher *match ) {
1313   uint ideal_reg = proj->ideal_reg();
1314   RegMask rm;
1315   if (proj->_con == div_proj_num) {
1316     rm = match->divL_proj_mask();
1317   } else {
1318     assert(proj->_con == mod_proj_num, "must be div or mod projection");
1319     rm = match->modL_proj_mask();
1320   }
1321   return new MachProjNode(this, proj->_con, rm, ideal_reg);
1322 }

1277   DivModINode* divmod = new DivModINode(n->in(0), n->in(1), n->in(2));
1278   Node*        dproj  = new ProjNode(divmod, DivModNode::div_proj_num);
1279   Node*        mproj  = new ProjNode(divmod, DivModNode::mod_proj_num);
1280   return divmod;
1281 }
1282 
1283 //------------------------------make------------------------------------------
1284 DivModLNode* DivModLNode::make(Node* div_or_mod) {
1285   Node* n = div_or_mod;
1286   assert(n->Opcode() == Op_DivL || n->Opcode() == Op_ModL,
1287          "only div or mod input pattern accepted");
1288 
1289   DivModLNode* divmod = new DivModLNode(n->in(0), n->in(1), n->in(2));
1290   Node*        dproj  = new ProjNode(divmod, DivModNode::div_proj_num);
1291   Node*        mproj  = new ProjNode(divmod, DivModNode::mod_proj_num);
1292   return divmod;
1293 }
1294 
1295 //------------------------------match------------------------------------------
1296 // return result(s) along with their RegMask info
1297 Node *DivModINode::match(const ProjNode *proj, const Matcher *match, const RegMask* mask) {
1298   uint ideal_reg = proj->ideal_reg();
1299   RegMask rm;
1300   if (proj->_con == div_proj_num) {
1301     rm = match->divI_proj_mask();
1302   } else {
1303     assert(proj->_con == mod_proj_num, "must be div or mod projection");
1304     rm = match->modI_proj_mask();
1305   }
1306   return new MachProjNode(this, proj->_con, rm, ideal_reg);
1307 }
1308 
1309 
1310 //------------------------------match------------------------------------------
1311 // return result(s) along with their RegMask info
1312 Node *DivModLNode::match(const ProjNode *proj, const Matcher *match, const RegMask* mask) {
1313   uint ideal_reg = proj->ideal_reg();
1314   RegMask rm;
1315   if (proj->_con == div_proj_num) {
1316     rm = match->divL_proj_mask();
1317   } else {
1318     assert(proj->_con == mod_proj_num, "must be div or mod projection");
1319     rm = match->modL_proj_mask();
1320   }
1321   return new MachProjNode(this, proj->_con, rm, ideal_reg);
1322 }
< prev index next >