hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.hpp
author mdoerr
Fri, 18 Mar 2016 12:50:17 +0100
changeset 37275 a8858401c5f9
parent 35594 cc13089c6327
permissions -rw-r--r--
8152172: PPC64: Support AES intrinsics Reviewed-by: kvn, mdoerr, simonis Contributed-by: horii@jp.ibm.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35085
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
     1
/*
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
     2
 * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
35594
cc13089c6327 8147937: Adapt SAP copyrights to new company name.
goetz
parents: 35085
diff changeset
     3
 * Copyright (c) 2012, 2015 SAP SE. All rights reserved.
35085
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
     4
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
     5
 *
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
     6
 * This code is free software; you can redistribute it and/or modify it
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
     7
 * under the terms of the GNU General Public License version 2 only, as
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
     8
 * published by the Free Software Foundation.
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
     9
 *
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    14
 * accompanied this code).
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    15
 *
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    19
 *
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    20
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    21
 * or visit www.oracle.com if you need additional information or have any
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    22
 * questions.
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    23
 *
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    24
 */
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    25
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    26
#ifndef CPU_PPC_VM_C1_LINEARSCAN_PPC_HPP
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    27
#define CPU_PPC_VM_C1_LINEARSCAN_PPC_HPP
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    28
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    29
inline bool LinearScan::is_processed_reg_num(int reg_num) {
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    30
  assert(FrameMap::R0_opr->cpu_regnr() == FrameMap::last_cpu_reg() + 1, "wrong assumption below");
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    31
  assert(FrameMap::R1_opr->cpu_regnr() == FrameMap::last_cpu_reg() + 2, "wrong assumption below");
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    32
  assert(FrameMap::R13_opr->cpu_regnr() == FrameMap::last_cpu_reg() + 3, "wrong assumption below");
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    33
  assert(FrameMap::R16_opr->cpu_regnr() == FrameMap::last_cpu_reg() + 4, "wrong assumption below");
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    34
  assert(FrameMap::R29_opr->cpu_regnr() == FrameMap::last_cpu_reg() + 5, "wrong assumption below");
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    35
  return reg_num <= FrameMap::last_cpu_reg() || reg_num >= pd_nof_cpu_regs_frame_map;
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    36
}
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    37
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    38
inline int LinearScan::num_physical_regs(BasicType type) {
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    39
  return 1;
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    40
}
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    41
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    42
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    43
inline bool LinearScan::requires_adjacent_regs(BasicType type) {
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    44
  return false;
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    45
}
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    46
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    47
inline bool LinearScan::is_caller_save(int assigned_reg) {
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    48
  return true; // assigned_reg < pd_first_callee_saved_reg;
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    49
}
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    50
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    51
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    52
inline void LinearScan::pd_add_temps(LIR_Op* op) {
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    53
  // No special case behaviours yet
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    54
}
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    55
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    56
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    57
inline bool LinearScanWalker::pd_init_regs_for_alloc(Interval* cur) {
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    58
  if (allocator()->gen()->is_vreg_flag_set(cur->reg_num(), LIRGenerator::callee_saved)) {
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    59
    assert(cur->type() != T_FLOAT && cur->type() != T_DOUBLE, "cpu regs only");
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    60
    _first_reg = pd_first_callee_saved_reg;
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    61
    _last_reg = pd_last_callee_saved_reg;
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    62
    ShouldNotReachHere(); // Currently no callee saved regs.
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    63
    return true;
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    64
  } else if (cur->type() == T_INT || cur->type() == T_LONG || cur->type() == T_OBJECT ||
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    65
             cur->type() == T_ADDRESS || cur->type() == T_METADATA) {
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    66
    _first_reg = pd_first_cpu_reg;
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    67
    _last_reg = pd_last_cpu_reg;
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    68
    return true;
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    69
  }
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    70
  return false;
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    71
}
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    72
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents:
diff changeset
    73
#endif // CPU_PPC_VM_C1_LINEARSCAN_PPC_HPP