hotspot/src/cpu/ppc/vm/ppc.ad
changeset 25930 eae8b7490d2c
parent 25715 d5a8dbdc5150
child 27012 f8fdfab4757b
equal deleted inserted replaced
25929:4fd732076fe1 25930:eae8b7490d2c
  1281   return 0;  // absolute addressing, no offset
  1281   return 0;  // absolute addressing, no offset
  1282 }
  1282 }
  1283 
  1283 
  1284 bool MachConstantBaseNode::requires_postalloc_expand() const { return true; }
  1284 bool MachConstantBaseNode::requires_postalloc_expand() const { return true; }
  1285 void MachConstantBaseNode::postalloc_expand(GrowableArray <Node *> *nodes, PhaseRegAlloc *ra_) {
  1285 void MachConstantBaseNode::postalloc_expand(GrowableArray <Node *> *nodes, PhaseRegAlloc *ra_) {
  1286   Compile *C = ra_->C;
       
  1287 
       
  1288   iRegPdstOper *op_dst = new iRegPdstOper();
  1286   iRegPdstOper *op_dst = new iRegPdstOper();
  1289   MachNode *m1 = new loadToc_hiNode();
  1287   MachNode *m1 = new loadToc_hiNode();
  1290   MachNode *m2 = new loadToc_loNode();
  1288   MachNode *m2 = new loadToc_loNode();
  1291 
  1289 
  1292   m1->add_req(NULL);
  1290   m1->add_req(NULL);
  2227   // Probably always true, even if a temp register is required.
  2225   // Probably always true, even if a temp register is required.
  2228   return true;
  2226   return true;
  2229 }
  2227 }
  2230 /* TODO: PPC port
  2228 /* TODO: PPC port
  2231 // Make a new machine dependent decode node (with its operands).
  2229 // Make a new machine dependent decode node (with its operands).
  2232 MachTypeNode *Matcher::make_decode_node(Compile *C) {
  2230 MachTypeNode *Matcher::make_decode_node() {
  2233   assert(Universe::narrow_oop_base() == NULL && Universe::narrow_oop_shift() == 0,
  2231   assert(Universe::narrow_oop_base() == NULL && Universe::narrow_oop_shift() == 0,
  2234          "This method is only implemented for unscaled cOops mode so far");
  2232          "This method is only implemented for unscaled cOops mode so far");
  2235   MachTypeNode *decode = new decodeN_unscaledNode();
  2233   MachTypeNode *decode = new decodeN_unscaledNode();
  2236   decode->set_opnd_array(0, new iRegPdstOper());
  2234   decode->set_opnd_array(0, new iRegPdstOper());
  2237   decode->set_opnd_array(1, new iRegNsrcOper());
  2235   decode->set_opnd_array(1, new iRegNsrcOper());
  2591   loadConL_loNode *_large_lo;
  2589   loadConL_loNode *_large_lo;
  2592   loadConLNode    *_small;
  2590   loadConLNode    *_small;
  2593   MachNode        *_last;
  2591   MachNode        *_last;
  2594 } loadConLNodesTuple;
  2592 } loadConLNodesTuple;
  2595 
  2593 
  2596 loadConLNodesTuple loadConLNodesTuple_create(Compile *C, PhaseRegAlloc *ra_, Node *toc, immLOper *immSrc,
  2594 loadConLNodesTuple loadConLNodesTuple_create(PhaseRegAlloc *ra_, Node *toc, immLOper *immSrc,
  2597                                              OptoReg::Name reg_second, OptoReg::Name reg_first) {
  2595                                              OptoReg::Name reg_second, OptoReg::Name reg_first) {
  2598   loadConLNodesTuple nodes;
  2596   loadConLNodesTuple nodes;
  2599 
  2597 
  2600   const bool large_constant_pool = true; // TODO: PPC port C->cfg()->_consts_size > 4000;
  2598   const bool large_constant_pool = true; // TODO: PPC port C->cfg()->_consts_size > 4000;
  2601   if (large_constant_pool) {
  2599   if (large_constant_pool) {
  2667   // Enc_class needed as consttanttablebase is not supported by postalloc
  2665   // Enc_class needed as consttanttablebase is not supported by postalloc
  2668   // expand.
  2666   // expand.
  2669   enc_class postalloc_expand_load_long_constant(iRegLdst dst, immL src, iRegLdst toc) %{
  2667   enc_class postalloc_expand_load_long_constant(iRegLdst dst, immL src, iRegLdst toc) %{
  2670     // Create new nodes.
  2668     // Create new nodes.
  2671     loadConLNodesTuple loadConLNodes =
  2669     loadConLNodesTuple loadConLNodes =
  2672       loadConLNodesTuple_create(C, ra_, n_toc, op_src,
  2670       loadConLNodesTuple_create(ra_, n_toc, op_src,
  2673                                 ra_->get_reg_second(this), ra_->get_reg_first(this));
  2671                                 ra_->get_reg_second(this), ra_->get_reg_first(this));
  2674 
  2672 
  2675     // Push new nodes.
  2673     // Push new nodes.
  2676     if (loadConLNodes._large_hi) nodes->push(loadConLNodes._large_hi);
  2674     if (loadConLNodes._large_hi) nodes->push(loadConLNodes._large_hi);
  2677     if (loadConLNodes._last)     nodes->push(loadConLNodes._last);
  2675     if (loadConLNodes._last)     nodes->push(loadConLNodes._last);
  3389 
  3387 
  3390     // Make an operand with the bit pattern to load as float.
  3388     // Make an operand with the bit pattern to load as float.
  3391     immLOper *op_repl = new immLOper((jlong)replicate_immF(op_src->constantF()));
  3389     immLOper *op_repl = new immLOper((jlong)replicate_immF(op_src->constantF()));
  3392 
  3390 
  3393     loadConLNodesTuple loadConLNodes =
  3391     loadConLNodesTuple loadConLNodes =
  3394       loadConLNodesTuple_create(C, ra_, n_toc, op_repl,
  3392       loadConLNodesTuple_create(ra_, n_toc, op_repl,
  3395                                 ra_->get_reg_second(this), ra_->get_reg_first(this));
  3393                                 ra_->get_reg_second(this), ra_->get_reg_first(this));
  3396 
  3394 
  3397     // Push new nodes.
  3395     // Push new nodes.
  3398     if (loadConLNodes._large_hi) nodes->push(loadConLNodes._large_hi);
  3396     if (loadConLNodes._large_hi) nodes->push(loadConLNodes._large_hi);
  3399     if (loadConLNodes._last)     nodes->push(loadConLNodes._last);
  3397     if (loadConLNodes._last)     nodes->push(loadConLNodes._last);
  3609   // postalloc expand emitter for virtual calls.
  3607   // postalloc expand emitter for virtual calls.
  3610   enc_class postalloc_expand_java_dynamic_call_sched(method meth, iRegLdst toc) %{
  3608   enc_class postalloc_expand_java_dynamic_call_sched(method meth, iRegLdst toc) %{
  3611 
  3609 
  3612     // Create the nodes for loading the IC from the TOC.
  3610     // Create the nodes for loading the IC from the TOC.
  3613     loadConLNodesTuple loadConLNodes_IC =
  3611     loadConLNodesTuple loadConLNodes_IC =
  3614       loadConLNodesTuple_create(C, ra_, n_toc, new immLOper((jlong)Universe::non_oop_word()),
  3612       loadConLNodesTuple_create(ra_, n_toc, new immLOper((jlong)Universe::non_oop_word()),
  3615                                 OptoReg::Name(R19_H_num), OptoReg::Name(R19_num));
  3613                                 OptoReg::Name(R19_H_num), OptoReg::Name(R19_num));
  3616 
  3614 
  3617     // Create the call node.
  3615     // Create the call node.
  3618     CallDynamicJavaDirectSchedNode *call = new CallDynamicJavaDirectSchedNode();
  3616     CallDynamicJavaDirectSchedNode *call = new CallDynamicJavaDirectSchedNode();
  3619     call->_method_handle_invoke = _method_handle_invoke;
  3617     call->_method_handle_invoke = _method_handle_invoke;
  3763   enc_class postalloc_expand_java_to_runtime_call(method meth, iRegLdst toc) %{
  3761   enc_class postalloc_expand_java_to_runtime_call(method meth, iRegLdst toc) %{
  3764     loadConLNodesTuple loadConLNodes_Entry;
  3762     loadConLNodesTuple loadConLNodes_Entry;
  3765 #if defined(ABI_ELFv2)
  3763 #if defined(ABI_ELFv2)
  3766     jlong entry_address = (jlong) this->entry_point();
  3764     jlong entry_address = (jlong) this->entry_point();
  3767     assert(entry_address, "need address here");
  3765     assert(entry_address, "need address here");
  3768     loadConLNodes_Entry = loadConLNodesTuple_create(C, ra_, n_toc, new immLOper(entry_address),
  3766     loadConLNodes_Entry = loadConLNodesTuple_create(ra_, n_toc, new immLOper(entry_address),
  3769                                                     OptoReg::Name(R12_H_num), OptoReg::Name(R12_num));
  3767                                                     OptoReg::Name(R12_H_num), OptoReg::Name(R12_num));
  3770 #else
  3768 #else
  3771     // Get the struct that describes the function we are about to call.
  3769     // Get the struct that describes the function we are about to call.
  3772     FunctionDescriptor* fd = (FunctionDescriptor*) this->entry_point();
  3770     FunctionDescriptor* fd = (FunctionDescriptor*) this->entry_point();
  3773     assert(fd, "need fd here");
  3771     assert(fd, "need fd here");
  3775     // new nodes
  3773     // new nodes
  3776     loadConLNodesTuple loadConLNodes_Env;
  3774     loadConLNodesTuple loadConLNodes_Env;
  3777     loadConLNodesTuple loadConLNodes_Toc;
  3775     loadConLNodesTuple loadConLNodes_Toc;
  3778 
  3776 
  3779     // Create nodes and operands for loading the entry point.
  3777     // Create nodes and operands for loading the entry point.
  3780     loadConLNodes_Entry = loadConLNodesTuple_create(C, ra_, n_toc, new immLOper(entry_address),
  3778     loadConLNodes_Entry = loadConLNodesTuple_create(ra_, n_toc, new immLOper(entry_address),
  3781                                                     OptoReg::Name(R12_H_num), OptoReg::Name(R12_num));
  3779                                                     OptoReg::Name(R12_H_num), OptoReg::Name(R12_num));
  3782 
  3780 
  3783 
  3781 
  3784     // Create nodes and operands for loading the env pointer.
  3782     // Create nodes and operands for loading the env pointer.
  3785     if (fd->env() != NULL) {
  3783     if (fd->env() != NULL) {
  3786       loadConLNodes_Env = loadConLNodesTuple_create(C, ra_, n_toc, new immLOper((jlong) fd->env()),
  3784       loadConLNodes_Env = loadConLNodesTuple_create(ra_, n_toc, new immLOper((jlong) fd->env()),
  3787                                                     OptoReg::Name(R11_H_num), OptoReg::Name(R11_num));
  3785                                                     OptoReg::Name(R11_H_num), OptoReg::Name(R11_num));
  3788     } else {
  3786     } else {
  3789       loadConLNodes_Env._large_hi = NULL;
  3787       loadConLNodes_Env._large_hi = NULL;
  3790       loadConLNodes_Env._large_lo = NULL;
  3788       loadConLNodes_Env._large_lo = NULL;
  3791       loadConLNodes_Env._small    = NULL;
  3789       loadConLNodes_Env._small    = NULL;
  3794       loadConLNodes_Env._last->_opnds[1] = new immL16Oper(0);
  3792       loadConLNodes_Env._last->_opnds[1] = new immL16Oper(0);
  3795       ra_->set_pair(loadConLNodes_Env._last->_idx, OptoReg::Name(R11_H_num), OptoReg::Name(R11_num));
  3793       ra_->set_pair(loadConLNodes_Env._last->_idx, OptoReg::Name(R11_H_num), OptoReg::Name(R11_num));
  3796     }
  3794     }
  3797 
  3795 
  3798     // Create nodes and operands for loading the Toc point.
  3796     // Create nodes and operands for loading the Toc point.
  3799     loadConLNodes_Toc = loadConLNodesTuple_create(C, ra_, n_toc, new immLOper((jlong) fd->toc()),
  3797     loadConLNodes_Toc = loadConLNodesTuple_create(ra_, n_toc, new immLOper((jlong) fd->toc()),
  3800                                                   OptoReg::Name(R2_H_num), OptoReg::Name(R2_num));
  3798                                                   OptoReg::Name(R2_H_num), OptoReg::Name(R2_num));
  3801 #endif // ABI_ELFv2
  3799 #endif // ABI_ELFv2
  3802     // mtctr node
  3800     // mtctr node
  3803     MachNode *mtctr = new CallLeafDirect_mtctrNode();
  3801     MachNode *mtctr = new CallLeafDirect_mtctrNode();
  3804 
  3802