gem5  v21.0.1.0
static_inst.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2013,2016-2018 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/self_debug.hh"
50 #include "arch/arm/system.hh"
51 #include "base/trace.hh"
52 #include "cpu/exec_context.hh"
53 #include "cpu/static_inst.hh"
54 #include "sim/byteswap.hh"
55 #include "sim/full_system.hh"
56 
57 namespace ArmISA
58 {
59 
60 class ArmStaticInst : public StaticInst
61 {
62  protected:
63  bool aarch64;
64  uint8_t intWidth;
65 
66  int32_t shift_rm_imm(uint32_t base, uint32_t shamt,
67  uint32_t type, uint32_t cfval) const;
68  int32_t shift_rm_rs(uint32_t base, uint32_t shamt,
69  uint32_t type, uint32_t cfval) const;
70 
71  bool shift_carry_imm(uint32_t base, uint32_t shamt,
72  uint32_t type, uint32_t cfval) const;
73  bool shift_carry_rs(uint32_t base, uint32_t shamt,
74  uint32_t type, uint32_t cfval) const;
75 
76  int64_t shiftReg64(uint64_t base, uint64_t shiftAmt,
77  ArmShiftType type, uint8_t width) const;
78  int64_t extendReg64(uint64_t base, ArmExtendType type,
79  uint64_t shiftAmt, uint8_t width) const;
80 
81  template<int width>
82  static inline bool
83  saturateOp(int32_t &res, int64_t op1, int64_t op2, bool sub=false)
84  {
85  int64_t midRes = sub ? (op1 - op2) : (op1 + op2);
86  if (bits(midRes, width) != bits(midRes, width - 1)) {
87  if (midRes > 0)
88  res = (LL(1) << (width - 1)) - 1;
89  else
90  res = -(LL(1) << (width - 1));
91  return true;
92  } else {
93  res = midRes;
94  return false;
95  }
96  }
97 
98  static inline bool
99  satInt(int32_t &res, int64_t op, int width)
100  {
101  width--;
102  if (op >= (LL(1) << width)) {
103  res = (LL(1) << width) - 1;
104  return true;
105  } else if (op < -(LL(1) << width)) {
106  res = -(LL(1) << width);
107  return true;
108  } else {
109  res = op;
110  return false;
111  }
112  }
113 
114  template<int width>
115  static inline bool
116  uSaturateOp(uint32_t &res, int64_t op1, int64_t op2, bool sub=false)
117  {
118  int64_t midRes = sub ? (op1 - op2) : (op1 + op2);
119  if (midRes >= (LL(1) << width)) {
120  res = (LL(1) << width) - 1;
121  return true;
122  } else if (midRes < 0) {
123  res = 0;
124  return true;
125  } else {
126  res = midRes;
127  return false;
128  }
129  }
130 
131  static inline bool
132  uSatInt(int32_t &res, int64_t op, int width)
133  {
134  if (op >= (LL(1) << width)) {
135  res = (LL(1) << width) - 1;
136  return true;
137  } else if (op < 0) {
138  res = 0;
139  return true;
140  } else {
141  res = op;
142  return false;
143  }
144  }
145 
146  // Constructor
147  ArmStaticInst(const char *mnem, ExtMachInst _machInst,
148  OpClass __opClass)
149  : StaticInst(mnem, _machInst, __opClass)
150  {
151  aarch64 = machInst.aarch64;
152  if (bits(machInst, 28, 24) == 0x10)
153  intWidth = 64; // Force 64-bit width for ADR/ADRP
154  else
155  intWidth = (aarch64 && bits(machInst, 31)) ? 64 : 32;
156  }
157 
160  void printIntReg(std::ostream &os, RegIndex reg_idx,
161  uint8_t opWidth = 0) const;
162  void printFloatReg(std::ostream &os, RegIndex reg_idx) const;
163  void printVecReg(std::ostream &os, RegIndex reg_idx,
164  bool isSveVecReg = false) const;
165  void printVecPredReg(std::ostream &os, RegIndex reg_idx) const;
166  void printCCReg(std::ostream &os, RegIndex reg_idx) const;
167  void printMiscReg(std::ostream &os, RegIndex reg_idx) const;
168  void printMnemonic(std::ostream &os,
169  const std::string &suffix = "",
170  bool withPred = true,
171  bool withCond64 = false,
172  ConditionCode cond64 = COND_UC) const;
173  void printTarget(std::ostream &os, Addr target,
174  const Loader::SymbolTable *symtab) const;
175  void printCondition(std::ostream &os, unsigned code,
176  bool noImplicit=false) const;
177  void printMemSymbol(std::ostream &os, const Loader::SymbolTable *symtab,
178  const std::string &prefix, const Addr addr,
179  const std::string &suffix) const;
180  void printShiftOperand(std::ostream &os, IntRegIndex rm,
181  bool immShift, uint32_t shiftAmt,
183  void printExtendOperand(bool firstOperand, std::ostream &os,
185  int64_t shiftAmt) const;
186  void printPFflags(std::ostream &os, int flag) const;
187 
188  void printDataInst(std::ostream &os, bool withImm) const;
189  void printDataInst(std::ostream &os, bool withImm, bool immShift, bool s,
191  IntRegIndex rs, uint32_t shiftAmt, ArmShiftType type,
192  uint64_t imm) const;
193 
194  void
195  advancePC(PCState &pcState) const override
196  {
197  pcState.advance();
198  }
199 
200  uint64_t getEMI() const override { return machInst; }
201 
202  std::string generateDisassembly(
203  Addr pc, const Loader::SymbolTable *symtab) const override;
204 
205  static void
207  {
209  sd->activateDebug();
210  }
211 
212  static inline uint32_t
213  cpsrWriteByInstr(CPSR cpsr, uint32_t val, SCR scr, NSACR nsacr,
214  uint8_t byteMask, bool affectState, bool nmfi, ThreadContext *tc)
215  {
216  bool privileged = (cpsr.mode != MODE_USER);
217  bool haveVirt = ArmSystem::haveVirtualization(tc);
218  bool isSecure = ArmISA::isSecure(tc);
219 
220  uint32_t bitMask = 0;
221 
222  if (affectState && byteMask==0xF){
223  activateBreakpoint(tc);
224  }
225  if (bits(byteMask, 3)) {
226  unsigned lowIdx = affectState ? 24 : 27;
227  bitMask = bitMask | mask(31, lowIdx);
228  }
229  if (bits(byteMask, 2)) {
230  bitMask = bitMask | mask(19, 16);
231  }
232  if (bits(byteMask, 1)) {
233  unsigned highIdx = affectState ? 15 : 9;
234  unsigned lowIdx = (privileged && (isSecure || scr.aw || haveVirt))
235  ? 8 : 9;
236  bitMask = bitMask | mask(highIdx, lowIdx);
237  }
238  if (bits(byteMask, 0)) {
239  if (privileged) {
240  bitMask |= 1 << 7;
241  if ( (!nmfi || !((val >> 6) & 0x1)) &&
242  (isSecure || scr.fw || haveVirt) ) {
243  bitMask |= 1 << 6;
244  }
245  // Now check the new mode is allowed
246  OperatingMode newMode = (OperatingMode) (val & mask(5));
247  OperatingMode oldMode = (OperatingMode)(uint32_t)cpsr.mode;
248  if (!badMode(tc, newMode)) {
249  bool validModeChange = true;
250  // Check for attempts to enter modes only permitted in
251  // Secure state from Non-secure state. These are Monitor
252  // mode ('10110'), and FIQ mode ('10001') if the Security
253  // Extensions have reserved it.
254  if (!isSecure && newMode == MODE_MON)
255  validModeChange = false;
256  if (!isSecure && newMode == MODE_FIQ && nsacr.rfr == '1')
257  validModeChange = false;
258  // There is no Hyp mode ('11010') in Secure state, so that
259  // is UNPREDICTABLE
260  if (scr.ns == 0 && newMode == MODE_HYP)
261  validModeChange = false;
262  // Cannot move into Hyp mode directly from a Non-secure
263  // PL1 mode
264  if (!isSecure && oldMode != MODE_HYP && newMode == MODE_HYP)
265  validModeChange = false;
266  // Cannot move out of Hyp mode with this function except
267  // on an exception return
268  if (oldMode == MODE_HYP && newMode != MODE_HYP && !affectState)
269  validModeChange = false;
270  // Must not change to 64 bit when running in 32 bit mode
271  if (!opModeIs64(oldMode) && opModeIs64(newMode))
272  validModeChange = false;
273 
274  // If we passed all of the above then set the bit mask to
275  // copy the mode accross
276  if (validModeChange) {
277  bitMask = bitMask | mask(5);
278  } else {
279  warn_once("Illegal change to CPSR mode attempted\n");
280  }
281  } else {
282  warn_once("Ignoring write of bad mode to CPSR.\n");
283  }
284  }
285  if (affectState)
286  bitMask = bitMask | (1 << 5);
287  }
288 
289  return ((uint32_t)cpsr & ~bitMask) | (val & bitMask);
290  }
291 
292  static inline uint32_t
293  spsrWriteByInstr(uint32_t spsr, uint32_t val,
294  uint8_t byteMask, bool affectState)
295  {
296  uint32_t bitMask = 0;
297 
298  if (bits(byteMask, 3))
299  bitMask = bitMask | mask(31, 24);
300  if (bits(byteMask, 2))
301  bitMask = bitMask | mask(19, 16);
302  if (bits(byteMask, 1))
303  bitMask = bitMask | mask(15, 8);
304  if (bits(byteMask, 0))
305  bitMask = bitMask | mask(7, 0);
306 
307  return ((spsr & ~bitMask) | (val & bitMask));
308  }
309 
310  static inline Addr
312  {
313  return xc->pcState().instPC();
314  }
315 
316  static inline void
318  {
319  PCState pc = xc->pcState();
320  pc.instNPC(val);
321  xc->pcState(pc);
322  }
323 
324  template<class T>
325  static inline T
326  cSwap(T val, bool big)
327  {
328  if (big) {
329  return letobe(val);
330  } else {
331  return val;
332  }
333  }
334 
335  template<class T, class E>
336  static inline T
337  cSwap(T val, bool big)
338  {
339  const unsigned count = sizeof(T) / sizeof(E);
340  union {
341  T tVal;
342  E eVals[count];
343  } conv;
344  conv.tVal = htole(val);
345  if (big) {
346  for (unsigned i = 0; i < count; i++) {
347  conv.eVals[i] = letobe(conv.eVals[i]);
348  }
349  } else {
350  for (unsigned i = 0; i < count; i++) {
351  conv.eVals[i] = conv.eVals[i];
352  }
353  }
354  return letoh(conv.tVal);
355  }
356 
357  // Perform an interworking branch.
358  static inline void
360  {
361  PCState pc = xc->pcState();
362  pc.instIWNPC(val);
363  xc->pcState(pc);
364  }
365 
366  // Perform an interworking branch in ARM mode, a regular branch
367  // otherwise.
368  static inline void
370  {
371  PCState pc = xc->pcState();
372  pc.instAIWNPC(val);
373  xc->pcState(pc);
374  }
375 
376  inline Fault
378  {
379  return std::make_shared<UndefinedInstruction>(machInst, false,
380  mnemonic, true);
381  }
382 
383  // Utility function used by checkForWFxTrap32 and checkForWFxTrap64
384  // Returns true if processor has to trap a WFI/WFE instruction.
385  bool isWFxTrapping(ThreadContext *tc,
386  ExceptionLevel targetEL, bool isWfe) const;
387 
394  Fault softwareBreakpoint32(ExecContext *xc, uint16_t imm) const;
395 
406 
407 
414  Fault checkFPAdvSIMDTrap64(ThreadContext *tc, CPSR cpsr) const;
415 
424  CPSR cpsr, CPACR cpacr) const;
425 
433  CPSR cpsr, CPACR cpacr,
434  NSACR nsacr, FPEXC fpexc,
435  bool fpexc_check, bool advsimd) const;
436 
444  ExceptionLevel tgtEl, bool isWfe) const;
445 
453  ExceptionLevel tgtEl, bool isWfe) const;
454 
458  Fault trapWFx(ThreadContext *tc, CPSR cpsr, SCR scr, bool isWfe) const;
459 
466  Fault checkSETENDEnabled(ThreadContext *tc, CPSR cpsr) const;
467 
475 
483 
490 
494  Fault checkSveEnabled(ThreadContext *tc, CPSR cpsr, CPACR cpacr) const;
495 
503  CPSR getPSTATEFromPSR(ThreadContext *tc, CPSR cpsr, CPSR spsr) const;
504 
514  ExceptionLevel pstateEL) const;
515 
516  public:
517  virtual void
519 
520  uint8_t
521  getIntWidth() const
522  {
523  return intWidth;
524  }
525 
527  ssize_t
528  instSize() const
529  {
530  return (!machInst.thumb || machInst.bigThumb) ? 4 : 2;
531  }
532 
539  MachInst
540  encoding() const
541  {
542  return static_cast<MachInst>(machInst & (mask(instSize() * 8)));
543  }
544 
545  size_t
546  asBytes(void *buf, size_t max_size) override
547  {
548  return simpleAsBytes(buf, max_size, machInst);
549  }
550 
551  static unsigned getCurSveVecLenInBits(ThreadContext *tc);
552 
553  static unsigned
555  {
556  return getCurSveVecLenInBits(tc) >> 6;
557  }
558 
559  template<typename T>
560  static unsigned
562  {
563  return getCurSveVecLenInBits(tc) / (8 * sizeof(T));
564  }
565 };
566 }
567 
568 #endif //__ARCH_ARM_INSTS_STATICINST_HH__
ArmISA::SelfDebug
Definition: self_debug.hh:273
ArmISA::ArmStaticInst::readPC
static Addr readPC(ExecContext *xc)
Definition: static_inst.hh:311
ArmISA::ArmStaticInst::saturateOp
static bool saturateOp(int32_t &res, int64_t op1, int64_t op2, bool sub=false)
Definition: static_inst.hh:83
ArmISA::MODE_HYP
@ MODE_HYP
Definition: types.hh:642
ArmISA::advsimd
Bitfield< 23, 20 > advsimd
Definition: miscregs_types.hh:172
LL
#define LL(N)
int64_t constant
Definition: types.hh:48
X86ISA::os
Bitfield< 17 > os
Definition: misc.hh:803
letobe
T letobe(T value)
Definition: byteswap.hh:135
ArmISA::ArmShiftType
ArmShiftType
Definition: types.hh:567
ArmISA::ConditionCode
ConditionCode
Definition: ccregs.hh:63
ArmISA::ArmStaticInst::getCurSveVecLen
static unsigned getCurSveVecLen(ThreadContext *tc)
Definition: static_inst.hh:561
ArmISA::ArmStaticInst::printCCReg
void printCCReg(std::ostream &os, RegIndex reg_idx) const
Definition: static_inst.cc:361
warn_once
#define warn_once(...)
Definition: logging.hh:243
ArmISA::i
Bitfield< 7 > i
Definition: miscregs_types.hh:63
ArmISA::ArmStaticInst::isWFxTrapping
bool isWFxTrapping(ThreadContext *tc, ExceptionLevel targetEL, bool isWfe) const
Definition: static_inst.cc:800
StaticInst
Base, ISA-independent static instruction class.
Definition: static_inst.hh:85
ArmISA::MachInst
uint32_t MachInst
Definition: types.hh:52
ArmISA::COND_UC
@ COND_UC
Definition: ccregs.hh:79
ArmISA::width
Bitfield< 4 > width
Definition: miscregs_types.hh:68
ArmISA::ArmStaticInst::checkForWFxTrap64
Fault checkForWFxTrap64(ThreadContext *tc, ExceptionLevel tgtEl, bool isWfe) const
Check if WFE/WFI instruction execution in aarch64 should be trapped.
Definition: static_inst.cc:867
htole
T htole(T value)
Definition: byteswap.hh:141
ArmISA::OperatingMode
OperatingMode
Definition: types.hh:628
ArmISA::ArmStaticInst::sveAccessTrap
Fault sveAccessTrap(ExceptionLevel el) const
Trap an access to SVE registers due to access control bits.
Definition: static_inst.cc:996
ArmISA::ArmStaticInst::advancePC
void advancePC(PCState &pcState) const override
Definition: static_inst.hh:195
ArmISA::ArmStaticInst::checkFPAdvSIMDEnabled64
Fault checkFPAdvSIMDEnabled64(ThreadContext *tc, CPSR cpsr, CPACR cpacr) const
Check an Advaned SIMD access against CPACR_EL1, CPTR_EL2, and CPTR_EL3.
Definition: static_inst.cc:711
Loader::SymbolTable
Definition: symtab.hh:58
ArmISA::IntRegIndex
IntRegIndex
Definition: intregs.hh:51
X86ISA::E
Bitfield< 31, 0 > E
Definition: int.hh:51
X86ISA::base
Bitfield< 51, 12 > base
Definition: pagetable.hh:138
X86ISA::op
Bitfield< 4 > op
Definition: types.hh:79
StaticInst::machInst
const TheISA::ExtMachInst machInst
The binary machine instruction.
Definition: static_inst.hh:259
ArmISA::ArmStaticInst::advSIMDFPAccessTrap64
Fault advSIMDFPAccessTrap64(ExceptionLevel el) const
Trap an access to Advanced SIMD or FP registers due to access control bits.
Definition: static_inst.cc:652
ArmISA::ArmStaticInst::printIntReg
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).
Definition: static_inst.cc:296
ArmISA::ArmStaticInst::shiftReg64
int64_t shiftReg64(uint64_t base, uint64_t shiftAmt, ArmShiftType type, uint8_t width) const
Definition: static_inst.cc:92
ArmISA::ArmStaticInst::shift_rm_imm
int32_t shift_rm_imm(uint32_t base, uint32_t shamt, uint32_t type, uint32_t cfval) const
Definition: static_inst.cc:57
system.hh
RefCounted::count
int count
Definition: refcnt.hh:64
ArmISA::ArmStaticInst::printShiftOperand
void printShiftOperand(std::ostream &os, IntRegIndex rm, bool immShift, uint32_t shiftAmt, IntRegIndex rs, ArmShiftType type) const
Definition: static_inst.cc:495
ArmISA::ArmStaticInst::printMemSymbol
void printMemSymbol(std::ostream &os, const Loader::SymbolTable *symtab, const std::string &prefix, const Addr addr, const std::string &suffix) const
Definition: static_inst.cc:477
ArmISA
Definition: ccregs.hh:41
ArmSystem::haveVirtualization
bool haveVirtualization() const
Returns true if this system implements the virtualization Extensions.
Definition: system.hh:168
ArmISA::ArmStaticInst
Definition: static_inst.hh:60
ArmISA::ArmStaticInst::shift_carry_imm
bool shift_carry_imm(uint32_t base, uint32_t shamt, uint32_t type, uint32_t cfval) const
Definition: static_inst.cc:217
ArmISA::ArmStaticInst::softwareBreakpoint32
Fault softwareBreakpoint32(ExecContext *xc, uint16_t imm) const
Trigger a Software Breakpoint.
Definition: static_inst.cc:632
ExecContext::pcState
virtual TheISA::PCState pcState() const =0
ArmISA::ArmStaticInst::checkForWFxTrap32
Fault checkForWFxTrap32(ThreadContext *tc, ExceptionLevel tgtEl, bool isWfe) const
Check if WFE/WFI instruction execution in aarch32 should be trapped.
Definition: static_inst.cc:827
ArmISA::ArmStaticInst::printExtendOperand
void printExtendOperand(bool firstOperand, std::ostream &os, IntRegIndex rm, ArmExtendType type, int64_t shiftAmt) const
Definition: static_inst.cc:559
ArmISA::ArmStaticInst::checkSETENDEnabled
Fault checkSETENDEnabled(ThreadContext *tc, CPSR cpsr) const
Check if SETEND instruction execution in aarch32 should be trapped.
Definition: static_inst.cc:925
letoh
T letoh(T value)
Definition: byteswap.hh:142
ArmISA::rn
Bitfield< 19, 16 > rn
Definition: types.hh:122
ArmISA::ArmStaticInst::extendReg64
int64_t extendReg64(uint64_t base, ArmExtendType type, uint64_t shiftAmt, uint8_t width) const
Definition: static_inst.cc:131
ArmISA::ArmStaticInst::uSaturateOp
static bool uSaturateOp(uint32_t &res, int64_t op1, int64_t op2, bool sub=false)
Definition: static_inst.hh:116
ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition: thread_context.hh:88
ArmISA::ArmStaticInst::cSwap
static T cSwap(T val, bool big)
Definition: static_inst.hh:337
ArmISA::ArmFault
Definition: faults.hh:60
ArmISA::ArmStaticInst::getCurSveVecLenInBits
static unsigned getCurSveVecLenInBits(ThreadContext *tc)
Definition: static_inst.cc:1216
ArmISA::ExceptionLevel
ExceptionLevel
Definition: types.hh:621
ArmISA::imm
Bitfield< 7, 0 > imm
Definition: types.hh:141
Fault
std::shared_ptr< FaultBase > Fault
Definition: types.hh:246
ArmISA::ArmStaticInst::annotateFault
virtual void annotateFault(ArmFault *fault)
Definition: static_inst.hh:518
MipsISA::pc
Bitfield< 4 > pc
Definition: pra_constants.hh:240
isa.hh
ArmISA::ArmStaticInst::setAIWNextPC
static void setAIWNextPC(ExecContext *xc, Addr val)
Definition: static_inst.hh:369
ArmISA::ArmStaticInst::undefinedFault32
Fault undefinedFault32(ThreadContext *tc, ExceptionLevel el) const
UNDEFINED behaviour in AArch32.
Definition: static_inst.cc:957
ArmISA::ArmStaticInst::spsrWriteByInstr
static uint32_t spsrWriteByInstr(uint32_t spsr, uint32_t val, uint8_t byteMask, bool affectState)
Definition: static_inst.hh:293
ArmISA::el
Bitfield< 3, 2 > el
Definition: miscregs_types.hh:69
ArmISA::ArmStaticInst::printMiscReg
void printMiscReg(std::ostream &os, RegIndex reg_idx) const
Definition: static_inst.cc:367
ExecContext
The ExecContext is an abstract base class the provides the interface used by the ISA to manipulate th...
Definition: exec_context.hh:70
ArmISA::sd
Bitfield< 4 > sd
Definition: miscregs_types.hh:768
ArmISA::ArmStaticInst::satInt
static bool satInt(int32_t &res, int64_t op, int width)
Definition: static_inst.hh:99
ArmISA::ArmStaticInst::getIntWidth
uint8_t getIntWidth() const
Definition: static_inst.hh:521
ArmISA::ArmStaticInst::intWidth
uint8_t intWidth
Definition: static_inst.hh:64
ArmISA::ArmStaticInst::getEMI
uint64_t getEMI() const override
Definition: static_inst.hh:200
ArmISA::ArmStaticInst::shift_carry_rs
bool shift_carry_rs(uint32_t base, uint32_t shamt, uint32_t type, uint32_t cfval) const
Definition: static_inst.cc:257
ArmISA::rd
Bitfield< 15, 12 > rd
Definition: types.hh:123
StaticInst::mnemonic
const char * mnemonic
Base mnemonic (e.g., "add").
Definition: static_inst.hh:284
static_inst.hh
ArmISA::MODE_FIQ
@ MODE_FIQ
Definition: types.hh:637
faults.hh
ArmISA::ArmStaticInst::checkFPAdvSIMDTrap64
Fault checkFPAdvSIMDTrap64(ThreadContext *tc, CPSR cpsr) const
Check an Advaned SIMD access against CPTR_EL2 and CPTR_EL3.
Definition: static_inst.cc:672
ArmISA::ArmStaticInst::setIWNextPC
static void setIWNextPC(ExecContext *xc, Addr val)
Definition: static_inst.hh:359
X86ISA::val
Bitfield< 63 > val
Definition: misc.hh:769
ArmISA::ArmStaticInst::aarch64
bool aarch64
Definition: static_inst.hh:63
ArmISA::ArmStaticInst::printCondition
void printCondition(std::ostream &os, unsigned code, bool noImplicit=false) const
Definition: static_inst.cc:414
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:148
ArmISA::rm
Bitfield< 3, 0 > rm
Definition: types.hh:127
ArmISA::ArmStaticInst::getCurSveVecLenInQWords
static unsigned getCurSveVecLenInQWords(ThreadContext *tc)
Definition: static_inst.hh:554
ArmISA::ArmStaticInst::printVecPredReg
void printVecPredReg(std::ostream &os, RegIndex reg_idx) const
Definition: static_inst.cc:355
ArmISA::ArmStaticInst::printVecReg
void printVecReg(std::ostream &os, RegIndex reg_idx, bool isSveVecReg=false) const
Definition: static_inst.cc:348
utility.hh
full_system.hh
ArmISA::ISA::getSelfDebug
SelfDebug * getSelfDebug() const
Definition: isa.hh:521
X86ISA::addr
Bitfield< 3 > addr
Definition: types.hh:80
ArmISA::ArmStaticInst::checkAdvSIMDOrFPEnabled32
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.
Definition: static_inst.cc:723
ArmISA::ArmExtendType
ArmExtendType
Definition: types.hh:575
ArmISA::ArmStaticInst::printFloatReg
void printFloatReg(std::ostream &os, RegIndex reg_idx) const
Definition: static_inst.cc:342
StaticInst::simpleAsBytes
size_t simpleAsBytes(void *buf, size_t max_size, const T &t)
Definition: static_inst.hh:383
ArmISA::ArmStaticInst::generalExceptionsToAArch64
bool generalExceptionsToAArch64(ThreadContext *tc, ExceptionLevel pstateEL) const
Return true if exceptions normally routed to EL1 are being handled at an Exception level using AArch6...
Definition: static_inst.cc:1203
ArmISA::ArmStaticInst::printDataInst
void printDataInst(std::ostream &os, bool withImm) const
ArmISA::ArmStaticInst::encoding
MachInst encoding() const
Returns the real encoding of the instruction: the machInst field is in fact always 64 bit wide and co...
Definition: static_inst.hh:540
ArmISA::ArmStaticInst::uSatInt
static bool uSatInt(int32_t &res, int64_t op, int width)
Definition: static_inst.hh:132
ArmISA::nmfi
Bitfield< 27 > nmfi
Definition: miscregs_types.hh:337
MipsISA::PCState
GenericISA::DelaySlotPCState< MachInst > PCState
Definition: types.hh:41
RegIndex
uint16_t RegIndex
Definition: types.hh:52
ArmISA::ArmStaticInst::trapWFx
Fault trapWFx(ThreadContext *tc, CPSR cpsr, SCR scr, bool isWfe) const
WFE/WFI trapping helper function.
Definition: static_inst.cc:899
ArmISA::ArmStaticInst::printMnemonic
void printMnemonic(std::ostream &os, const std::string &suffix="", bool withPred=true, bool withCond64=false, ConditionCode cond64=COND_UC) const
Definition: static_inst.cc:374
exec_context.hh
ArmISA::ArmStaticInst::instSize
ssize_t instSize() const
Returns the byte size of current instruction.
Definition: static_inst.hh:528
ArmISA::rs
Bitfield< 9, 8 > rs
Definition: miscregs_types.hh:372
ArmISA::ArmStaticInst::generateDisassembly
std::string generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition: static_inst.cc:623
bits
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:73
X86ISA::type
type
Definition: misc.hh:727
ArmISA::MODE_MON
@ MODE_MON
Definition: types.hh:640
ArmISA::ArmStaticInst::getPSTATEFromPSR
CPSR getPSTATEFromPSR(ThreadContext *tc, CPSR cpsr, CPSR spsr) const
Get the new PSTATE from a SPSR register in preparation for an exception return.
Definition: static_inst.cc:1145
ArmISA::ArmStaticInst::setNextPC
static void setNextPC(ExecContext *xc, Addr val)
Definition: static_inst.hh:317
trace.hh
ArmISA::ArmStaticInst::ArmStaticInst
ArmStaticInst(const char *mnem, ExtMachInst _machInst, OpClass __opClass)
Definition: static_inst.hh:147
self_debug.hh
ArmISA::MODE_USER
@ MODE_USER
Definition: types.hh:636
ArmISA::s
Bitfield< 4 > s
Definition: miscregs_types.hh:556
ArmISA::ArmStaticInst::checkSveEnabled
Fault checkSveEnabled(ThreadContext *tc, CPSR cpsr, CPACR cpacr) const
Check an SVE access against CPACR_EL1, CPTR_EL2, and CPTR_EL3.
Definition: static_inst.cc:1013
ArmISA::ArmStaticInst::printTarget
void printTarget(std::ostream &os, Addr target, const Loader::SymbolTable *symtab) const
Definition: static_inst.cc:395
ArmISA::ArmStaticInst::shift_rm_rs
int32_t shift_rm_rs(uint32_t base, uint32_t shamt, uint32_t type, uint32_t cfval) const
Definition: static_inst.cc:177
ArmISA::ArmStaticInst::printPFflags
void printPFflags(std::ostream &os, int flag) const
Definition: static_inst.cc:331
ArmISA::ArmStaticInst::asBytes
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...
Definition: static_inst.hh:546
ArmISA::ArmStaticInst::cSwap
static T cSwap(T val, bool big)
Definition: static_inst.hh:326
ArmISA::badMode
bool badMode(ThreadContext *tc, OperatingMode mode)
badMode is checking if the execution mode provided as an argument is valid and implemented.
Definition: utility.cc:452
ArmISA::ArmStaticInst::activateBreakpoint
static void activateBreakpoint(ThreadContext *tc)
Definition: static_inst.hh:206
ArmISA::ArmStaticInst::undefinedFault64
Fault undefinedFault64(ThreadContext *tc, ExceptionLevel el) const
UNDEFINED behaviour in AArch64.
Definition: static_inst.cc:976
ArmISA::mask
Bitfield< 28, 24 > mask
Definition: miscregs_types.hh:711
ArmISA::isSecure
bool isSecure(ThreadContext *tc)
Definition: utility.cc:112
byteswap.hh
ArmISA::ArmStaticInst::disabledFault
Fault disabledFault() const
Definition: static_inst.hh:377
ArmISA::ArmStaticInst::cpsrWriteByInstr
static uint32_t cpsrWriteByInstr(CPSR cpsr, uint32_t val, SCR scr, NSACR nsacr, uint8_t byteMask, bool affectState, bool nmfi, ThreadContext *tc)
Definition: static_inst.hh:213
MipsISA::ExtMachInst
uint64_t ExtMachInst
Definition: types.hh:39

Generated on Tue Jun 22 2021 15:28:20 for gem5 by doxygen 1.8.17