Path: blob/master/src/hotspot/cpu/x86/c2_init_x86.cpp
41144 views
/*1* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#include "precompiled.hpp"25#include "opto/compile.hpp"26#include "opto/node.hpp"27#include "opto/optoreg.hpp"28#include "runtime/vm_version.hpp"2930// processor dependent initialization for i4863132extern void reg_mask_init();3334void Compile::pd_compiler2_init() {35guarantee(CodeEntryAlignment >= InteriorEntryAlignment, "" );36// QQQ presumably all 64bit cpu's support this. Seems like the ifdef could37// simply be left out.38#ifndef AMD6439if (!VM_Version::supports_cmov()) {40ConditionalMoveLimit = 0;41}42#endif // AMD644344if (UseAVX < 3) {45int delta = XMMRegisterImpl::max_slots_per_register * XMMRegisterImpl::number_of_registers;46int bottom = ConcreteRegisterImpl::max_fpr;47int top = bottom + delta;48int middle = bottom + (delta / 2);49int xmm_slots = XMMRegisterImpl::max_slots_per_register;50int 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 array52// Note: vm2opto is allocated to ConcreteRegisterImpl::number_of_registers53for (int i = bottom; i < middle; i += xmm_slots) {54for (OptoReg::Name j = OptoReg::Name(i + lower); j<OptoReg::Name(i + xmm_slots); j = OptoReg::add(j, 1)) {55OptoReg::invalidate(j);56}57}58// mark the upper zmm bank bad and all the mask registers bad in this case59for (OptoReg::Name i = OptoReg::Name(middle); i<OptoReg::Name(_last_Mach_Reg - 1); i = OptoReg::add(i, 1)) {60OptoReg::invalidate(i);61}62}63reg_mask_init();64}656667