gem5
[DEVELOP-FOR-23.0]
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerations
_
a
b
c
d
e
f
g
h
i
k
l
m
o
p
q
r
s
t
v
x
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Enumerations
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Related Functions
:
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
s
t
v
Variables
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
Typedefs
a
b
c
d
g
h
i
l
m
r
s
t
u
w
Enumerations
b
h
i
o
p
Enumerator
h
i
o
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
arch
x86
regs
int.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2007 The Hewlett-Packard Development Company
3
* All rights reserved.
4
*
5
* The license below extends only to copyright in the software and shall
6
* not be construed as granting a license to any other intellectual
7
* property including but not limited to intellectual property relating
8
* to a hardware implementation of the functionality of the software
9
* licensed hereunder. You may use the software subject to the license
10
* terms below provided that you ensure that this notice is replicated
11
* unmodified and in its entirety in all distributions of the software,
12
* modified or unmodified, in source code or in binary form.
13
*
14
* Redistribution and use in source and binary forms, with or without
15
* modification, are permitted provided that the following conditions are
16
* met: redistributions of source code must retain the above copyright
17
* notice, this list of conditions and the following disclaimer;
18
* redistributions in binary form must reproduce the above copyright
19
* notice, this list of conditions and the following disclaimer in the
20
* documentation and/or other materials provided with the distribution;
21
* neither the name of the copyright holders nor the names of its
22
* contributors may be used to endorse or promote products derived from
23
* this software without specific prior written permission.
24
*
25
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36
*/
37
38
#include "
arch/x86/regs/int.hh
"
39
40
#include <sstream>
41
42
namespace
gem5
43
{
44
45
namespace
X86ISA
46
{
47
48
std::string
49
FlatIntRegClassOps::regName
(
const
RegId
&
id
)
const
50
{
51
constexpr
const
char
*abcdFormats[9] =
52
{
""
,
"%s"
,
"%sx"
,
""
,
"e%sx"
,
""
,
""
,
""
,
"r%sx"
};
53
constexpr
const
char
*piFormats[9] =
54
{
""
,
"%s"
,
"%s"
,
""
,
"e%s"
,
""
,
""
,
""
,
"r%s"
};
55
constexpr
const
char
*longFormats[9] =
56
{
""
,
"r%sb"
,
"r%sw"
,
""
,
"r%sd"
,
""
,
""
,
""
,
"r%s"
};
57
constexpr
const
char
*microFormats[9] =
58
{
""
,
"t%db"
,
"t%dw"
,
""
,
"t%dd"
,
""
,
""
,
""
,
"t%d"
};
59
60
// Fix size at 8 for now.
61
constexpr
unsigned
size = 8;
62
63
RegIndex
reg_idx =
id
.index();
64
65
std::ostringstream
ss
;
66
67
const
char
* suffix =
""
;
68
bool
fold = reg_idx &
IntFoldBit
;
69
reg_idx &= ~
IntFoldBit
;
70
71
if
(fold)
72
suffix =
"h"
;
73
else
if
(reg_idx < 8 && size == 1)
74
suffix =
"l"
;
75
76
switch
(reg_idx) {
77
case
int_reg::Rax
:
78
ccprintf
(
ss
, abcdFormats[size],
"a"
);
79
break
;
80
case
int_reg::Rbx
:
81
ccprintf
(
ss
, abcdFormats[size],
"b"
);
82
break
;
83
case
int_reg::Rcx
:
84
ccprintf
(
ss
, abcdFormats[size],
"c"
);
85
break
;
86
case
int_reg::Rdx
:
87
ccprintf
(
ss
, abcdFormats[size],
"d"
);
88
break
;
89
case
int_reg::Rsp
:
90
ccprintf
(
ss
, piFormats[size],
"sp"
);
91
break
;
92
case
int_reg::Rbp
:
93
ccprintf
(
ss
, piFormats[size],
"bp"
);
94
break
;
95
case
int_reg::Rsi
:
96
ccprintf
(
ss
, piFormats[size],
"si"
);
97
break
;
98
case
int_reg::Rdi
:
99
ccprintf
(
ss
, piFormats[size],
"di"
);
100
break
;
101
case
int_reg::R8
:
102
ccprintf
(
ss
, longFormats[size],
"8"
);
103
break
;
104
case
int_reg::R9
:
105
ccprintf
(
ss
, longFormats[size],
"9"
);
106
break
;
107
case
int_reg::R10
:
108
ccprintf
(
ss
, longFormats[size],
"10"
);
109
break
;
110
case
int_reg::R11
:
111
ccprintf
(
ss
, longFormats[size],
"11"
);
112
break
;
113
case
int_reg::R12
:
114
ccprintf
(
ss
, longFormats[size],
"12"
);
115
break
;
116
case
int_reg::R13
:
117
ccprintf
(
ss
, longFormats[size],
"13"
);
118
break
;
119
case
int_reg::R14
:
120
ccprintf
(
ss
, longFormats[size],
"14"
);
121
break
;
122
case
int_reg::R15
:
123
ccprintf
(
ss
, longFormats[size],
"15"
);
124
break
;
125
default
:
126
ccprintf
(
ss
, microFormats[size],
127
reg_idx - int_reg::MicroBegin);
128
}
129
ccprintf
(
ss
, suffix);
130
131
return
ss
.str();
132
}
133
134
RegId
135
IntRegClassOps::flatten
(
const
BaseISA
&isa,
const
RegId
&
id
)
const
136
{
137
return
{
flatIntRegClass
, (
RegIndex
)(
id
.
index
() & ~
IntFoldBit
)};
138
}
139
140
}
// namespace X86ISA
141
}
// namespace gem5
gem5::X86ISA::int_reg::R15
constexpr RegId R15
Definition:
int.hh:147
gem5::X86ISA::int_reg::Rsi
constexpr RegId Rsi
Definition:
int.hh:138
gem5::X86ISA::int_reg::Rbp
constexpr RegId Rbp
Definition:
int.hh:137
gem5::X86ISA::int_reg::R14
constexpr RegId R14
Definition:
int.hh:146
gem5::X86ISA::int_reg::R12
constexpr RegId R12
Definition:
int.hh:144
gem5::X86ISA::int_reg::Rcx
constexpr RegId Rcx
Definition:
int.hh:133
gem5::ccprintf
void ccprintf(cp::Print &print)
Definition:
cprintf.hh:130
gem5::X86ISA::flatIntRegClass
constexpr RegClass flatIntRegClass
Definition:
int.hh:112
gem5::X86ISA::FlatIntRegClassOps::regName
std::string regName(const RegId &id) const override
Print the name of the register specified in id.
Definition:
int.cc:49
gem5::X86ISA::int_reg::Rsp
constexpr RegId Rsp
Definition:
int.hh:136
gem5::X86ISA::int_reg::Rdx
constexpr RegId Rdx
Definition:
int.hh:134
int.hh
gem5::X86ISA::IntRegClassOps::flatten
RegId flatten(const BaseISA &isa, const RegId &id) const override
Flatten register id id using information in the ISA object isa.
Definition:
int.cc:135
ss
std::stringstream ss
Definition:
trace.test.cc:45
gem5::X86ISA::int_reg::Rbx
constexpr RegId Rbx
Definition:
int.hh:135
gem5::X86ISA::index
Bitfield< 5, 3 > index
Definition:
types.hh:98
gem5::X86ISA::int_reg::Rdi
constexpr RegId Rdi
Definition:
int.hh:139
gem5::X86ISA::int_reg::Rax
constexpr RegId Rax
Definition:
int.hh:132
gem5::X86ISA::int_reg::R10
constexpr RegId R10
Definition:
int.hh:142
gem5::X86ISA::int_reg::R13
constexpr RegId R13
Definition:
int.hh:145
gem5::X86ISA::IntFoldBit
constexpr RegIndex IntFoldBit
Definition:
int.hh:178
gem5::BaseISA
Definition:
isa.hh:58
gem5::RegIndex
uint16_t RegIndex
Definition:
types.hh:176
gem5::X86ISA::int_reg::R11
constexpr RegId R11
Definition:
int.hh:143
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition:
gpu_translation_state.hh:37
gem5::X86ISA::int_reg::R9
constexpr RegId R9
Definition:
int.hh:141
gem5::X86ISA::int_reg::R8
constexpr RegId R8
Definition:
int.hh:140
gem5::RegId
Register ID: describe an architectural register with its class and index.
Definition:
reg_class.hh:92
Generated on Sun Jul 30 2023 01:56:49 for gem5 by
doxygen
1.8.17