gem5 v23.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
misc64.hh
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011-2013,2017-2019, 2021-2022 Arm Limited
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#ifndef __ARCH_ARM_INSTS_MISC64_HH__
39#define __ARCH_ARM_INSTS_MISC64_HH__
40
42
43namespace gem5
44{
45
47{
48 protected:
49 uint64_t imm;
50
51 ImmOp64(const char *mnem, ArmISA::ExtMachInst _machInst,
52 OpClass __opClass, uint64_t _imm) :
53 ArmISA::ArmStaticInst(mnem, _machInst, __opClass), imm(_imm)
54 {}
55
56 std::string generateDisassembly(
57 Addr pc, const loader::SymbolTable *symtab) const override;
58};
59
61{
62 protected:
64
65 RegOp64(const char *mnem, ArmISA::ExtMachInst _machInst,
66 OpClass __opClass, RegIndex _op1) :
67 ArmISA::ArmStaticInst(mnem, _machInst, __opClass), op1(_op1)
68 {}
69
70 std::string generateDisassembly(
71 Addr pc, const loader::SymbolTable *symtab) const override;
72};
73
75{
76 protected:
78 uint64_t imm1;
79 uint64_t imm2;
80
81 RegImmImmOp64(const char *mnem, ArmISA::ExtMachInst _machInst,
82 OpClass __opClass, RegIndex _op1,
83 uint64_t _imm1, uint64_t _imm2) :
84 ArmISA::ArmStaticInst(mnem, _machInst, __opClass),
85 op1(_op1), imm1(_imm1), imm2(_imm2)
86 {}
87
88 std::string generateDisassembly(
89 Addr pc, const loader::SymbolTable *symtab) const override;
90};
91
93{
94 protected:
97 uint64_t imm1;
98 uint64_t imm2;
99
100 RegRegImmImmOp64(const char *mnem, ArmISA::ExtMachInst _machInst,
101 OpClass __opClass, RegIndex _dest,
102 RegIndex _op1, uint64_t _imm1,
103 int64_t _imm2) :
104 ArmISA::ArmStaticInst(mnem, _machInst, __opClass),
105 dest(_dest), op1(_op1), imm1(_imm1), imm2(_imm2)
106 {}
107
108 std::string generateDisassembly(
109 Addr pc, const loader::SymbolTable *symtab) const override;
110};
111
113{
114 protected:
118 uint64_t imm;
119
120 RegRegRegImmOp64(const char *mnem, ArmISA::ExtMachInst _machInst,
121 OpClass __opClass, RegIndex _dest,
122 RegIndex _op1, RegIndex _op2,
123 uint64_t _imm) :
124 ArmISA::ArmStaticInst(mnem, _machInst, __opClass),
125 dest(_dest), op1(_op1), op2(_op2), imm(_imm)
126 {}
127
128 std::string generateDisassembly(
129 Addr pc, const loader::SymbolTable *symtab) const override;
130};
131
133{
134 protected:
135
136 UnknownOp64(const char *mnem, ArmISA::ExtMachInst _machInst,
137 OpClass __opClass) :
138 ArmISA::ArmStaticInst(mnem, _machInst, __opClass)
139 {}
140
141 std::string generateDisassembly(
142 Addr pc, const loader::SymbolTable *symtab) const override;
143};
144
157{
158 protected:
160
161 MiscRegOp64(const char *mnem, ArmISA::ExtMachInst _machInst,
162 OpClass __opClass, bool misc_read) :
163 ArmISA::ArmStaticInst(mnem, _machInst, __opClass),
164 _miscRead(misc_read)
165 {}
166
167 uint32_t _iss(const ArmISA::MiscRegNum64 &misc_reg,
168 RegIndex int_index) const;
169
170 public:
171 virtual uint32_t iss() const { return 0; }
172
173 bool miscRead() const { return _miscRead; }
174
177 ArmISA::ExceptionClass ec, uint32_t iss) const;
178};
179
181{
182 protected:
184 uint32_t imm;
185
186 MiscRegImmOp64(const char *mnem, ArmISA::ExtMachInst _machInst,
187 OpClass __opClass, ArmISA::MiscRegIndex _dest,
188 uint32_t _imm) :
189 MiscRegOp64(mnem, _machInst, __opClass, false),
190 dest(_dest), imm(_imm)
191 {}
192
198 RegVal miscRegImm() const;
199
200 std::string generateDisassembly(
201 Addr pc, const loader::SymbolTable *symtab) const override;
202};
203
205{
206 protected:
209
210 MiscRegRegImmOp64(const char *mnem, ArmISA::ExtMachInst _machInst,
211 OpClass __opClass, ArmISA::MiscRegIndex _dest,
212 RegIndex _op1) :
213 MiscRegOp64(mnem, _machInst, __opClass, false),
214 dest(_dest), op1(_op1)
215 {}
216
217 std::string generateDisassembly(
218 Addr pc, const loader::SymbolTable *symtab) const override;
219
220 uint32_t iss() const override;
221};
222
224{
225 protected:
228
229 RegMiscRegImmOp64(const char *mnem, ArmISA::ExtMachInst _machInst,
230 OpClass __opClass, RegIndex _dest,
232 MiscRegOp64(mnem, _machInst, __opClass, true),
233 dest(_dest), op1(_op1)
234 {}
235
236 std::string generateDisassembly(
237 Addr pc, const loader::SymbolTable *symtab) const override;
238
239 uint32_t iss() const override;
240};
241
243{
244 protected:
245 const std::string fullMnemonic;
248
249 public:
250 MiscRegImplDefined64(const char *mnem, ArmISA::ExtMachInst _machInst,
251 ArmISA::MiscRegNum64 &&misc_reg, RegIndex int_reg,
252 bool misc_read, const std::string full_mnem) :
253 MiscRegOp64(mnem, _machInst, No_OpClass, misc_read),
254 fullMnemonic(full_mnem), miscReg(misc_reg), intReg(int_reg)
255 {
257 }
258
259 protected:
261 trace::InstRecord *traceData) const override;
262
263 std::string generateDisassembly(
264 Addr pc, const loader::SymbolTable *symtab) const override;
265
266 uint32_t iss() const override;
267};
268
270{
271 protected:
273
274 RegNone(const char *mnem, ArmISA::ExtMachInst _machInst,
275 OpClass __opClass, RegIndex _dest) :
276 ArmISA::ArmStaticInst(mnem, _machInst, __opClass),
277 dest(_dest)
278 {}
279
280 std::string generateDisassembly(
281 Addr pc, const loader::SymbolTable *symtab) const;
282};
283
285{
286 protected:
287 TlbiOp64(const char *mnem, ArmISA::ExtMachInst _machInst,
288 OpClass __opClass, ArmISA::MiscRegIndex _dest,
289 RegIndex _op1) :
290 MiscRegRegImmOp64(mnem, _machInst, __opClass, _dest, _op1)
291 {}
292
293 void performTlbi(ExecContext *xc,
294 ArmISA::MiscRegIndex idx, RegVal value) const;
295};
296
297} // namespace gem5
298
299#endif
The ExecContext is an abstract base class the provides the interface used by the ISA to manipulate th...
ImmOp64(const char *mnem, ArmISA::ExtMachInst _machInst, OpClass __opClass, uint64_t _imm)
Definition misc64.hh:51
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition misc64.cc:49
uint64_t imm
Definition misc64.hh:49
RegVal miscRegImm() const
Returns the "register view" of the immediate field.
Definition misc64.cc:148
ArmISA::MiscRegIndex dest
Definition misc64.hh:183
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition misc64.cc:163
MiscRegImmOp64(const char *mnem, ArmISA::ExtMachInst _machInst, OpClass __opClass, ArmISA::MiscRegIndex _dest, uint32_t _imm)
Definition misc64.hh:186
const ArmISA::MiscRegNum64 miscReg
Definition misc64.hh:246
const std::string fullMnemonic
Definition misc64.hh:245
uint32_t iss() const override
Definition misc64.cc:231
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition misc64.cc:224
Fault execute(ExecContext *xc, trace::InstRecord *traceData) const override
Definition misc64.cc:213
const RegIndex intReg
Definition misc64.hh:247
MiscRegImplDefined64(const char *mnem, ArmISA::ExtMachInst _machInst, ArmISA::MiscRegNum64 &&misc_reg, RegIndex int_reg, bool misc_read, const std::string full_mnem)
Definition misc64.hh:250
This class is implementing the Base class for a generic AArch64 instruction which is making use of sy...
Definition misc64.hh:157
uint32_t _iss(const ArmISA::MiscRegNum64 &misc_reg, RegIndex int_index) const
Definition misc64.cc:114
MiscRegOp64(const char *mnem, ArmISA::ExtMachInst _machInst, OpClass __opClass, bool misc_read)
Definition misc64.hh:161
Fault generateTrap(ArmISA::ExceptionLevel el) const
Definition misc64.cc:126
virtual uint32_t iss() const
Definition misc64.hh:171
bool miscRead() const
Definition misc64.hh:173
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition misc64.cc:175
ArmISA::MiscRegIndex dest
Definition misc64.hh:207
uint32_t iss() const override
Definition misc64.cc:187
MiscRegRegImmOp64(const char *mnem, ArmISA::ExtMachInst _machInst, OpClass __opClass, ArmISA::MiscRegIndex _dest, RegIndex _op1)
Definition misc64.hh:210
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition misc64.cc:67
RegImmImmOp64(const char *mnem, ArmISA::ExtMachInst _machInst, OpClass __opClass, RegIndex _op1, uint64_t _imm1, uint64_t _imm2)
Definition misc64.hh:81
uint32_t iss() const override
Definition misc64.cc:206
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition misc64.cc:194
ArmISA::MiscRegIndex op1
Definition misc64.hh:227
RegMiscRegImmOp64(const char *mnem, ArmISA::ExtMachInst _machInst, OpClass __opClass, RegIndex _dest, ArmISA::MiscRegIndex _op1)
Definition misc64.hh:229
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const
Internal function to generate disassembly string.
Definition misc64.cc:237
RegNone(const char *mnem, ArmISA::ExtMachInst _machInst, OpClass __opClass, RegIndex _dest)
Definition misc64.hh:274
RegIndex dest
Definition misc64.hh:272
RegOp64(const char *mnem, ArmISA::ExtMachInst _machInst, OpClass __opClass, RegIndex _op1)
Definition misc64.hh:65
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition misc64.cc:58
RegIndex op1
Definition misc64.hh:63
RegRegImmImmOp64(const char *mnem, ArmISA::ExtMachInst _machInst, OpClass __opClass, RegIndex _dest, RegIndex _op1, uint64_t _imm1, int64_t _imm2)
Definition misc64.hh:100
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition misc64.cc:79
RegRegRegImmOp64(const char *mnem, ArmISA::ExtMachInst _machInst, OpClass __opClass, RegIndex _dest, RegIndex _op1, RegIndex _op2, uint64_t _imm)
Definition misc64.hh:120
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition misc64.cc:92
TlbiOp64(const char *mnem, ArmISA::ExtMachInst _machInst, OpClass __opClass, ArmISA::MiscRegIndex _dest, RegIndex _op1)
Definition misc64.hh:287
void performTlbi(ExecContext *xc, ArmISA::MiscRegIndex idx, RegVal value) const
Definition misc64.cc:247
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition misc64.cc:107
UnknownOp64(const char *mnem, ArmISA::ExtMachInst _machInst, OpClass __opClass)
Definition misc64.hh:136
MiscRegIndex decodeAArch64SysReg(unsigned op0, unsigned op1, unsigned crn, unsigned crm, unsigned op2)
Definition misc.cc:2162
@ MISCREG_IMPDEF_UNIMPL
Definition misc.hh:1114
Bitfield< 3, 2 > el
Definition misc_types.hh:73
Bitfield< 4 > pc
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
std::shared_ptr< FaultBase > Fault
Definition types.hh:249
uint16_t RegIndex
Definition types.hh:176
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition types.hh:147
uint64_t RegVal
Definition types.hh:173

Generated on Mon Jul 10 2023 14:24:25 for gem5 by doxygen 1.9.7