hotspot/src/cpu/s390/vm/register_s390.hpp
author coleenp
Thu, 01 Dec 2016 14:21:31 -0500
changeset 44738 11431bbc9549
parent 42065 6032b31e3719
permissions -rw-r--r--
8168699: Validate special case invocations Reviewed-by: acorn, kvn, lfoltan, ctornqvi, ahgross, vlivanov
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
42065
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
     1
/*
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
     2
 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
     3
 * Copyright (c) 2016 SAP SE. All rights reserved.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
     4
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
     5
 *
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
     6
 * This code is free software; you can redistribute it and/or modify it
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
     7
 * under the terms of the GNU General Public License version 2 only, as
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
     8
 * published by the Free Software Foundation.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
     9
 *
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    14
 * accompanied this code).
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    15
 *
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    19
 *
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    20
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    21
 * or visit www.oracle.com if you need additional information or have any
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    22
 * questions.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    23
 *
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    24
 */
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    25
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    26
#ifndef CPU_S390_VM_REGISTER_S390_HPP
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    27
#define CPU_S390_VM_REGISTER_S390_HPP
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    28
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    29
#include "asm/register.hpp"
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    30
#include "vm_version_s390.hpp"
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    31
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    32
class Address;
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    33
class VMRegImpl;
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    34
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    35
typedef VMRegImpl* VMReg;
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    36
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    37
// Use Register as shortcut.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    38
class RegisterImpl;
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    39
typedef RegisterImpl* Register;
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    40
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    41
// The implementation of integer registers for z/Architecture.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    42
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    43
// z/Architecture registers, see "LINUX for zSeries ELF ABI Supplement", IBM March 2001
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    44
//
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    45
//   r0-r1     General purpose (volatile)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    46
//   r2        Parameter and return value (volatile)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    47
//   r3        TOC pointer (volatile)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    48
//   r3-r5     Parameters (volatile)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    49
//   r6        Parameter (nonvolatile)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    50
//   r7-r11    Locals (nonvolatile)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    51
//   r12       Local, often used as GOT pointer (nonvolatile)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    52
//   r13       Local, often used as toc (nonvolatile)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    53
//   r14       return address (volatile)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    54
//   r15       stack pointer (nonvolatile)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    55
//
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    56
//   f0,f2,f4,f6 Parameters (volatile)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    57
//   f1,f3,f5,f7 General purpose (volatile)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    58
//   f8-f15      General purpose (nonvolatile)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    59
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    60
inline Register as_Register(int encoding) {
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    61
  return (Register)(long)encoding;
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    62
}
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    63
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    64
class RegisterImpl: public AbstractRegisterImpl {
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    65
 public:
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    66
  enum {
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    67
    number_of_registers     = 16,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    68
    number_of_arg_registers = 5
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    69
  };
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    70
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    71
  // general construction
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    72
  inline friend Register as_Register(int encoding);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    73
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    74
  inline VMReg as_VMReg();
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    75
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    76
  // accessors
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    77
  int   encoding() const      { assert(is_valid(), "invalid register"); return value(); }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    78
  const char* name() const;
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    79
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    80
  // testers
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    81
  bool is_valid() const       { return (0 <= (value()&0x7F) && (value()&0x7F) < number_of_registers); }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    82
  bool is_even() const        { return (encoding() & 1) == 0; }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    83
  bool is_volatile() const    { return (0 <= (value()&0x7F) && (value()&0x7F) <= 5) || (value()&0x7F)==14; }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    84
  bool is_nonvolatile() const { return is_valid() && !is_volatile(); }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    85
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    86
 public:
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    87
  // derived registers, offsets, and addresses
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    88
  Register predecessor() const { return as_Register((encoding()-1) & (number_of_registers-1)); }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    89
  Register successor() const   { return as_Register((encoding() + 1) & (number_of_registers-1)); }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    90
};
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    91
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    92
// The integer registers of the z/Architecture.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    93
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    94
CONSTANT_REGISTER_DECLARATION(Register, noreg, (-1));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    95
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    96
CONSTANT_REGISTER_DECLARATION(Register, Z_R0,   (0));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    97
CONSTANT_REGISTER_DECLARATION(Register, Z_R1,   (1));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    98
CONSTANT_REGISTER_DECLARATION(Register, Z_R2,   (2));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    99
CONSTANT_REGISTER_DECLARATION(Register, Z_R3,   (3));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   100
CONSTANT_REGISTER_DECLARATION(Register, Z_R4,   (4));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   101
CONSTANT_REGISTER_DECLARATION(Register, Z_R5,   (5));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   102
CONSTANT_REGISTER_DECLARATION(Register, Z_R6,   (6));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   103
CONSTANT_REGISTER_DECLARATION(Register, Z_R7,   (7));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   104
CONSTANT_REGISTER_DECLARATION(Register, Z_R8,   (8));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   105
CONSTANT_REGISTER_DECLARATION(Register, Z_R9,   (9));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   106
CONSTANT_REGISTER_DECLARATION(Register, Z_R10, (10));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   107
CONSTANT_REGISTER_DECLARATION(Register, Z_R11, (11));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   108
CONSTANT_REGISTER_DECLARATION(Register, Z_R12, (12));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   109
CONSTANT_REGISTER_DECLARATION(Register, Z_R13, (13));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   110
CONSTANT_REGISTER_DECLARATION(Register, Z_R14, (14));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   111
CONSTANT_REGISTER_DECLARATION(Register, Z_R15, (15));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   112
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   113
// Use ConditionRegister as shortcut
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   114
class ConditionRegisterImpl;
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   115
typedef ConditionRegisterImpl* ConditionRegister;
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   116
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   117
// The implementation of condition register(s) for the z/Architecture.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   118
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   119
class ConditionRegisterImpl: public AbstractRegisterImpl {
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   120
 public:
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   121
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   122
  enum {
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   123
    number_of_registers = 1
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   124
  };
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   125
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   126
  // accessors
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   127
  int encoding() const {
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   128
    assert(is_valid(), "invalid register"); return value();
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   129
  }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   130
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   131
  // testers
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   132
  bool is_valid() const {
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   133
    return (0 <= value() && value() < number_of_registers);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   134
  }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   135
  bool is_volatile() const {
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   136
    return true;
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   137
  }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   138
  bool is_nonvolatile() const {
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   139
    return false;
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   140
  }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   141
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   142
  // construction.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   143
  inline friend ConditionRegister as_ConditionRegister(int encoding);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   144
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   145
  inline VMReg as_VMReg();
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   146
};
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   147
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   148
inline ConditionRegister as_ConditionRegister(int encoding) {
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   149
  assert(encoding >= 0 && encoding < ConditionRegisterImpl::number_of_registers, "bad condition register encoding");
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   150
  return (ConditionRegister)(long)encoding;
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   151
}
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   152
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   153
// The condition register of the z/Architecture.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   154
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   155
CONSTANT_REGISTER_DECLARATION(ConditionRegister, Z_CR, (0));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   156
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   157
// Because z/Architecture has so many registers, #define'ing values for them is
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   158
// beneficial in code size and is worth the cost of some of the
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   159
// dangers of defines.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   160
// If a particular file has a problem with these defines then it's possible
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   161
// to turn them off in that file by defining
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   162
// DONT_USE_REGISTER_DEFINES. Register_definition_s390.cpp does that
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   163
// so that it's able to provide real definitions of these registers
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   164
// for use in debuggers and such.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   165
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   166
#ifndef DONT_USE_REGISTER_DEFINES
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   167
#define noreg ((Register)(noreg_RegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   168
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   169
#define Z_R0  ((Register)(Z_R0_RegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   170
#define Z_R1  ((Register)(Z_R1_RegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   171
#define Z_R2  ((Register)(Z_R2_RegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   172
#define Z_R3  ((Register)(Z_R3_RegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   173
#define Z_R4  ((Register)(Z_R4_RegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   174
#define Z_R5  ((Register)(Z_R5_RegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   175
#define Z_R6  ((Register)(Z_R6_RegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   176
#define Z_R7  ((Register)(Z_R7_RegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   177
#define Z_R8  ((Register)(Z_R8_RegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   178
#define Z_R9  ((Register)(Z_R9_RegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   179
#define Z_R10 ((Register)(Z_R10_RegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   180
#define Z_R11 ((Register)(Z_R11_RegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   181
#define Z_R12 ((Register)(Z_R12_RegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   182
#define Z_R13 ((Register)(Z_R13_RegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   183
#define Z_R14 ((Register)(Z_R14_RegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   184
#define Z_R15 ((Register)(Z_R15_RegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   185
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   186
#define Z_CR ((ConditionRegister)(Z_CR_ConditionRegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   187
#endif // DONT_USE_REGISTER_DEFINES
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   188
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   189
// Use FloatRegister as shortcut
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   190
class FloatRegisterImpl;
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   191
typedef FloatRegisterImpl* FloatRegister;
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   192
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   193
// The implementation of float registers for the z/Architecture.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   194
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   195
inline FloatRegister as_FloatRegister(int encoding) {
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   196
  return (FloatRegister)(long)encoding;
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   197
}
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   198
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   199
class FloatRegisterImpl: public AbstractRegisterImpl {
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   200
 public:
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   201
  enum {
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   202
    number_of_registers     = 16,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   203
    number_of_arg_registers = 4
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   204
  };
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   205
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   206
  // construction
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   207
  inline friend FloatRegister as_FloatRegister(int encoding);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   208
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   209
  inline VMReg as_VMReg();
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   210
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   211
  // accessors
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   212
  int encoding() const                                {
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   213
     assert(is_valid(), "invalid register"); return value();
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   214
  }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   215
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   216
  bool  is_valid() const          { return 0 <= value() && value() < number_of_registers; }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   217
  bool is_volatile() const        { return (0 <= (value()&0x7F) && (value()&0x7F) <= 7); }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   218
  bool is_nonvolatile() const     { return (8 <= (value()&0x7F) && (value()&0x7F) <= 15); }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   219
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   220
  const char* name() const;
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   221
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   222
  FloatRegister successor() const { return as_FloatRegister(encoding() + 1); }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   223
};
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   224
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   225
// The float registers of z/Architecture.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   226
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   227
CONSTANT_REGISTER_DECLARATION(FloatRegister, fnoreg, (-1));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   228
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   229
CONSTANT_REGISTER_DECLARATION(FloatRegister,  Z_F0,  (0));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   230
CONSTANT_REGISTER_DECLARATION(FloatRegister,  Z_F1,  (1));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   231
CONSTANT_REGISTER_DECLARATION(FloatRegister,  Z_F2,  (2));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   232
CONSTANT_REGISTER_DECLARATION(FloatRegister,  Z_F3,  (3));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   233
CONSTANT_REGISTER_DECLARATION(FloatRegister,  Z_F4,  (4));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   234
CONSTANT_REGISTER_DECLARATION(FloatRegister,  Z_F5,  (5));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   235
CONSTANT_REGISTER_DECLARATION(FloatRegister,  Z_F6,  (6));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   236
CONSTANT_REGISTER_DECLARATION(FloatRegister,  Z_F7,  (7));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   237
CONSTANT_REGISTER_DECLARATION(FloatRegister,  Z_F8,  (8));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   238
CONSTANT_REGISTER_DECLARATION(FloatRegister,  Z_F9,  (9));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   239
CONSTANT_REGISTER_DECLARATION(FloatRegister, Z_F10, (10));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   240
CONSTANT_REGISTER_DECLARATION(FloatRegister, Z_F11, (11));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   241
CONSTANT_REGISTER_DECLARATION(FloatRegister, Z_F12, (12));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   242
CONSTANT_REGISTER_DECLARATION(FloatRegister, Z_F13, (13));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   243
CONSTANT_REGISTER_DECLARATION(FloatRegister, Z_F14, (14));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   244
CONSTANT_REGISTER_DECLARATION(FloatRegister, Z_F15, (15));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   245
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   246
#ifndef DONT_USE_REGISTER_DEFINES
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   247
#define fnoreg ((FloatRegister)(fnoreg_FloatRegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   248
#define Z_F0  ((FloatRegister)(   Z_F0_FloatRegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   249
#define Z_F1  ((FloatRegister)(   Z_F1_FloatRegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   250
#define Z_F2  ((FloatRegister)(   Z_F2_FloatRegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   251
#define Z_F3  ((FloatRegister)(   Z_F3_FloatRegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   252
#define Z_F4  ((FloatRegister)(   Z_F4_FloatRegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   253
#define Z_F5  ((FloatRegister)(   Z_F5_FloatRegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   254
#define Z_F6  ((FloatRegister)(   Z_F6_FloatRegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   255
#define Z_F7  ((FloatRegister)(   Z_F7_FloatRegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   256
#define Z_F8  ((FloatRegister)(   Z_F8_FloatRegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   257
#define Z_F9  ((FloatRegister)(   Z_F9_FloatRegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   258
#define Z_F10 ((FloatRegister)(  Z_F10_FloatRegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   259
#define Z_F11 ((FloatRegister)(  Z_F11_FloatRegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   260
#define Z_F12 ((FloatRegister)(  Z_F12_FloatRegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   261
#define Z_F13 ((FloatRegister)(  Z_F13_FloatRegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   262
#define Z_F14 ((FloatRegister)(  Z_F14_FloatRegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   263
#define Z_F15 ((FloatRegister)(  Z_F15_FloatRegisterEnumValue))
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   264
#endif // DONT_USE_REGISTER_DEFINES
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   265
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   266
// Need to know the total number of registers of all sorts for SharedInfo.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   267
// Define a class that exports it.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   268
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   269
class ConcreteRegisterImpl : public AbstractRegisterImpl {
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   270
 public:
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   271
  enum {
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   272
    number_of_registers =
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   273
      (RegisterImpl::number_of_registers +
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   274
      FloatRegisterImpl::number_of_registers)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   275
      * 2 // register halves
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   276
      + 1 // condition code register
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   277
  };
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   278
  static const int max_gpr;
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   279
  static const int max_fpr;
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   280
};
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   281
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   282
// Single, Double and Quad fp reg classes. These exist to map the ADLC
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   283
// encoding for a floating point register, to the FloatRegister number
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   284
// desired by the macroassembler. A FloatRegister is a number between
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   285
// 0 and 31 passed around as a pointer. For ADLC, an fp register encoding
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   286
// is the actual bit encoding used by the z/Architecture hardware. When ADLC used
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   287
// the macroassembler to generate an instruction that references, e.g., a
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   288
// double fp reg, it passed the bit encoding to the macroassembler via
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   289
// as_FloatRegister, which, for double regs > 30, returns an illegal
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   290
// register number.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   291
//
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   292
// Therefore we provide the following classes for use by ADLC. Their
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   293
// sole purpose is to convert from z/Architecture register encodings to FloatRegisters.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   294
// At some future time, we might replace FloatRegister with these classes,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   295
// hence the definitions of as_xxxFloatRegister as class methods rather
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   296
// than as external inline routines.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   297
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   298
class SingleFloatRegisterImpl;
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   299
typedef SingleFloatRegisterImpl *SingleFloatRegister;
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   300
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   301
class SingleFloatRegisterImpl {
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   302
 public:
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   303
  friend FloatRegister as_SingleFloatRegister(int encoding) {
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   304
    assert(encoding < 32, "bad single float register encoding");
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   305
    return as_FloatRegister(encoding);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   306
  }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   307
};
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   308
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   309
class DoubleFloatRegisterImpl;
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   310
typedef DoubleFloatRegisterImpl *DoubleFloatRegister;
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   311
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   312
class DoubleFloatRegisterImpl {
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   313
 public:
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   314
  friend FloatRegister as_DoubleFloatRegister(int encoding) {
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   315
    assert(encoding < 32, "bad double float register encoding");
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   316
    return as_FloatRegister(((encoding & 1) << 5) | (encoding & 0x1e));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   317
  }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   318
};
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   319
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   320
class QuadFloatRegisterImpl;
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   321
typedef QuadFloatRegisterImpl *QuadFloatRegister;
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   322
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   323
class QuadFloatRegisterImpl {
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   324
 public:
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   325
  friend FloatRegister as_QuadFloatRegister(int encoding) {
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   326
    assert(encoding < 32 && ((encoding & 2) == 0), "bad quad float register encoding");
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   327
    return as_FloatRegister(((encoding & 1) << 5) | (encoding & 0x1c));
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   328
  }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   329
};
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   330
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   331
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   332
// Common register declarations used in assembler code.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   333
REGISTER_DECLARATION(Register,      Z_EXC_OOP, Z_R2);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   334
REGISTER_DECLARATION(Register,      Z_EXC_PC,  Z_R3);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   335
REGISTER_DECLARATION(Register,      Z_RET,     Z_R2);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   336
REGISTER_DECLARATION(Register,      Z_ARG1,    Z_R2);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   337
REGISTER_DECLARATION(Register,      Z_ARG2,    Z_R3);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   338
REGISTER_DECLARATION(Register,      Z_ARG3,    Z_R4);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   339
REGISTER_DECLARATION(Register,      Z_ARG4,    Z_R5);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   340
REGISTER_DECLARATION(Register,      Z_ARG5,    Z_R6);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   341
REGISTER_DECLARATION(Register,      Z_SP,     Z_R15);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   342
REGISTER_DECLARATION(FloatRegister, Z_FRET,    Z_F0);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   343
REGISTER_DECLARATION(FloatRegister, Z_FARG1,   Z_F0);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   344
REGISTER_DECLARATION(FloatRegister, Z_FARG2,   Z_F2);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   345
REGISTER_DECLARATION(FloatRegister, Z_FARG3,   Z_F4);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   346
REGISTER_DECLARATION(FloatRegister, Z_FARG4,   Z_F6);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   347
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   348
#ifndef DONT_USE_REGISTER_DEFINES
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   349
#define Z_EXC_OOP         AS_REGISTER(Register,  Z_R2)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   350
#define Z_EXC_PC          AS_REGISTER(Register,  Z_R3)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   351
#define Z_RET             AS_REGISTER(Register,  Z_R2)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   352
#define Z_ARG1            AS_REGISTER(Register,  Z_R2)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   353
#define Z_ARG2            AS_REGISTER(Register,  Z_R3)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   354
#define Z_ARG3            AS_REGISTER(Register,  Z_R4)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   355
#define Z_ARG4            AS_REGISTER(Register,  Z_R5)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   356
#define Z_ARG5            AS_REGISTER(Register,  Z_R6)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   357
#define Z_SP              AS_REGISTER(Register, Z_R15)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   358
#define Z_FRET            AS_REGISTER(FloatRegister, Z_F0)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   359
#define Z_FARG1           AS_REGISTER(FloatRegister, Z_F0)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   360
#define Z_FARG2           AS_REGISTER(FloatRegister, Z_F2)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   361
#define Z_FARG3           AS_REGISTER(FloatRegister, Z_F4)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   362
#define Z_FARG4           AS_REGISTER(FloatRegister, Z_F6)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   363
#endif
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   364
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   365
// Register declarations to be used in frame manager assembly code.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   366
// Use only non-volatile registers in order to keep values across C-calls.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   367
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   368
// Register to cache the integer value on top of the operand stack.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   369
REGISTER_DECLARATION(Register, Z_tos,         Z_R2);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   370
// Register to cache the fp value on top of the operand stack.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   371
REGISTER_DECLARATION(FloatRegister, Z_ftos,   Z_F0);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   372
// Expression stack pointer in interpreted java frame.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   373
REGISTER_DECLARATION(Register, Z_esp,         Z_R7);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   374
// Address of current thread.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   375
REGISTER_DECLARATION(Register, Z_thread,      Z_R8);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   376
// Address of current method. only valid in interpreter_entry.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   377
REGISTER_DECLARATION(Register, Z_method,      Z_R9);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   378
// Inline cache register. used by c1 and c2.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   379
REGISTER_DECLARATION(Register, Z_inline_cache,Z_R9);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   380
// Frame pointer of current interpreter frame. only valid while
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   381
// executing bytecodes.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   382
REGISTER_DECLARATION(Register, Z_fp,          Z_R9);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   383
// Address of the locals array in an interpreted java frame.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   384
REGISTER_DECLARATION(Register, Z_locals,      Z_R12);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   385
// Bytecode pointer.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   386
REGISTER_DECLARATION(Register, Z_bcp,         Z_R13);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   387
// Bytecode which is dispatched (short lived!).
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   388
REGISTER_DECLARATION(Register, Z_bytecode,    Z_R14);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   389
#ifndef DONT_USE_REGISTER_DEFINES
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   390
#define Z_tos             AS_REGISTER(Register, Z_R2)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   391
#define Z_ftos            AS_REGISTER(FloatRegister, Z_F0)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   392
#define Z_esp             AS_REGISTER(Register, Z_R7)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   393
#define Z_thread          AS_REGISTER(Register, Z_R8)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   394
#define Z_method          AS_REGISTER(Register, Z_R9)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   395
#define Z_inline_cache    AS_REGISTER(Register, Z_R9)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   396
#define Z_fp              AS_REGISTER(Register, Z_R9)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   397
#define Z_locals          AS_REGISTER(Register, Z_R12)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   398
#define Z_bcp             AS_REGISTER(Register, Z_R13)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   399
#define Z_bytecode        AS_REGISTER(Register, Z_R14)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   400
#endif
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   401
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   402
// Temporary registers to be used within frame manager. We can use
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   403
// the nonvolatiles because the call stub has saved them.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   404
// Use only non-volatile registers in order to keep values across C-calls.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   405
REGISTER_DECLARATION(Register, Z_tmp_1,  Z_R10);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   406
REGISTER_DECLARATION(Register, Z_tmp_2,  Z_R11);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   407
REGISTER_DECLARATION(Register, Z_tmp_3,  Z_R12);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   408
REGISTER_DECLARATION(Register, Z_tmp_4,  Z_R13);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   409
#ifndef DONT_USE_REGISTER_DEFINES
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   410
#define Z_tmp_1      AS_REGISTER(Register, Z_R10)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   411
#define Z_tmp_2      AS_REGISTER(Register, Z_R11)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   412
#define Z_tmp_3      AS_REGISTER(Register, Z_R12)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   413
#define Z_tmp_4      AS_REGISTER(Register, Z_R13)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   414
#endif
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   415
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   416
// Scratch registers are volatile.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   417
REGISTER_DECLARATION(Register, Z_R0_scratch, Z_R0);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   418
REGISTER_DECLARATION(Register, Z_R1_scratch, Z_R1);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   419
REGISTER_DECLARATION(FloatRegister, Z_fscratch_1, Z_F1);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   420
#ifndef DONT_USE_REGISTER_DEFINES
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   421
#define Z_R0_scratch  AS_REGISTER(Register, Z_R0)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   422
#define Z_R1_scratch  AS_REGISTER(Register, Z_R1)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   423
#define Z_fscratch_1  AS_REGISTER(FloatRegister, Z_F1)
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   424
#endif
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   425
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   426
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
   427
#endif // CPU_S390_VM_REGISTER_S390_HPP