Path: blob/master/src/hotspot/cpu/ppc/c1_LinearScan_ppc.hpp
40930 views
/*1* Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.2* Copyright (c) 2012, 2015 SAP SE. All rights reserved.3* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.4*5* This code is free software; you can redistribute it and/or modify it6* under the terms of the GNU General Public License version 2 only, as7* published by the Free Software Foundation.8*9* This code is distributed in the hope that it will be useful, but WITHOUT10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12* version 2 for more details (a copy is included in the LICENSE file that13* accompanied this code).14*15* You should have received a copy of the GNU General Public License version16* 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 USA20* or visit www.oracle.com if you need additional information or have any21* questions.22*23*/2425#ifndef CPU_PPC_C1_LINEARSCAN_PPC_HPP26#define CPU_PPC_C1_LINEARSCAN_PPC_HPP2728inline bool LinearScan::is_processed_reg_num(int reg_num) {29assert(FrameMap::R0_opr->cpu_regnr() == FrameMap::last_cpu_reg() + 1, "wrong assumption below");30assert(FrameMap::R1_opr->cpu_regnr() == FrameMap::last_cpu_reg() + 2, "wrong assumption below");31assert(FrameMap::R13_opr->cpu_regnr() == FrameMap::last_cpu_reg() + 3, "wrong assumption below");32assert(FrameMap::R16_opr->cpu_regnr() == FrameMap::last_cpu_reg() + 4, "wrong assumption below");33assert(FrameMap::R29_opr->cpu_regnr() == FrameMap::last_cpu_reg() + 5, "wrong assumption below");34return reg_num <= FrameMap::last_cpu_reg() || reg_num >= pd_nof_cpu_regs_frame_map;35}3637inline int LinearScan::num_physical_regs(BasicType type) {38return 1;39}404142inline bool LinearScan::requires_adjacent_regs(BasicType type) {43return false;44}4546inline bool LinearScan::is_caller_save(int assigned_reg) {47return true; // assigned_reg < pd_first_callee_saved_reg;48}495051inline void LinearScan::pd_add_temps(LIR_Op* op) {52// No special case behaviours yet53}545556inline bool LinearScanWalker::pd_init_regs_for_alloc(Interval* cur) {57if (allocator()->gen()->is_vreg_flag_set(cur->reg_num(), LIRGenerator::callee_saved)) {58assert(cur->type() != T_FLOAT && cur->type() != T_DOUBLE, "cpu regs only");59_first_reg = pd_first_callee_saved_reg;60_last_reg = pd_last_callee_saved_reg;61ShouldNotReachHere(); // Currently no callee saved regs.62return true;63} else if (cur->type() == T_INT || cur->type() == T_LONG || cur->type() == T_OBJECT ||64cur->type() == T_ADDRESS || cur->type() == T_METADATA) {65_first_reg = pd_first_cpu_reg;66_last_reg = pd_last_cpu_reg;67return true;68}69return false;70}7172#endif // CPU_PPC_C1_LINEARSCAN_PPC_HPP737475