43 #ifndef __ARCH_ARM_TYPES_HH__
44 #define __ARCH_ARM_TYPES_HH__
50 #include "debug/Decoder.hh"
128 Bitfield<24> prepost;
218 JazelleBit = (1 << 1),
219 AArch64Bit = (1 << 2)
224 uint8_t _nextItstate;
227 PCState() : flags(0), nextFlags(0), _itstate(0), _nextItstate(0),
235 npc(val + (
thumb() ? 2 : 4));
238 PCState(
Addr val) : flags(0), nextFlags(0), _itstate(0),
239 _nextItstate(0), _size(0)
245 return flags & ThumbBit;
260 return nextFlags & ThumbBit;
267 nextFlags |= ThumbBit;
269 nextFlags &= ~ThumbBit;
272 void size(uint8_t
s) { _size =
s; }
273 uint8_t
size()
const {
return _size; }
278 return ((this->
pc() + this->
size()) != this->npc());
285 return flags & JazelleBit;
294 flags &= ~JazelleBit;
300 return nextFlags & JazelleBit;
304 nextJazelle(
bool val)
307 nextFlags |= JazelleBit;
309 nextFlags &= ~JazelleBit;
315 return flags & AArch64Bit;
324 flags &= ~AArch64Bit;
330 return nextFlags & AArch64Bit;
334 nextAArch64(
bool val)
337 nextFlags |= AArch64Bit;
339 nextFlags &= ~AArch64Bit;
362 nextItstate(uint8_t value)
364 _nextItstate = value;
375 _itstate = _nextItstate;
377 }
else if (_itstate) {
378 ITSTATE it = _itstate;
379 uint8_t cond_mask = it.mask;
380 uint8_t thumb_cond = it.cond;
382 thumb_cond, cond_mask);
384 uint8_t new_bit =
bits(cond_mask, 4);
385 cond_mask &=
mask(4);
391 thumb_cond, cond_mask);
393 it.cond = thumb_cond;
409 return pc() + (
thumb() ? 4 : 8);
421 npc(val &~
mask(nextThumb() ? 1 : 2));
434 bool thumbEE = (
thumb() && jazelle());
438 if (
bits(newPC, 0)) {
439 newPC = newPC & ~
mask(1);
444 if (
bits(newPC, 0)) {
446 newPC = newPC & ~
mask(1);
447 }
else if (!
bits(newPC, 1)) {
464 if (!
thumb() && !jazelle())
474 flags == opc.flags && nextFlags == opc.nextFlags &&
475 _itstate == opc._itstate && _nextItstate == opc._nextItstate;
481 return !(*
this == opc);
646 return ((OperatingMode64)(uint8_t)mode).width == 0;
665 bool aarch32 = ((mode >> 4) & 1) ?
true :
false;
682 panic(
"Invalid operating mode: %d", mode);
743 public hash<ArmISA::ExtMachInst::__DataType> {
746 return hash<ArmISA::ExtMachInst::__DataType>::operator()(emi);
Bitfield< 25, 20 > htopcode9_4
Bitfield< 7, 0 > immed7_0
Bitfield< 11, 7 > shiftSize
Bitfield< 15 > ltopcode15
size_t operator()(const ArmISA::ExtMachInst &emi) const
Bitfield< 12, 10 > topcode12_10
Bitfield< 55, 52 > itstateCond
Bitfield< 7, 6 > ltopcode7_6
static bool opModeIsT(OperatingMode mode)
Bitfield< 23, 20 > opcode23_20
Bitfield< 7, 5 > topcode7_5
Bitfield< 10, 9 > topcode10_9
Bitfield< 11, 9 > topcode11_9
Bitfield< 24, 22 > htopcode8_6
Bitfield< 31, 28 > condCode
Bitfield< 24, 23 > opcode24_23
Bitfield< 24, 23 > htopcode8_7
static bool badMode32(OperatingMode mode)
#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)
Bitfield< 11, 8 > topcode11_8
Bitfield< 41, 40 > fpscrStride
Bitfield< 11, 8 > ltopcode11_8
Bitfield< 24, 20 > mediaOpcode
Bitfield< 11, 8 > immedHi11_8
Bitfield< 7, 4 > ltopcode7_4
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.
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)
Bitfield< 55, 48 > itstate
EndBitUnion(CPSR) static const uint32_t CondCodesMask=0xF00F0000
Bitfield< 39, 37 > fpscrLen
EndSubBitUnion(puswl) Bitfield< 24
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
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 serialize(CheckpointOut &cp) const override
void unserialize(CheckpointIn &cp) override
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
Unaligned instruction fault.
static bool badMode(OperatingMode mode)
SubBitUnion(puswl, 24, 20) Bitfield< 24 > prepost
BitUnion8(ITSTATE) Bitfield<7
Bitfield< 11, 8 > ltcoproc
Bitfield< 51, 48 > itstateMask
DecoderFault
Instruction decoder fault codes in ExtMachInst.
Bitfield< 21, 20 > htopcode5_4