gem5 v24.0.0.0
Loading...
Searching...
No Matches
static_inst.hh
Go to the documentation of this file.
1/*
2 * Copyright (c) 2010-2013,2016-2018, 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 * Copyright (c) 2007-2008 The Florida State University
15 * All rights reserved.
16 *
17 * Redistribution and use in source and binary forms, with or without
18 * modification, are permitted provided that the following conditions are
19 * met: redistributions of source code must retain the above copyright
20 * notice, this list of conditions and the following disclaimer;
21 * redistributions in binary form must reproduce the above copyright
22 * notice, this list of conditions and the following disclaimer in the
23 * documentation and/or other materials provided with the distribution;
24 * neither the name of the copyright holders nor the names of its
25 * contributors may be used to endorse or promote products derived from
26 * this software without specific prior written permission.
27 *
28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 */
40
41#ifndef __ARCH_ARM_INSTS_STATICINST_HH__
42#define __ARCH_ARM_INSTS_STATICINST_HH__
43
44#include <memory>
45
46#include "arch/arm/faults.hh"
47#include "arch/arm/utility.hh"
48#include "arch/arm/isa.hh"
49#include "arch/arm/pcstate.hh"
51#include "arch/arm/system.hh"
52#include "base/trace.hh"
53#include "cpu/exec_context.hh"
54#include "cpu/static_inst.hh"
55#include "cpu/thread_context.hh"
56#include "sim/byteswap.hh"
57#include "sim/full_system.hh"
58
59namespace gem5
60{
61
62namespace ArmISA
63{
64
66{
67 protected:
68 bool aarch64;
69 uint8_t intWidth;
70
71 int32_t shift_rm_imm(uint32_t base, uint32_t shamt,
72 uint32_t type, uint32_t cfval) const;
73 int32_t shift_rm_rs(uint32_t base, uint32_t shamt,
74 uint32_t type, uint32_t cfval) const;
75
76 bool shift_carry_imm(uint32_t base, uint32_t shamt,
77 uint32_t type, uint32_t cfval) const;
78 bool shift_carry_rs(uint32_t base, uint32_t shamt,
79 uint32_t type, uint32_t cfval) const;
80
81 int64_t shiftReg64(uint64_t base, uint64_t shiftAmt,
82 ArmShiftType type, uint8_t width) const;
83 int64_t extendReg64(uint64_t base, ArmExtendType type,
84 uint64_t shiftAmt, uint8_t width) const;
85
86 template<int width>
87 static inline bool
88 saturateOp(int32_t &res, int64_t op1, int64_t op2, bool sub=false)
89 {
90 int64_t midRes = sub ? (op1 - op2) : (op1 + op2);
91 if (bits(midRes, width) != bits(midRes, width - 1)) {
92 if (midRes > 0)
93 res = (1LL << (width - 1)) - 1;
94 else
95 res = -(1LL << (width - 1));
96 return true;
97 } else {
98 res = midRes;
99 return false;
100 }
101 }
102
103 static inline bool
104 satInt(int32_t &res, int64_t op, int width)
105 {
106 width--;
107 if (op >= (1LL << width)) {
108 res = (1LL << width) - 1;
109 return true;
110 } else if (op < -(1LL << width)) {
111 res = -(1LL << width);
112 return true;
113 } else {
114 res = op;
115 return false;
116 }
117 }
118
119 template<int width>
120 static inline bool
121 uSaturateOp(uint32_t &res, int64_t op1, int64_t op2, bool sub=false)
122 {
123 int64_t midRes = sub ? (op1 - op2) : (op1 + op2);
124 if (midRes >= (1LL << width)) {
125 res = (1LL << width) - 1;
126 return true;
127 } else if (midRes < 0) {
128 res = 0;
129 return true;
130 } else {
131 res = midRes;
132 return false;
133 }
134 }
135
136 static inline bool
137 uSatInt(int32_t &res, int64_t op, int width)
138 {
139 if (op >= (1LL << width)) {
140 res = (1LL << width) - 1;
141 return true;
142 } else if (op < 0) {
143 res = 0;
144 return true;
145 } else {
146 res = op;
147 return false;
148 }
149 }
150
152
153 // Constructor
154 ArmStaticInst(const char *mnem, ExtMachInst _machInst,
155 OpClass __opClass)
156 : StaticInst(mnem, __opClass), machInst(_machInst)
157 {
158 aarch64 = machInst.aarch64;
159 if (bits(machInst, 28, 24) == 0x10)
160 intWidth = 64; // Force 64-bit width for ADR/ADRP
161 else
162 intWidth = (aarch64 && bits(machInst, 31)) ? 64 : 32;
163 }
164
167 void printIntReg(std::ostream &os, RegIndex reg_idx,
168 uint8_t opWidth = 0) const;
169 void printFloatReg(std::ostream &os, RegIndex reg_idx) const;
170 void printVecReg(std::ostream &os, RegIndex reg_idx,
171 bool isSveVecReg = false) const;
172 void printVecPredReg(std::ostream &os, RegIndex reg_idx) const;
173 void printCCReg(std::ostream &os, RegIndex reg_idx) const;
174 void printMiscReg(std::ostream &os, RegIndex reg_idx) const;
175 void printMnemonic(std::ostream &os,
176 const std::string &suffix = "",
177 bool withPred = true,
178 bool withCond64 = false,
179 ConditionCode cond64 = COND_UC) const;
180 void printTarget(std::ostream &os, Addr target,
181 const loader::SymbolTable *symtab) const;
182 void printCondition(std::ostream &os, unsigned code,
183 bool noImplicit=false) const;
184 void printMemSymbol(std::ostream &os, const loader::SymbolTable *symtab,
185 const std::string &prefix, const Addr addr,
186 const std::string &suffix) const;
187 void printShiftOperand(std::ostream &os, RegIndex rm,
188 bool immShift, uint32_t shiftAmt,
189 RegIndex rs, ArmShiftType type) const;
190 void printExtendOperand(bool firstOperand, std::ostream &os,
192 int64_t shiftAmt) const;
193 void printPFflags(std::ostream &os, int flag) const;
194
195 void printDataInst(std::ostream &os, bool withImm) const;
196 void printDataInst(std::ostream &os, bool withImm, bool immShift, bool s,
198 RegIndex rs, uint32_t shiftAmt, ArmShiftType type,
199 uint64_t imm) const;
200
201 void
202 advancePC(PCStateBase &pcState) const override
203 {
204 pcState.as<PCState>().advance();
205 }
206
207 void
208 advancePC(ThreadContext *tc) const override
209 {
210 PCState pc = tc->pcState().as<PCState>();
211 pc.advance();
212 tc->pcState(pc);
213 }
214
215 uint64_t getEMI() const override { return machInst; }
216
217 std::unique_ptr<PCStateBase>
218 buildRetPC(const PCStateBase &cur_pc,
219 const PCStateBase &call_pc) const override
220 {
221 PCStateBase *ret_pc = call_pc.clone();
222 ret_pc->as<PCState>().uEnd();
223 return std::unique_ptr<PCStateBase>{ret_pc};
224 }
225
226 std::string generateDisassembly(
227 Addr pc, const loader::SymbolTable *symtab) const override;
228
229 static void
231 {
233 sd->activateDebug();
234 }
235
236 static inline uint32_t
237 cpsrWriteByInstr(CPSR cpsr, uint32_t val, SCR scr, NSACR nsacr,
238 uint8_t byteMask, bool affectState, bool nmfi, ThreadContext *tc)
239 {
240 bool privileged = (cpsr.mode != MODE_USER);
241 bool haveVirt = ArmSystem::haveEL(tc, EL2);
242 bool isSecure = ArmISA::isSecure(tc);
243
244 uint32_t bitMask = 0;
245
246 if (affectState && byteMask==0xF){
248 }
249 if (bits(byteMask, 3)) {
250 unsigned lowIdx = affectState ? 24 : 27;
251 bitMask = bitMask | mask(31, lowIdx);
252 }
253 if (bits(byteMask, 2)) {
254 bitMask = bitMask | mask(19, 16);
255 }
256 if (bits(byteMask, 1)) {
257 unsigned highIdx = affectState ? 15 : 9;
258 unsigned lowIdx = (privileged && (isSecure || scr.aw || haveVirt))
259 ? 8 : 9;
260 bitMask = bitMask | mask(highIdx, lowIdx);
261 }
262 if (bits(byteMask, 0)) {
263 if (privileged) {
264 bitMask |= 1 << 7;
265 if ( (!nmfi || !((val >> 6) & 0x1)) &&
266 (isSecure || scr.fw || haveVirt) ) {
267 bitMask |= 1 << 6;
268 }
269 // Now check the new mode is allowed
270 OperatingMode newMode = (OperatingMode) (val & mask(5));
271 OperatingMode oldMode = (OperatingMode)(uint32_t)cpsr.mode;
272 if (!badMode(tc, newMode)) {
273 bool validModeChange = true;
274 // Check for attempts to enter modes only permitted in
275 // Secure state from Non-secure state. These are Monitor
276 // mode ('10110'), and FIQ mode ('10001') if the Security
277 // Extensions have reserved it.
278 if (!isSecure && newMode == MODE_MON)
279 validModeChange = false;
280 if (!isSecure && newMode == MODE_FIQ && nsacr.rfr == '1')
281 validModeChange = false;
282 // There is no Hyp mode ('11010') in Secure state, so that
283 // is UNPREDICTABLE
284 if (scr.ns == 0 && newMode == MODE_HYP)
285 validModeChange = false;
286 // Cannot move into Hyp mode directly from a Non-secure
287 // PL1 mode
288 if (!isSecure && oldMode != MODE_HYP && newMode == MODE_HYP)
289 validModeChange = false;
290 // Cannot move out of Hyp mode with this function except
291 // on an exception return
292 if (oldMode == MODE_HYP && newMode != MODE_HYP && !affectState)
293 validModeChange = false;
294 // Must not change to 64 bit when running in 32 bit mode
295 if (!opModeIs64(oldMode) && opModeIs64(newMode))
296 validModeChange = false;
297
298 // If we passed all of the above then set the bit mask to
299 // copy the mode accross
300 if (validModeChange) {
301 bitMask = bitMask | mask(5);
302 } else {
303 warn_once("Illegal change to CPSR mode attempted\n");
304 }
305 } else {
306 warn_once("Ignoring write of bad mode to CPSR.\n");
307 }
308 }
309 if (affectState)
310 bitMask = bitMask | (1 << 5);
311 }
312
313 return ((uint32_t)cpsr & ~bitMask) | (val & bitMask);
314 }
315
316 static inline uint32_t
317 spsrWriteByInstr(uint32_t spsr, uint32_t val,
318 uint8_t byteMask, bool affectState)
319 {
320 uint32_t bitMask = 0;
321
322 if (bits(byteMask, 3))
323 bitMask = bitMask | mask(31, 24);
324 if (bits(byteMask, 2))
325 bitMask = bitMask | mask(19, 16);
326 if (bits(byteMask, 1))
327 bitMask = bitMask | mask(15, 8);
328 if (bits(byteMask, 0))
329 bitMask = bitMask | mask(7, 0);
330
331 return ((spsr & ~bitMask) | (val & bitMask));
332 }
333
334 static inline Addr
336 {
337 return xc->pcState().as<PCState>().instPC();
338 }
339
340 static inline void
342 {
343 PCState pc = xc->pcState().as<PCState>();
344 pc.instNPC(val);
345 xc->pcState(pc);
346 }
347
348 template<class T>
349 static inline T
350 cSwap(T val, bool big)
351 {
352 if (big) {
353 return letobe(val);
354 } else {
355 return val;
356 }
357 }
358
359 template<class T, class E>
360 static inline T
361 cSwap(T val, bool big)
362 {
363 const unsigned count = sizeof(T) / sizeof(E);
364 union
365 {
366 T tVal;
367 E eVals[count];
368 } conv;
369 conv.tVal = htole(val);
370 if (big) {
371 for (unsigned i = 0; i < count; i++) {
372 conv.eVals[i] = letobe(conv.eVals[i]);
373 }
374 } else {
375 for (unsigned i = 0; i < count; i++) {
376 conv.eVals[i] = conv.eVals[i];
377 }
378 }
379 return letoh(conv.tVal);
380 }
381
382 // Perform an interworking branch.
383 static inline void
385 {
386 PCState pc = xc->pcState().as<PCState>();
387 pc.instIWNPC(val);
388 xc->pcState(pc);
389 }
390
391 // Perform an interworking branch in ARM mode, a regular branch
392 // otherwise.
393 static inline void
395 {
396 PCState pc = xc->pcState().as<PCState>();
397 pc.instAIWNPC(val);
398 xc->pcState(pc);
399 }
400
401 inline Fault disabledFault() const { return undefined(true); }
402
403 // Utility function used by checkForWFxTrap32 and checkForWFxTrap64
404 // Returns true if processor has to trap a WFI/WFE instruction.
406 ExceptionLevel targetEL, bool isWfe) const;
407
414 Fault softwareBreakpoint32(ExecContext *xc, uint16_t imm) const;
415
426
427
434 Fault checkFPAdvSIMDTrap64(ThreadContext *tc, CPSR cpsr) const;
435
444 CPSR cpsr, CPACR cpacr) const;
445
453 CPSR cpsr, CPACR cpacr,
454 NSACR nsacr, FPEXC fpexc,
455 bool fpexc_check, bool advsimd) const;
456
464 ExceptionLevel tgtEl, bool isWfe) const;
465
473 ExceptionLevel tgtEl, bool isWfe) const;
474
478 Fault trapWFx(ThreadContext *tc, CPSR cpsr, SCR scr, bool isWfe) const;
479
486 Fault checkSETENDEnabled(ThreadContext *tc, CPSR cpsr) const;
487
495
503
510
514 Fault checkSveEnabled(ThreadContext *tc, CPSR cpsr, CPACR cpacr) const;
515
516
523 Fault smeAccessTrap(ExceptionLevel el, uint32_t iss = 0) const;
524
529 Fault checkSmeEnabled(ThreadContext *tc, CPSR cpsr, CPACR cpacr) const;
530
537 Fault checkSmeAccess(ThreadContext *tc, CPSR cpsr, CPACR cpacr) const;
538
543 Fault checkSveSmeEnabled(ThreadContext *tc, CPSR cpsr, CPACR cpacr) const;
544
552 CPSR getPSTATEFromPSR(ThreadContext *tc, CPSR cpsr, CPSR spsr) const;
553
563 ExceptionLevel pstateEL) const;
564
565 public:
566 virtual void
568
569 uint8_t
571 {
572 return intWidth;
573 }
574
576 ssize_t
577 instSize() const
578 {
579 return (!machInst.thumb || machInst.bigThumb) ? 4 : 2;
580 }
581
589 encoding() const
590 {
591 return static_cast<MachInst>(machInst & (mask(instSize() * 8)));
592 }
593
594 size_t
595 asBytes(void *buf, size_t max_size) override
596 {
597 return simpleAsBytes(buf, max_size, machInst);
598 }
599
600 static unsigned getCurSveVecLenInBits(ThreadContext *tc);
601
602 static unsigned
604 {
605 return getCurSveVecLenInBits(tc) >> 6;
606 }
607
608 template<typename T>
609 static unsigned
611 {
612 return getCurSveVecLenInBits(tc) / (8 * sizeof(T));
613 }
614
615 static unsigned getCurSmeVecLenInBits(ThreadContext *tc);
616
617 static unsigned
619 {
620 return getCurSmeVecLenInBits(tc) >> 6;
621 }
622
623 template<typename T>
624 static unsigned
626 {
627 return getCurSmeVecLenInBits(tc) / (8 * sizeof(T));
628 }
629
630 inline Fault
631 undefined(bool disabled=false) const
632 {
633 return std::make_shared<UndefinedInstruction>(
634 machInst, false, mnemonic, disabled);
635 }
636};
637
638} // namespace ArmISA
639} // namespace gem5
640
641#endif //__ARCH_ARM_INSTS_STATICINST_HH__
void printMiscReg(std::ostream &os, RegIndex reg_idx) const
int64_t extendReg64(uint64_t base, ArmExtendType type, uint64_t shiftAmt, uint8_t width) const
Fault checkSveSmeEnabled(ThreadContext *tc, CPSR cpsr, CPACR cpacr) const
Check an SVE access against CPACR_EL1, CPTR_EL2, and CPTR_EL3, but choosing the correct set of traps ...
void printExtendOperand(bool firstOperand, std::ostream &os, RegIndex rm, ArmExtendType type, int64_t shiftAmt) const
Fault softwareBreakpoint32(ExecContext *xc, uint16_t imm) const
Trigger a Software Breakpoint.
bool shift_carry_imm(uint32_t base, uint32_t shamt, uint32_t type, uint32_t cfval) const
void advancePC(ThreadContext *tc) const override
ArmStaticInst(const char *mnem, ExtMachInst _machInst, OpClass __opClass)
void printCondition(std::ostream &os, unsigned code, bool noImplicit=false) const
void printMnemonic(std::ostream &os, const std::string &suffix="", bool withPred=true, bool withCond64=false, ConditionCode cond64=COND_UC) const
void printCCReg(std::ostream &os, RegIndex reg_idx) const
bool generalExceptionsToAArch64(ThreadContext *tc, ExceptionLevel pstateEL) const
Return true if exceptions normally routed to EL1 are being handled at an Exception level using AArch6...
Fault checkSveEnabled(ThreadContext *tc, CPSR cpsr, CPACR cpacr) const
Check an SVE access against CPACR_EL1, CPTR_EL2, and CPTR_EL3.
static unsigned getCurSveVecLen(ThreadContext *tc)
void printMemSymbol(std::ostream &os, const loader::SymbolTable *symtab, const std::string &prefix, const Addr addr, const std::string &suffix) const
Fault undefinedFault32(ThreadContext *tc, ExceptionLevel el) const
UNDEFINED behaviour in AArch32.
ssize_t instSize() const
Returns the byte size of current instruction.
static void setIWNextPC(ExecContext *xc, Addr val)
static unsigned getCurSmeVecLenInBits(ThreadContext *tc)
Fault checkForWFxTrap64(ThreadContext *tc, ExceptionLevel tgtEl, bool isWfe) const
Check if WFE/WFI instruction execution in aarch64 should be trapped.
static void activateBreakpoint(ThreadContext *tc)
Fault undefined(bool disabled=false) const
static unsigned getCurSveVecLenInBits(ThreadContext *tc)
bool isWFxTrapping(ThreadContext *tc, ExceptionLevel targetEL, bool isWfe) const
Fault smeAccessTrap(ExceptionLevel el, uint32_t iss=0) const
Trap an access to SME registers due to access control bits.
int64_t shiftReg64(uint64_t base, uint64_t shiftAmt, ArmShiftType type, uint8_t width) const
static bool uSaturateOp(uint32_t &res, int64_t op1, int64_t op2, bool sub=false)
Fault checkAdvSIMDOrFPEnabled32(ThreadContext *tc, CPSR cpsr, CPACR cpacr, NSACR nsacr, FPEXC fpexc, bool fpexc_check, bool advsimd) const
Check if a VFP/SIMD access from aarch32 should be allowed.
int32_t shift_rm_rs(uint32_t base, uint32_t shamt, uint32_t type, uint32_t cfval) const
void printDataInst(std::ostream &os, bool withImm) const
size_t asBytes(void *buf, size_t max_size) override
Instruction classes can override this function to return a a representation of themselves as a blob o...
static void setNextPC(ExecContext *xc, Addr val)
void advancePC(PCStateBase &pcState) const override
CPSR getPSTATEFromPSR(ThreadContext *tc, CPSR cpsr, CPSR spsr) const
Get the new PSTATE from a SPSR register in preparation for an exception return.
void printPFflags(std::ostream &os, int flag) const
Fault trapWFx(ThreadContext *tc, CPSR cpsr, SCR scr, bool isWfe) const
WFE/WFI trapping helper function.
Fault checkSmeEnabled(ThreadContext *tc, CPSR cpsr, CPACR cpacr) const
Check if SME is enabled by checking the SME and FP bits of CPACR_EL1, CPTR_EL2, and CPTR_EL3.
Fault undefinedFault64(ThreadContext *tc, ExceptionLevel el) const
UNDEFINED behaviour in AArch64.
void printVecReg(std::ostream &os, RegIndex reg_idx, bool isSveVecReg=false) const
void printIntReg(std::ostream &os, RegIndex reg_idx, uint8_t opWidth=0) const
Print a register name for disassembly given the unique dependence tag number (FP or int).
static uint32_t cpsrWriteByInstr(CPSR cpsr, uint32_t val, SCR scr, NSACR nsacr, uint8_t byteMask, bool affectState, bool nmfi, ThreadContext *tc)
void printShiftOperand(std::ostream &os, RegIndex rm, bool immShift, uint32_t shiftAmt, RegIndex rs, ArmShiftType type) const
uint64_t getEMI() const override
Fault advSIMDFPAccessTrap64(ExceptionLevel el) const
Trap an access to Advanced SIMD or FP registers due to access control bits.
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
std::unique_ptr< PCStateBase > buildRetPC(const PCStateBase &cur_pc, const PCStateBase &call_pc) const override
static void setAIWNextPC(ExecContext *xc, Addr val)
static unsigned getCurSmeVecLenInQWords(ThreadContext *tc)
static Addr readPC(ExecContext *xc)
virtual void annotateFault(ArmFault *fault)
Fault checkSmeAccess(ThreadContext *tc, CPSR cpsr, CPACR cpacr) const
Check an SME access against CPACR_EL1, CPTR_EL2, and CPTR_EL3.
static bool saturateOp(int32_t &res, int64_t op1, int64_t op2, bool sub=false)
static bool uSatInt(int32_t &res, int64_t op, int width)
void printFloatReg(std::ostream &os, RegIndex reg_idx) const
static bool satInt(int32_t &res, int64_t op, int width)
Fault checkFPAdvSIMDTrap64(ThreadContext *tc, CPSR cpsr) const
Check an Advaned SIMD access against CPTR_EL2 and CPTR_EL3.
MachInst encoding() const
Returns the real encoding of the instruction: the machInst field is in fact always 64 bit wide and co...
bool shift_carry_rs(uint32_t base, uint32_t shamt, uint32_t type, uint32_t cfval) const
static unsigned getCurSveVecLenInQWords(ThreadContext *tc)
Fault checkForWFxTrap32(ThreadContext *tc, ExceptionLevel tgtEl, bool isWfe) const
Check if WFE/WFI instruction execution in aarch32 should be trapped.
static T cSwap(T val, bool big)
void printVecPredReg(std::ostream &os, RegIndex reg_idx) const
Fault sveAccessTrap(ExceptionLevel el) const
Trap an access to SVE registers due to access control bits.
static uint32_t spsrWriteByInstr(uint32_t spsr, uint32_t val, uint8_t byteMask, bool affectState)
Fault checkFPAdvSIMDEnabled64(ThreadContext *tc, CPSR cpsr, CPACR cpacr) const
Check an Advaned SIMD access against CPACR_EL1, CPTR_EL2, and CPTR_EL3.
int32_t shift_rm_imm(uint32_t base, uint32_t shamt, uint32_t type, uint32_t cfval) const
static T cSwap(T val, bool big)
void printTarget(std::ostream &os, Addr target, const loader::SymbolTable *symtab) const
Fault checkSETENDEnabled(ThreadContext *tc, CPSR cpsr) const
Check if SETEND instruction execution in aarch32 should be trapped.
static unsigned getCurSmeVecLen(ThreadContext *tc)
SelfDebug * getSelfDebug() const
Definition isa.hh:181
static bool haveEL(ThreadContext *tc, ArmISA::ExceptionLevel el)
Return true if the system implements a specific exception level.
Definition system.cc:132
The ExecContext is an abstract base class the provides the interface used by the ISA to manipulate th...
virtual const PCStateBase & pcState() const =0
Target & as()
Definition pcstate.hh:73
virtual PCStateBase * clone() const =0
Base, ISA-independent static instruction class.
size_t simpleAsBytes(void *buf, size_t max_size, const T &t)
const char * mnemonic
Base mnemonic (e.g., "add").
ThreadContext is the external interface to all thread state for anything outside of the CPU.
virtual const PCStateBase & pcState() const =0
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
Definition bitfield.hh:79
#define warn_once(...)
Definition logging.hh:260
bool badMode(ThreadContext *tc, OperatingMode mode)
badMode is checking if the execution mode provided as an argument is valid and implemented.
Definition utility.cc:406
Bitfield< 15, 12 > rd
Definition types.hh:114
Bitfield< 3, 0 > mask
Definition pcstate.hh:63
Bitfield< 4 > width
Definition misc_types.hh:72
bool isSecure(ThreadContext *tc)
Definition utility.cc:74
Bitfield< 3, 0 > rm
Definition types.hh:118
Bitfield< 7, 0 > imm
Definition types.hh:132
Bitfield< 23, 20 > advsimd
Bitfield< 4 > s
Bitfield< 7 > i
Definition misc_types.hh:67
Bitfield< 9, 8 > rs
Bitfield< 19, 16 > rn
Definition types.hh:113
uint32_t MachInst
Definition types.hh:55
ConditionCode
Definition cc.hh:104
@ COND_UC
Definition cc.hh:120
Bitfield< 27 > nmfi
Bitfield< 24, 0 > iss
Bitfield< 4 > sd
Bitfield< 3, 2 > el
Definition misc_types.hh:73
Bitfield< 4 > pc
Bitfield< 31, 0 > E
Definition int.hh:56
Bitfield< 51, 12 > base
Definition pagetable.hh:141
Bitfield< 17 > os
Definition misc.hh:838
Bitfield< 4 > op
Definition types.hh:83
Bitfield< 63 > val
Definition misc.hh:804
Bitfield< 3 > addr
Definition types.hh:84
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
uint16_t RegIndex
Definition types.hh:176
std::shared_ptr< FaultBase > Fault
Definition types.hh:249
T letoh(T value)
Definition byteswap.hh:173
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition types.hh:147
T htole(T value)
Definition byteswap.hh:172
T letobe(T value)
Definition byteswap.hh:166

Generated on Tue Jun 18 2024 16:24:02 for gem5 by doxygen 1.11.0