jdk

Форк
0
/
register_x86.cpp 
72 строки · 2.9 Кб
1
/*
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.
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

27
#include "register_x86.hpp"
28

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];
33

34
const char * Register::RegisterImpl::name() const {
35
  static const char *const names[number_of_registers] = {
36
#ifdef _LP64
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"
41
#else
42
    "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi"
43
#endif // _LP64
44
  };
45
  return is_valid() ? names[encoding()] : "noreg";
46
}
47

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"
51
  };
52
  return is_valid() ? names[encoding()] : "fnoreg";
53
}
54

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"
58
#ifdef _LP64
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"
62
#endif // _LP64
63
  };
64
  return is_valid() ? names[encoding()] : "xnoreg";
65
}
66

67
const char* KRegister::KRegisterImpl::name() const {
68
  const char *const names[number_of_registers] = {
69
    "k0", "k1", "k2", "k3", "k4", "k5", "k6", "k7"
70
  };
71
  return is_valid() ? names[encoding()] : "knoreg";
72
}
73

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.