41 #ifndef __ARCH_ARM_TYPES_HH__ 42 #define __ARCH_ARM_TYPES_HH__ 48 #include "debug/Decoder.hh" 131 Bitfield<24> prepost;
221 JazelleBit = (1 << 1),
222 AArch64Bit = (1 << 2)
228 uint8_t _nextItstate;
232 PCState() : flags(0), nextFlags(0), _itstate(0), _nextItstate(0),
233 _size(0), _illegalExec(
false)
244 _nextItstate(0), _size(0), _illegalExec(
false)
254 illegalExec(
bool val)
262 return flags & ThumbBit;
277 return nextFlags & ThumbBit;
284 nextFlags |= ThumbBit;
286 nextFlags &= ~ThumbBit;
289 void size(uint8_t
s) { _size =
s; }
290 uint8_t size()
const {
return _size; }
295 return ((this->
pc() + this->size()) != this->npc());
302 return flags & JazelleBit;
311 flags &= ~JazelleBit;
317 return nextFlags & JazelleBit;
321 nextJazelle(
bool val)
324 nextFlags |= JazelleBit;
326 nextFlags &= ~JazelleBit;
332 return flags & AArch64Bit;
341 flags &= ~AArch64Bit;
347 return nextFlags & AArch64Bit;
351 nextAArch64(
bool val)
354 nextFlags |= AArch64Bit;
356 nextFlags &= ~AArch64Bit;
379 nextItstate(uint8_t value)
381 _nextItstate = value;
392 _itstate = _nextItstate;
394 }
else if (_itstate) {
395 ITSTATE it = _itstate;
396 uint8_t cond_mask = it.mask;
397 uint8_t thumb_cond = it.cond;
399 thumb_cond, cond_mask);
401 uint8_t new_bit =
bits(cond_mask, 4);
402 cond_mask &=
mask(4);
408 thumb_cond, cond_mask);
410 it.cond = thumb_cond;
426 return pc() + (
thumb() ? 4 : 8);
438 npc(val &~
mask(nextThumb() ? 1 : 2));
451 bool thumbEE = (
thumb() && jazelle());
455 if (
bits(newPC, 0)) {
456 newPC = newPC & ~
mask(1);
461 if (
bits(newPC, 0)) {
463 newPC = newPC & ~
mask(1);
464 }
else if (!
bits(newPC, 1)) {
481 if (!
thumb() && !jazelle())
491 flags == opc.flags && nextFlags == opc.nextFlags &&
492 _itstate == opc._itstate &&
493 _nextItstate == opc._nextItstate &&
494 _illegalExec == opc._illegalExec;
500 return !(*
this == opc);
671 return ((OperatingMode64)(uint8_t)mode).width == 0;
690 bool aarch32 = ((mode >> 4) & 1) ? true :
false;
707 panic(
"Invalid operating mode: %d", mode);
762 static_assert(MaxSveVecLenInBits >= 128 &&
763 MaxSveVecLenInBits <= 2048 &&
764 MaxSveVecLenInBits % 128 == 0,
765 "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
BitUnion64(CNTKCTL) Bitfield< 17 > evntis
constexpr unsigned MaxSveVecLenInBytes