src/cpu/ppc/vm/register_ppc.cpp

Wed, 27 Nov 2013 16:16:21 -0800

author
goetz
date
Wed, 27 Nov 2013 16:16:21 -0800
changeset 6490
41b780b43b74
parent 6458
ec28f9c041ff
child 6495
67fa91961822
permissions
-rw-r--r--

8029015: PPC64 (part 216): opto: trap based null and range checks
Summary: On PPC64 use tdi instruction that does a compare and raises SIGTRAP for NULL and range checks.
Reviewed-by: kvn

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

mercurial