1 /*
2  * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * This code is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License version 2 only, as
7  * published by the Free Software Foundation.
8  *
9  * This code is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12  * version 2 for more details (a copy is included in the LICENSE file that
13  * accompanied this code).
14  *
15  * You should have received a copy of the GNU General Public License version
16  * 2 along with this work; if not, write to the Free Software Foundation,
17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18  *
19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20  * or visit www.oracle.com if you need additional information or have any
21  * questions.
22  *
23  */
24 
25 #include "precompiled.hpp"
26 #include "register_arm.hpp"
27 #include "utilities/debug.hpp"
28 
29 const int ConcreteRegisterImpl::max_gpr = ConcreteRegisterImpl::num_gpr;
30 const int ConcreteRegisterImpl::max_fpr = ConcreteRegisterImpl::num_fpr +
31                                           ConcreteRegisterImpl::max_gpr;
32 
name() const33 const char* RegisterImpl::name() const {
34   const char* names[number_of_registers] = {
35     "r0", "r1", "r2", "r3", "r4", "r5", "r6",
36 #if (FP_REG_NUM == 7)
37     "fp",
38 #else
39     "r7",
40 #endif
41     "r8", "r9", "r10",
42 #if (FP_REG_NUM == 11)
43     "fp",
44 #else
45     "r11",
46 #endif
47     "r12", "sp", "lr", "pc"
48   };
49   return is_valid() ? names[encoding()] : "noreg";
50 }
51 
name() const52 const char* FloatRegisterImpl::name() const {
53   const char* names[number_of_registers] = {
54      "s0",  "s1",  "s2",  "s3",  "s4",  "s5",  "s6",  "s7",
55      "s8",  "s9", "s10", "s11", "s12", "s13", "s14", "s15",
56     "s16", "s17", "s18", "s19", "s20", "s21", "s22", "s23",
57     "s24", "s25", "s26", "s27", "s28", "s29", "s30", "s31"
58 #ifdef COMPILER2
59    ,"s32", "s33?","s34", "s35?","s36", "s37?","s38", "s39?",
60     "s40", "s41?","s42", "s43?","s44", "s45?","s46", "s47?",
61     "s48", "s49?","s50", "s51?","s52", "s53?","s54", "s55?",
62     "s56", "s57?","s58", "s59?","s60", "s61?","s62", "s63?"
63 #endif
64   };
65   return is_valid() ? names[encoding()] : "fnoreg";
66 }
67