Tue, 17 Oct 2017 12:58:25 +0800
merge
aoqi@0 | 1 | /* |
aoqi@0 | 2 | * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. |
aoqi@0 | 3 | * Copyright 2012, 2013 SAP AG. All rights reserved. |
aoqi@0 | 4 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
aoqi@0 | 5 | * |
aoqi@0 | 6 | * This code is free software; you can redistribute it and/or modify it |
aoqi@0 | 7 | * under the terms of the GNU General Public License version 2 only, as |
aoqi@0 | 8 | * published by the Free Software Foundation. |
aoqi@0 | 9 | * |
aoqi@0 | 10 | * This code is distributed in the hope that it will be useful, but WITHOUT |
aoqi@0 | 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
aoqi@0 | 12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
aoqi@0 | 13 | * version 2 for more details (a copy is included in the LICENSE file that |
aoqi@0 | 14 | * accompanied this code). |
aoqi@0 | 15 | * |
aoqi@0 | 16 | * You should have received a copy of the GNU General Public License version |
aoqi@0 | 17 | * 2 along with this work; if not, write to the Free Software Foundation, |
aoqi@0 | 18 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
aoqi@0 | 19 | * |
aoqi@0 | 20 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
aoqi@0 | 21 | * or visit www.oracle.com if you need additional information or have any |
aoqi@0 | 22 | * questions. |
aoqi@0 | 23 | * |
aoqi@0 | 24 | */ |
aoqi@0 | 25 | |
aoqi@0 | 26 | #include "precompiled.hpp" |
aoqi@0 | 27 | #include "register_ppc.hpp" |
aoqi@0 | 28 | |
aoqi@0 | 29 | const int ConcreteRegisterImpl::max_gpr = RegisterImpl::number_of_registers * 2; |
aoqi@0 | 30 | const int ConcreteRegisterImpl::max_fpr = ConcreteRegisterImpl::max_gpr + |
aoqi@0 | 31 | FloatRegisterImpl::number_of_registers * 2; |
aoqi@0 | 32 | const int ConcreteRegisterImpl::max_cnd = ConcreteRegisterImpl::max_fpr + |
aoqi@0 | 33 | ConditionRegisterImpl::number_of_registers; |
aoqi@0 | 34 | |
aoqi@0 | 35 | const char* RegisterImpl::name() const { |
aoqi@0 | 36 | const char* names[number_of_registers] = { |
aoqi@0 | 37 | "R0", "R1", "R2", "R3", "R4", "R5", "R6", "R7", |
aoqi@0 | 38 | "R8", "R9", "R10", "R11", "R12", "R13", "R14", "R15", |
aoqi@0 | 39 | "R16", "R17", "R18", "R19", "R20", "R21", "R22", "R23", |
aoqi@0 | 40 | "R24", "R25", "R26", "R27", "R28", "R29", "R30", "R31" |
aoqi@0 | 41 | }; |
aoqi@0 | 42 | return is_valid() ? names[encoding()] : "noreg"; |
aoqi@0 | 43 | } |
aoqi@0 | 44 | |
aoqi@0 | 45 | const char* ConditionRegisterImpl::name() const { |
aoqi@0 | 46 | const char* names[number_of_registers] = { |
aoqi@0 | 47 | "CR0", "CR1", "CR2", "CR3", "CR4", "CR5", "CR6", "CR7" |
aoqi@0 | 48 | }; |
aoqi@0 | 49 | return is_valid() ? names[encoding()] : "cnoreg"; |
aoqi@0 | 50 | } |
aoqi@0 | 51 | |
aoqi@0 | 52 | const char* FloatRegisterImpl::name() const { |
aoqi@0 | 53 | const char* names[number_of_registers] = { |
aoqi@0 | 54 | "F0", "F1", "F2", "F3", "F4", "F5", "F6", "F7", |
aoqi@0 | 55 | "F8", "F9", "F10", "F11", "F12", "F13", "F14", "F15", |
aoqi@0 | 56 | "F16", "F17", "F18", "F19", "F20", "F21", "F22", "F23", |
aoqi@0 | 57 | "F24", "F25", "F26", "F27", "F28", "F29", "F30", "F31" |
aoqi@0 | 58 | }; |
aoqi@0 | 59 | return is_valid() ? names[encoding()] : "fnoreg"; |
aoqi@0 | 60 | } |
aoqi@0 | 61 | |
aoqi@0 | 62 | const char* SpecialRegisterImpl::name() const { |
aoqi@0 | 63 | const char* names[number_of_registers] = { |
aoqi@0 | 64 | "SR_XER", "SR_LR", "SR_CTR", "SR_VRSAVE", "SR_SPEFSCR", "SR_PPR" |
aoqi@0 | 65 | }; |
aoqi@0 | 66 | return is_valid() ? names[encoding()] : "snoreg"; |
aoqi@0 | 67 | } |
aoqi@0 | 68 | |
aoqi@0 | 69 | const char* VectorRegisterImpl::name() const { |
aoqi@0 | 70 | const char* names[number_of_registers] = { |
aoqi@0 | 71 | "VR0", "VR1", "VR2", "VR3", "VR4", "VR5", "VR6", "VR7", |
aoqi@0 | 72 | "VR8", "VR9", "VR10", "VR11", "VR12", "VR13", "VR14", "VR15", |
aoqi@0 | 73 | "VR16", "VR17", "VR18", "VR19", "VR20", "VR21", "VR22", "VR23", |
aoqi@0 | 74 | "VR24", "VR25", "VR26", "VR27", "VR28", "VR29", "VR30", "VR31" |
aoqi@0 | 75 | }; |
aoqi@0 | 76 | return is_valid() ? names[encoding()] : "vnoreg"; |
aoqi@0 | 77 | } |