CACAO
Aarch64Register.cpp
Go to the documentation of this file.
1 /* src/vm/jit/compiler2/aarch64/Aarch64Register.cpp
2 
3  Copyright (C) 2013
4  CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
5 
6  This file is part of CACAO.
7 
8  This program is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License as
10  published by the Free Software Foundation; either version 2, or (at
11  your option) any later version.
12 
13  This program is distributed in the hope that it will be useful, but
14  WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program; if not, write to the Free Software
20  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21  02110-1301, USA.
22 
23 */
24 
26 
27 namespace cacao {
28 namespace jit {
29 namespace compiler2 {
30 namespace aarch64 {
31 
33  : MachineRegister(reg->name, type), reg(reg), fixedInterval(this) {}
34 
35 const uint8_t GPRegister::base = 0;
36 const uint8_t FPRegister::base = 0;
37 
38 GPRegister R0 ("R0" , 0, 0*8, 8);
39 GPRegister R1 ("R1" , 1, 1*8, 8);
40 GPRegister R2 ("R2" , 2, 2*8, 8);
41 GPRegister R3 ("R3" , 3, 3*8, 8);
42 GPRegister R4 ("R4" , 4, 4*8, 8);
43 GPRegister R5 ("R5" , 5, 5*8, 8);
44 GPRegister R6 ("R6" , 6, 6*8, 8);
45 GPRegister R7 ("R7" , 7, 7*8, 8);
46 GPRegister R8 ("R8" , 8, 8*8, 8);
47 GPRegister R9 ("R9" , 9, 9*8, 8);
48 GPRegister R10("R10", 10, 10*8, 8);
49 GPRegister R11("R11", 11, 11*8, 8);
50 GPRegister R12("R12", 12, 12*8, 8);
51 GPRegister R13("R13", 13, 13*8, 8);
52 GPRegister R14("R14", 14, 14*8, 8);
53 GPRegister R15("R15", 15, 15*8, 8);
54 GPRegister R16("R16", 16, 16*8, 8);
55 GPRegister R17("R17", 17, 17*8, 8);
56 GPRegister R18("R18", 18, 18*8, 8);
57 GPRegister R19("R19", 19, 19*8, 8);
58 GPRegister R20("R20", 20, 20*8, 8);
59 GPRegister R21("R21", 21, 21*8, 8);
60 GPRegister R22("R22", 22, 22*8, 8);
61 GPRegister R23("R23", 23, 23*8, 8);
62 GPRegister R24("R24", 24, 24*8, 8);
63 GPRegister R25("R25", 25, 25*8, 8);
64 GPRegister R26("R26", 26, 26*8, 8);
65 GPRegister R27("R27", 27, 27*8, 8);
66 GPRegister R28("R28", 28, 28*8, 8);
67 GPRegister R29("R29", 29, 29*8, 8);
68 GPRegister R30("R30", 30, 30*8, 8);
69 GPRegister SP ("SP" , 31, 31*8, 8);
70 
72  &R0, &R1, &R2, &R3, &R4, &R5, &R6, &R7
73 };
74 
76  &R0, &R1, &R2, &R3, &R4, &R5, &R6, &R7, &R8, &R10, &R11, &R12,
77  &R13, &R14, &R15, &R16, &R17
78 };
80 
81 FPRegister V0 ("V0" , 0, 0*16, 16);
82 FPRegister V1 ("V1" , 1, 1*16, 16);
83 FPRegister V2 ("V2" , 2, 2*16, 16);
84 FPRegister V3 ("V3" , 3, 3*16, 16);
85 FPRegister V4 ("V4" , 4, 4*16, 16);
86 FPRegister V5 ("V5" , 5, 5*16, 16);
87 FPRegister V6 ("V6" , 6, 6*16, 16);
88 FPRegister V7 ("V7" , 7, 7*16, 16);
89 FPRegister V8 ("V8" , 8, 8*16, 16);
90 FPRegister V9 ("V9" , 9, 9*16, 16);
91 FPRegister V10("V10", 10, 10*16, 16);
92 FPRegister V11("V11", 11, 11*16, 16);
93 FPRegister V12("V12", 12, 12*16, 16);
94 FPRegister V13("V13", 13, 13*16, 16);
95 FPRegister V14("V14", 14, 14*16, 16);
96 FPRegister V15("V15", 15, 15*16, 16);
97 FPRegister V16("V16", 16, 16*16, 16);
98 FPRegister V17("V17", 17, 17*16, 16);
99 FPRegister V18("V18", 18, 18*16, 16);
100 FPRegister V19("V19", 19, 19*16, 16);
101 FPRegister V20("V20", 20, 20*16, 16);
102 FPRegister V21("V21", 21, 21*16, 16);
103 FPRegister V22("V22", 22, 22*16, 16);
104 FPRegister V23("V23", 23, 23*16, 16);
105 FPRegister V24("V24", 24, 24*16, 16);
106 FPRegister V25("V25", 25, 25*16, 16);
107 FPRegister V26("V26", 26, 26*16, 16);
108 FPRegister V27("V27", 27, 27*16, 16);
109 FPRegister V28("V28", 28, 28*16, 16);
110 FPRegister V29("V29", 29, 29*16, 16);
111 FPRegister V30("V30", 30, 30*16, 16);
112 FPRegister V31("V31", 31, 31*16, 16);
113 
115  &V0, &V1, &V2, &V3, &V4, &V5, &V6, &V7
116 };
117 
118 
120  &V0, &V1, &V2, &V3, &V4, &V5, &V6, &V7, &V16, &V17, &V18, &V19, &V20,
121  &V21, &V22, &V23, &V24, &V25, &V26, &V27, &V28, &V29, &V30, &V31
122 };
124 
125 } // end namespace aarch64
126 
127 using namespace aarch64;
128 
129 template<>
132  Type::TypeID type = mo->get_type();
133 
134  switch (type) {
135  case Type::CharTypeID:
136  case Type::ByteTypeID:
137  case Type::ShortTypeID:
138  case Type::IntTypeID:
139  case Type::LongTypeID:
141  #if 1
142  for (unsigned i = 0; i < IntegerCallerSavedRegistersSize; ++i) {
143  of.push_back(new aarch64::NativeRegister(type, IntegerCallerSavedRegisters[i]));
144  }
145  assert(of.size() == IntegerCallerSavedRegistersSize);
146  #else
147  of.push_back(new aarch64::NativeRegister(type, &R9));
148  of.push_back(new aarch64::NativeRegister(type, &R10));
149  of.push_back(new aarch64::NativeRegister(type, &R11));
150  of.push_back(new aarch64::NativeRegister(type, &R12));
151  of.push_back(new aarch64::NativeRegister(type, &R13));
152  of.push_back(new aarch64::NativeRegister(type, &R14));
153  of.push_back(new aarch64::NativeRegister(type, &R15));
154 
155  #endif
156  break;
157 
158  case Type::FloatTypeID:
159  case Type::DoubleTypeID:
160  for (unsigned i = 0; i < FloatCallerSavedRegistersSize; ++i) {
161  of.push_back(new aarch64::NativeRegister(type, FloatCallerSavedRegisters[i]));
162  }
163  assert(of.size() == FloatCallerSavedRegistersSize);
164  break;
165 
166  default:
167  ABORT_MSG("aarch64 Register File Type Not supported!",
168  "Type: " << type);
169  }
170  return of;
171 }
172 
173 } // end namespace compiler2
174 } // end namespace jit
175 } // end namespace cacao
176 
177 
178 /*
179  * These are local overrides for various environment variables in Emacs.
180  * Please do not remove this and leave it at the end of the file, where
181  * Emacs will automagically detect them.
182  * ---------------------------------------------------------------------
183  * Local variables:
184  * mode: c++
185  * indent-tabs-mode: t
186  * c-basic-offset: 4
187  * tab-width: 4
188  * End:
189  * vim:noexpandtab:sw=4:ts=4:
190  */
191 
FPRegister V30("V30", 30, 30 *16, 16)
GPRegister * IntegerCallerSavedRegisters[]
GPRegister R4("R4", 4, 4 *8, 8)
FPRegister V15("V15", 15, 15 *16, 16)
FPRegister V12("V12", 12, 12 *16, 16)
FPRegister V11("V11", 11, 11 *16, 16)
GPRegister R12("R12", 12, 12 *8, 8)
GPRegister R21("R21", 21, 21 *8, 8)
FPRegister V28("V28", 28, 28 *16, 16)
GPRegister R24("R24", 24, 24 *8, 8)
GPRegister R22("R22", 22, 22 *8, 8)
GPRegister R13("R13", 13, 13 *8, 8)
FPRegister V17("V17", 17, 17 *16, 16)
FPRegister V31("V31", 31, 31 *16, 16)
FPRegister V27("V27", 27, 27 *16, 16)
GPRegister R11("R11", 11, 11 *8, 8)
FPRegister V2("V2", 2, 2 *16, 16)
FPRegister V23("V23", 23, 23 *16, 16)
GPRegister R20("R20", 20, 20 *8, 8)
FPRegister V13("V13", 13, 13 *16, 16)
FPRegister V22("V22", 22, 22 *16, 16)
JNIEnv jclass jobject const char * name
Definition: jvmti.h:312
GPRegister R6("R6", 6, 6 *8, 8)
FPRegister V19("V19", 19, 19 *16, 16)
FPRegister V5("V5", 5, 5 *16, 16)
GPRegister R1("R1", 1, 1 *8, 8)
FPRegister V18("V18", 18, 18 *16, 16)
GPRegister R10("R10", 10, 10 *8, 8)
GPRegister R26("R26", 26, 26 *8, 8)
FPRegister V9("V9", 9, 9 *16, 16)
GPRegister R15("R15", 15, 15 *8, 8)
GPRegister R9("R9", 9, 9 *8, 8)
GPRegister SP("SP", 31, 31 *8, 8)
FPRegister V3("V3", 3, 3 *16, 16)
NativeRegister(Type::TypeID type, Aarch64Register *reg)
FPRegister V8("V8", 8, 8 *16, 16)
FPRegister V0("V0", 0, 0 *16, 16)
GPRegister R28("R28", 28, 28 *8, 8)
GPRegister R17("R17", 17, 17 *8, 8)
FPRegister V29("V29", 29, 29 *16, 16)
GPRegister R23("R23", 23, 23 *8, 8)
FPRegister V26("V26", 26, 26 *16, 16)
GPRegister R30("R30", 30, 30 *8, 8)
GPRegister R14("R14", 14, 14 *8, 8)
GPRegister R29("R29", 29, 29 *8, 8)
FPRegister V16("V16", 16, 16 *16, 16)
MIIterator i
alloc::list< MachineOperand * >::type OperandFile
FPRegister V10("V10", 10, 10 *16, 16)
This represents a machine register usage.
GPRegister R2("R2", 2, 2 *8, 8)
FPRegister V1("V1", 1, 1 *16, 16)
GPRegister R8("R8", 8, 8 *8, 8)
FPRegister V6("V6", 6, 6 *16, 16)
GPRegister R0("R0", 0, 0 *8, 8)
FPRegister V20("V20", 20, 20 *16, 16)
Operands that can be directly used by the machine (register, memory, stackslot)
GPRegister R5("R5", 5, 5 *8, 8)
GPRegister R3("R3", 3, 3 *8, 8)
GPRegister R16("R16", 16, 16 *8, 8)
FPRegister V7("V7", 7, 7 *16, 16)
GPRegister R19("R19", 19, 19 *8, 8)
FPRegister V24("V24", 24, 24 *16, 16)
FPRegister V4("V4", 4, 4 *16, 16)
GPRegister R7("R7", 7, 7 *8, 8)
GPRegister R18("R18", 18, 18 *8, 8)
#define ABORT_MSG(EXPR_SHORT, EXPR_LONG)
Definition: logging.hpp:133
FPRegister V25("V25", 25, 25 *16, 16)
FPRegister V14("V14", 14, 14 *16, 16)
GPRegister R27("R27", 27, 27 *8, 8)
FPRegister V21("V21", 21, 21 *16, 16)
virtual OperandFile & get_OperandFile(OperandFile &OF, MachineOperand *MO) const
GPRegister R25("R25", 25, 25 *8, 8)