2
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
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.
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).
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.
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
25
#include "precompiled.hpp"
27
#include "register_x86.hpp"
29
const Register::RegisterImpl all_RegisterImpls [Register::number_of_registers + 1];
30
const FloatRegister::FloatRegisterImpl all_FloatRegisterImpls[FloatRegister::number_of_registers + 1];
31
const XMMRegister::XMMRegisterImpl all_XMMRegisterImpls [XMMRegister::number_of_registers + 1];
32
const KRegister::KRegisterImpl all_KRegisterImpls [KRegister::number_of_registers + 1];
34
const char * Register::RegisterImpl::name() const {
35
static const char *const names[number_of_registers] = {
37
"rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi",
38
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
39
"r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
40
"r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31"
42
"eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi"
45
return is_valid() ? names[encoding()] : "noreg";
48
const char* FloatRegister::FloatRegisterImpl::name() const {
49
static const char *const names[number_of_registers] = {
50
"st0", "st1", "st2", "st3", "st4", "st5", "st6", "st7"
52
return is_valid() ? names[encoding()] : "fnoreg";
55
const char* XMMRegister::XMMRegisterImpl::name() const {
56
static const char *const names[number_of_registers] = {
57
"xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7"
59
,"xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15"
60
,"xmm16", "xmm17", "xmm18", "xmm19", "xmm20", "xmm21", "xmm22", "xmm23"
61
,"xmm24", "xmm25", "xmm26", "xmm27", "xmm28", "xmm29", "xmm30", "xmm31"
64
return is_valid() ? names[encoding()] : "xnoreg";
67
const char* KRegister::KRegisterImpl::name() const {
68
const char *const names[number_of_registers] = {
69
"k0", "k1", "k2", "k3", "k4", "k5", "k6", "k7"
71
return is_valid() ? names[encoding()] : "knoreg";