src/hotspot/cpu/ppc/c1_LIR_ppc.cpp
author erikj
Tue, 12 Sep 2017 19:03:39 +0200
changeset 47216 71c04702a3d5
parent 40071 hotspot/src/cpu/ppc/vm/c1_LIR_ppc.cpp@53e12df44b7b
permissions -rw-r--r--
8187443: Forest Consolidation: Move files to unified layout Reviewed-by: darcy, ihse
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
40071
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
     1
/*
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
     2
 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
     3
 * Copyright (c) 2016 SAP SE. All rights reserved.
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
     4
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
     5
 *
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
     6
 * This code is free software; you can redistribute it and/or modify it
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
     7
 * under the terms of the GNU General Public License version 2 only, as
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
     8
 * published by the Free Software Foundation.
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
     9
 *
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    14
 * accompanied this code).
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    15
 *
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    19
 *
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    20
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    21
 * or visit www.oracle.com if you need additional information or have any
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    22
 * questions.
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    23
 *
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    24
 */
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    25
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    26
#include "precompiled.hpp"
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    27
#include "asm/register.hpp"
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    28
#include "c1/c1_LIR.hpp"
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    29
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    30
FloatRegister LIR_OprDesc::as_float_reg() const {
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    31
  return as_FloatRegister(fpu_regnr());
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    32
}
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    33
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    34
FloatRegister LIR_OprDesc::as_double_reg() const {
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    35
  return as_FloatRegister(fpu_regnrLo());
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    36
}
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    37
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    38
// Reg2 unused.
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    39
LIR_Opr LIR_OprFact::double_fpu(int reg1, int reg2) {
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    40
  assert(!as_FloatRegister(reg2)->is_valid(), "Not used on this platform");
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    41
  return (LIR_Opr)(intptr_t)((reg1 << LIR_OprDesc::reg1_shift) |
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    42
                             (reg1 << LIR_OprDesc::reg2_shift) |
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    43
                             LIR_OprDesc::double_type          |
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    44
                             LIR_OprDesc::fpu_register         |
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    45
                             LIR_OprDesc::double_size);
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    46
}
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    47
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    48
#ifndef PRODUCT
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    49
void LIR_Address::verify() const {
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    50
  assert(scale() == times_1, "Scaled addressing mode not available on PPC and should not be used");
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    51
  assert(disp() == 0 || index()->is_illegal(), "can't have both");
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    52
#ifdef _LP64
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    53
  assert(base()->is_cpu_register(), "wrong base operand");
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    54
  assert(index()->is_illegal() || index()->is_double_cpu(), "wrong index operand");
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    55
  assert(base()->type() == T_OBJECT || base()->type() == T_LONG || base()->type() == T_METADATA,
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    56
         "wrong type for addresses");
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    57
#else
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    58
  assert(base()->is_single_cpu(), "wrong base operand");
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    59
  assert(index()->is_illegal() || index()->is_single_cpu(), "wrong index operand");
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    60
  assert(base()->type() == T_OBJECT || base()->type() == T_INT || base()->type() == T_METADATA,
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    61
         "wrong type for addresses");
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    62
#endif
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    63
}
53e12df44b7b 8160245: C1: Clean up platform #defines in c1_LIR.hpp.
goetz
parents:
diff changeset
    64
#endif // PRODUCT