registers_mips.h revision b74353a6765447b1551b337fd76803eb6aa86b8b
1/*
2 * Copyright (C) 2012 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef ART_RUNTIME_ARCH_MIPS_REGISTERS_MIPS_H_
18#define ART_RUNTIME_ARCH_MIPS_REGISTERS_MIPS_H_
19
20#include <iosfwd>
21
22#include "base/logging.h"
23#include "base/macros.h"
24#include "globals.h"
25
26namespace art {
27namespace mips {
28
29enum Register {
30  ZERO =  0,
31  AT   =  1,  // Assembler temporary.
32  V0   =  2,  // Values.
33  V1   =  3,
34  A0   =  4,  // Arguments.
35  A1   =  5,
36  A2   =  6,
37  A3   =  7,
38  T0   =  8,  // Temporaries.
39  T1   =  9,
40  T2   = 10,
41  T3   = 11,
42  T4   = 12,
43  T5   = 13,
44  T6   = 14,
45  T7   = 15,
46  S0   = 16,  // Saved values.
47  S1   = 17,
48  S2   = 18,
49  S3   = 19,
50  S4   = 20,
51  S5   = 21,
52  S6   = 22,
53  S7   = 23,
54  T8   = 24,  // More temporaries.
55  T9   = 25,
56  K0   = 26,  // Reserved for trap handler.
57  K1   = 27,
58  GP   = 28,  // Global pointer.
59  SP   = 29,  // Stack pointer.
60  FP   = 30,  // Saved value/frame pointer.
61  RA   = 31,  // Return address.
62  TR   = S1,  // ART Thread Register
63  TMP  = T8,  // scratch register (in addition to AT)
64  kNumberOfCoreRegisters = 32,
65  kNoRegister = -1  // Signals an illegal register.
66};
67std::ostream& operator<<(std::ostream& os, const Register& rhs);
68
69// Values for single-precision floating point registers.
70enum FRegister {
71  F0  =  0,
72  F1  =  1,
73  F2  =  2,
74  F3  =  3,
75  F4  =  4,
76  F5  =  5,
77  F6  =  6,
78  F7  =  7,
79  F8  =  8,
80  F9  =  9,
81  F10 = 10,
82  F11 = 11,
83  F12 = 12,
84  F13 = 13,
85  F14 = 14,
86  F15 = 15,
87  F16 = 16,
88  F17 = 17,
89  F18 = 18,
90  F19 = 19,
91  F20 = 20,
92  F21 = 21,
93  F22 = 22,
94  F23 = 23,
95  F24 = 24,
96  F25 = 25,
97  F26 = 26,
98  F27 = 27,
99  F28 = 28,
100  F29 = 29,
101  F30 = 30,
102  F31 = 31,
103  FTMP = F8,  // scratch register
104  kNumberOfFRegisters = 32,
105  kNoFRegister = -1,
106};
107std::ostream& operator<<(std::ostream& os, const FRegister& rhs);
108
109}  // namespace mips
110}  // namespace art
111
112#endif  // ART_RUNTIME_ARCH_MIPS_REGISTERS_MIPS_H_
113