1 /*
   2  * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
   3  * Copyright (c) 2014, Red Hat Inc. All rights reserved.
   4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5  *
   6  * This code is free software; you can redistribute it and/or modify it
   7  * under the terms of the GNU General Public License version 2 only, as
   8  * published by the Free Software Foundation.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  *
  24  */
  25 
  26 #include "precompiled.hpp"
  27 #include "asm/assembler.hpp"
  28 #include "asm/register.hpp"
  29 #include "register_aarch64.hpp"
  30 # include "interp_masm_aarch64.hpp"
  31 
  32 REGISTER_DEFINITION(Register, r0);
  33 REGISTER_DEFINITION(Register, r1);
  34 REGISTER_DEFINITION(Register, r2);
  35 REGISTER_DEFINITION(Register, r3);
  36 REGISTER_DEFINITION(Register, r4);
  37 REGISTER_DEFINITION(Register, r5);
  38 REGISTER_DEFINITION(Register, r6);
  39 REGISTER_DEFINITION(Register, r7);
  40 REGISTER_DEFINITION(Register, r8);
  41 REGISTER_DEFINITION(Register, r9);
  42 REGISTER_DEFINITION(Register, r10);
  43 REGISTER_DEFINITION(Register, r11);
  44 REGISTER_DEFINITION(Register, r12);
  45 REGISTER_DEFINITION(Register, r13);
  46 REGISTER_DEFINITION(Register, r14);
  47 REGISTER_DEFINITION(Register, r15);
  48 REGISTER_DEFINITION(Register, r16);
  49 REGISTER_DEFINITION(Register, r17);
  50 REGISTER_DEFINITION(Register, r18);
  51 REGISTER_DEFINITION(Register, r19);
  52 REGISTER_DEFINITION(Register, r20);
  53 REGISTER_DEFINITION(Register, r21);
  54 REGISTER_DEFINITION(Register, r22);
  55 REGISTER_DEFINITION(Register, r23);
  56 REGISTER_DEFINITION(Register, r24);
  57 REGISTER_DEFINITION(Register, r25);
  58 REGISTER_DEFINITION(Register, r26);
  59 REGISTER_DEFINITION(Register, r27);
  60 REGISTER_DEFINITION(Register, r28);
  61 REGISTER_DEFINITION(Register, r29);
  62 REGISTER_DEFINITION(Register, r30);
  63 REGISTER_DEFINITION(Register, sp);
  64 
  65 REGISTER_DEFINITION(FloatRegister, v0);
  66 REGISTER_DEFINITION(FloatRegister, v1);
  67 REGISTER_DEFINITION(FloatRegister, v2);
  68 REGISTER_DEFINITION(FloatRegister, v3);
  69 REGISTER_DEFINITION(FloatRegister, v4);
  70 REGISTER_DEFINITION(FloatRegister, v5);
  71 REGISTER_DEFINITION(FloatRegister, v6);
  72 REGISTER_DEFINITION(FloatRegister, v7);
  73 REGISTER_DEFINITION(FloatRegister, v8);
  74 REGISTER_DEFINITION(FloatRegister, v9);
  75 REGISTER_DEFINITION(FloatRegister, v10);
  76 REGISTER_DEFINITION(FloatRegister, v11);
  77 REGISTER_DEFINITION(FloatRegister, v12);
  78 REGISTER_DEFINITION(FloatRegister, v13);
  79 REGISTER_DEFINITION(FloatRegister, v14);
  80 REGISTER_DEFINITION(FloatRegister, v15);
  81 REGISTER_DEFINITION(FloatRegister, v16);
  82 REGISTER_DEFINITION(FloatRegister, v17);
  83 REGISTER_DEFINITION(FloatRegister, v18);
  84 REGISTER_DEFINITION(FloatRegister, v19);
  85 REGISTER_DEFINITION(FloatRegister, v20);
  86 REGISTER_DEFINITION(FloatRegister, v21);
  87 REGISTER_DEFINITION(FloatRegister, v22);
  88 REGISTER_DEFINITION(FloatRegister, v23);
  89 REGISTER_DEFINITION(FloatRegister, v24);
  90 REGISTER_DEFINITION(FloatRegister, v25);
  91 REGISTER_DEFINITION(FloatRegister, v26);
  92 REGISTER_DEFINITION(FloatRegister, v27);
  93 REGISTER_DEFINITION(FloatRegister, v28);
  94 REGISTER_DEFINITION(FloatRegister, v29);
  95 REGISTER_DEFINITION(FloatRegister, v30);
  96 REGISTER_DEFINITION(FloatRegister, v31);
  97 
  98 REGISTER_DEFINITION(Register, zr);
  99 
 100 REGISTER_DEFINITION(Register, c_rarg0);
 101 REGISTER_DEFINITION(Register, c_rarg1);
 102 REGISTER_DEFINITION(Register, c_rarg2);
 103 REGISTER_DEFINITION(Register, c_rarg3);
 104 REGISTER_DEFINITION(Register, c_rarg4);
 105 REGISTER_DEFINITION(Register, c_rarg5);
 106 REGISTER_DEFINITION(Register, c_rarg6);
 107 REGISTER_DEFINITION(Register, c_rarg7);
 108 
 109 REGISTER_DEFINITION(FloatRegister, c_farg0);
 110 REGISTER_DEFINITION(FloatRegister, c_farg1);
 111 REGISTER_DEFINITION(FloatRegister, c_farg2);
 112 REGISTER_DEFINITION(FloatRegister, c_farg3);
 113 REGISTER_DEFINITION(FloatRegister, c_farg4);
 114 REGISTER_DEFINITION(FloatRegister, c_farg5);
 115 REGISTER_DEFINITION(FloatRegister, c_farg6);
 116 REGISTER_DEFINITION(FloatRegister, c_farg7);
 117 
 118 REGISTER_DEFINITION(Register, j_rarg0);
 119 REGISTER_DEFINITION(Register, j_rarg1);
 120 REGISTER_DEFINITION(Register, j_rarg2);
 121 REGISTER_DEFINITION(Register, j_rarg3);
 122 REGISTER_DEFINITION(Register, j_rarg4);
 123 REGISTER_DEFINITION(Register, j_rarg5);
 124 REGISTER_DEFINITION(Register, j_rarg6);
 125 REGISTER_DEFINITION(Register, j_rarg7);
 126 
 127 REGISTER_DEFINITION(FloatRegister, j_farg0);
 128 REGISTER_DEFINITION(FloatRegister, j_farg1);
 129 REGISTER_DEFINITION(FloatRegister, j_farg2);
 130 REGISTER_DEFINITION(FloatRegister, j_farg3);
 131 REGISTER_DEFINITION(FloatRegister, j_farg4);
 132 REGISTER_DEFINITION(FloatRegister, j_farg5);
 133 REGISTER_DEFINITION(FloatRegister, j_farg6);
 134 REGISTER_DEFINITION(FloatRegister, j_farg7);
 135 
 136 REGISTER_DEFINITION(Register, rscratch1);
 137 REGISTER_DEFINITION(Register, rscratch2);
 138 REGISTER_DEFINITION(Register, esp);
 139 REGISTER_DEFINITION(Register, rdispatch);
 140 REGISTER_DEFINITION(Register, rcpool);
 141 REGISTER_DEFINITION(Register, rmonitors);
 142 REGISTER_DEFINITION(Register, rlocals);
 143 REGISTER_DEFINITION(Register, rmethod);
 144 REGISTER_DEFINITION(Register, rbcp);
 145 
 146 REGISTER_DEFINITION(Register, lr);
 147 REGISTER_DEFINITION(Register, rfp);
 148 REGISTER_DEFINITION(Register, rthread);
 149 REGISTER_DEFINITION(Register, rheapbase);
 150 
 151 REGISTER_DEFINITION(Register, r31_sp);
 152 
 153 // TODO : x86 uses rbp to save SP in method handle code
 154 // we may need to do the same with fp
 155 // REGISTER_DEFINITION(Register, rbp_mh_SP_save)