1/*
2 * Copyright (C) 2014 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#include "registers_mips64.h"
18
19#include <ostream>
20
21namespace art {
22namespace mips64 {
23
24static const char* kRegisterNames[] = {
25  "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3",
26  "a4", "a5", "a6", "a7", "t0", "t1", "t2", "t3",
27  "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7",
28  "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra",
29};
30
31std::ostream& operator<<(std::ostream& os, const GpuRegister& rhs) {
32  if (rhs >= ZERO && rhs < kNumberOfGpuRegisters) {
33    os << kRegisterNames[rhs];
34  } else {
35    os << "GpuRegister[" << static_cast<int>(rhs) << "]";
36  }
37  return os;
38}
39
40std::ostream& operator<<(std::ostream& os, const FpuRegister& rhs) {
41  if (rhs >= F0 && rhs < kNumberOfFpuRegisters) {
42    os << "f" << static_cast<int>(rhs);
43  } else {
44    os << "FpuRegister[" << static_cast<int>(rhs) << "]";
45  }
46  return os;
47}
48
49}  // namespace mips64
50}  // namespace art
51