< prev index next >

src/hotspot/cpu/x86/c2_init_x86.cpp

Print this page
rev 53861 : 8219486: Missing reg_mask_init() breaks x86_32 build


  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "opto/compile.hpp"
  27 #include "opto/node.hpp"
  28 #include "opto/optoreg.hpp"
  29 
  30 // processor dependent initialization for i486
  31 

  32 extern void reg_mask_init();

  33 
  34 void Compile::pd_compiler2_init() {
  35   guarantee(CodeEntryAlignment >= InteriorEntryAlignment, "" );
  36   // QQQ presumably all 64bit cpu's support this. Seems like the ifdef could
  37   // simply be left out.
  38 #ifndef AMD64
  39   if (!VM_Version::supports_cmov()) {
  40     ConditionalMoveLimit = 0;
  41   }
  42 #endif // AMD64
  43 
  44   if (UseAVX < 3) {
  45     int delta = XMMRegisterImpl::max_slots_per_register * XMMRegisterImpl::number_of_registers;
  46     int bottom = ConcreteRegisterImpl::max_fpr;
  47     int top = bottom + delta;
  48     int middle = bottom + (delta / 2);
  49     int xmm_slots = XMMRegisterImpl::max_slots_per_register;
  50     int lower = xmm_slots / 2;
  51     // mark bad every register that we cannot get to if AVX less than 3, we have all slots in the array
  52     // Note: vm2opto is allocated to ConcreteRegisterImpl::number_of_registers
  53     for (int i = bottom; i < middle; i += xmm_slots) {
  54       for (OptoReg::Name j = OptoReg::Name(i + lower); j<OptoReg::Name(i + xmm_slots); j = OptoReg::add(j, 1)) {
  55         OptoReg::invalidate(j);
  56       }
  57     }
  58     // mark the upper zmm bank bad and all the mask registers bad in this case
  59     for (OptoReg::Name i = OptoReg::Name(middle); i<OptoReg::Name(_last_Mach_Reg - 1); i = OptoReg::add(i, 1)) {
  60       OptoReg::invalidate(i);
  61     }
  62   }

  63   reg_mask_init();

  64 }


  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "opto/compile.hpp"
  27 #include "opto/node.hpp"
  28 #include "opto/optoreg.hpp"
  29 
  30 // processor dependent initialization for i486
  31 
  32 #ifdef _LP64
  33 extern void reg_mask_init();
  34 #endif
  35 
  36 void Compile::pd_compiler2_init() {
  37   guarantee(CodeEntryAlignment >= InteriorEntryAlignment, "" );
  38   // QQQ presumably all 64bit cpu's support this. Seems like the ifdef could
  39   // simply be left out.
  40 #ifndef AMD64
  41   if (!VM_Version::supports_cmov()) {
  42     ConditionalMoveLimit = 0;
  43   }
  44 #endif // AMD64
  45 
  46   if (UseAVX < 3) {
  47     int delta = XMMRegisterImpl::max_slots_per_register * XMMRegisterImpl::number_of_registers;
  48     int bottom = ConcreteRegisterImpl::max_fpr;
  49     int top = bottom + delta;
  50     int middle = bottom + (delta / 2);
  51     int xmm_slots = XMMRegisterImpl::max_slots_per_register;
  52     int lower = xmm_slots / 2;
  53     // mark bad every register that we cannot get to if AVX less than 3, we have all slots in the array
  54     // Note: vm2opto is allocated to ConcreteRegisterImpl::number_of_registers
  55     for (int i = bottom; i < middle; i += xmm_slots) {
  56       for (OptoReg::Name j = OptoReg::Name(i + lower); j<OptoReg::Name(i + xmm_slots); j = OptoReg::add(j, 1)) {
  57         OptoReg::invalidate(j);
  58       }
  59     }
  60     // mark the upper zmm bank bad and all the mask registers bad in this case
  61     for (OptoReg::Name i = OptoReg::Name(middle); i<OptoReg::Name(_last_Mach_Reg - 1); i = OptoReg::add(i, 1)) {
  62       OptoReg::invalidate(i);
  63     }
  64   }
  65 #ifdef _LP64
  66   reg_mask_init();
  67 #endif
  68 }
< prev index next >