43 #ifndef __ARCH_ARM_TYPES_HH__ 44 #define __ARCH_ARM_TYPES_HH__ 50 #include "debug/Decoder.hh" 133 Bitfield<24> prepost;
223 JazelleBit = (1 << 1),
224 AArch64Bit = (1 << 2)
230 uint8_t _nextItstate;
234 PCState() : flags(0), nextFlags(0), _itstate(0), _nextItstate(0),
235 _size(0), _illegalExec(
false)
246 _nextItstate(0), _size(0), _illegalExec(
false)
256 illegalExec(
bool val)
264 return flags & ThumbBit;
279 return nextFlags & ThumbBit;
286 nextFlags |= ThumbBit;
288 nextFlags &= ~ThumbBit;
291 void size(uint8_t
s) { _size =
s; }
292 uint8_t size()
const {
return _size; }
297 return ((this->
pc() + this->size()) != this->npc());
304 return flags & JazelleBit;
313 flags &= ~JazelleBit;
319 return nextFlags & JazelleBit;
323 nextJazelle(
bool val)
326 nextFlags |= JazelleBit;
328 nextFlags &= ~JazelleBit;
334 return flags & AArch64Bit;
343 flags &= ~AArch64Bit;
349 return nextFlags & AArch64Bit;
353 nextAArch64(
bool val)
356 nextFlags |= AArch64Bit;
358 nextFlags &= ~AArch64Bit;
381 nextItstate(uint8_t value)
383 _nextItstate = value;
394 _itstate = _nextItstate;
396 }
else if (_itstate) {
397 ITSTATE it = _itstate;
398 uint8_t cond_mask = it.mask;
399 uint8_t thumb_cond = it.cond;
401 thumb_cond, cond_mask);
403 uint8_t new_bit =
bits(cond_mask, 4);
404 cond_mask &=
mask(4);
410 thumb_cond, cond_mask);
412 it.cond = thumb_cond;
428 return pc() + (
thumb() ? 4 : 8);
440 npc(val &~
mask(nextThumb() ? 1 : 2));
453 bool thumbEE = (
thumb() && jazelle());
457 if (
bits(newPC, 0)) {
458 newPC = newPC & ~
mask(1);
463 if (
bits(newPC, 0)) {
465 newPC = newPC & ~
mask(1);
466 }
else if (!
bits(newPC, 1)) {
483 if (!
thumb() && !jazelle())
493 flags == opc.flags && nextFlags == opc.nextFlags &&
494 _itstate == opc._itstate &&
495 _nextItstate == opc._nextItstate &&
496 _illegalExec == opc._illegalExec;
502 return !(*
this == opc);
673 return ((OperatingMode64)(uint8_t)mode).width == 0;
692 bool aarch32 = ((mode >> 4) & 1) ? true :
false;
709 panic(
"Invalid operating mode: %d", mode);
764 static_assert(MaxSveVecLenInBits >= 128 &&
765 MaxSveVecLenInBits <= 2048 &&
766 MaxSveVecLenInBits % 128 == 0,
767 "Unsupported max. SVE vector length");
#define panic(...)
This implements a cprintf based panic() function.
static bool unknownMode(OperatingMode mode)
Bitfield< 25, 20 > htopcode9_4
constexpr unsigned VecRegSizeBytes
Bitfield< 7, 0 > immed7_0
Bitfield< 11, 7 > shiftSize
Bitfield< 15 > ltopcode15
Bitfield< 12, 10 > topcode12_10
Bitfield< 55, 52 > itstateCond
Bitfield< 61 > illegalExecution
Bitfield< 7, 6 > ltopcode7_6
static bool opModeIsT(OperatingMode mode)
Bitfield< 59, 56 > sveLen
Bitfield< 23, 20 > opcode23_20
Bitfield< 7, 5 > topcode7_5
Bitfield< 10, 9 > topcode10_9
EndBitUnion(CPSR) BitUnion64(AA64DFR0) Bitfield< 43
Bitfield< 11, 9 > topcode11_9
Bitfield< 24, 22 > htopcode8_6
Bitfield< 31, 28 > condCode
Bitfield< 24, 23 > opcode24_23
Bitfield< 24, 23 > htopcode8_7
#define UNSERIALIZE_SCALAR(scalar)
Bitfield< 10, 8 > topcode10_8
static bool operator==(const ExtMachInst &emi1, const ExtMachInst &emi2)
Bitfield< 15, 12 > opcode15_12
Bitfield< 15, 13 > topcode15_13
Bitfield< 22, 21 > htopcode6_5
Bitfield< 11, 0 > immed11_0
static bool opModeIsH(OperatingMode mode)
Bitfield< 23, 21 > htopcode7_5
Bitfield< 7, 4 > topcode7_4
GenericISA::DelaySlotUPCState< MachInst > PCState
Bitfield< 25, 24 > htopcode9_8
Bitfield< 23, 21 > opcode23_21
Bitfield< 7, 6 > topcode7_6
void replaceBits(T &val, int first, int last, B bit_val)
A convenience function to replace bits first to last of val with bit_val in place.
Bitfield< 9, 6 > topcode9_6
static ExceptionLevel opModeToEL(OperatingMode mode)
void serialize(const ThreadContext &tc, CheckpointOut &cp)
Thread context serialization helpers.
Bitfield< 11, 8 > topcode11_8
constexpr unsigned VecPredRegHasPackedRepr
Bitfield< 41, 40 > fpscrStride
Bitfield< 11, 8 > ltopcode11_8
Bitfield< 24, 20 > mediaOpcode
Bitfield< 11, 8 > immedHi11_8
Bitfield< 7, 4 > ltopcode7_4
constexpr unsigned MaxSveVecLenInDWords
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
constexpr unsigned MaxSveVecLenInWords
Bitfield< 3, 0 > immedLo3_0
Bitfield< 7, 4 > miscOpcode
Bitfield< 27, 25 > encoding
Bitfield< 26, 25 > htopcode10_9
Bitfield< 23, 0 > immed23_0
#define SERIALIZE_SCALAR(scalar)
BitUnion8(ITSTATE) Bitfield< 7
Bitfield< 55, 48 > itstate
Bitfield< 39, 37 > fpscrLen
EndSubBitUnion(puswl) Bitfield< 24
static bool unknownMode32(OperatingMode mode)
Bitfield< 28, 27 > htopcode12_11
Bitfield< 33 > sevenAndFour
std::ostream CheckpointOut
Bitfield< 15, 0 > regList
Bitfield< 12, 11 > topcode12_11
Bitfield< 24, 21 > opcode
Bitfield< 24, 21 > htopcode8_5
constexpr unsigned VecPredRegSizeBits
Bitfield< 19, 16 > opcode19_16
bool operator!=(const RefCountingPtr< T > &l, const RefCountingPtr< T > &r)
Check for inequality of two reference counting pointers.
Bitfield< 25, 21 > htopcode9_5
Bitfield< 3, 0 > topcode3_0
void unserialize(ThreadContext &tc, CheckpointIn &cp)
T bits(T val, int first, int last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it...
Bitfield< 13, 11 > topcode13_11
constexpr unsigned MaxSveVecLenInBits
Unaligned instruction fault.
SubBitUnion(puswl, 24, 20) Bitfield< 24 > prepost
Bitfield< 11, 8 > ltcoproc
Bitfield< 51, 48 > itstateMask
DecoderFault
Instruction decoder fault codes in ExtMachInst.
Bitfield< 21, 20 > htopcode5_4
constexpr unsigned MaxSveVecLenInBytes