41 #ifndef __ARCH_ARM_PCSTATE_HH__
42 #define __ARCH_ARM_PCSTATE_HH__
47 #include "debug/Decoder.hh"
69 class
PCState : public GenericISA::UPCState<4>
78 JazelleBit = (1 << 1),
94 PCState() : flags(0), nextFlags(0), _itstate(0), _nextItstate(0),
95 _size(0), _illegalExec(
false), _debugStep(
false),
107 _nextItstate(0), _size(0), _illegalExec(
false),
108 _debugStep(
false), _stepped(
false)
118 illegalExec(
bool val)
150 return flags & ThumbBit;
165 return nextFlags & ThumbBit;
172 nextFlags |= ThumbBit;
174 nextFlags &= ~ThumbBit;
177 void size(uint8_t
s) { _size =
s; }
178 uint8_t size()
const {
return _size; }
183 return ((this->
pc() + this->size()) != this->npc());
190 return flags & JazelleBit;
199 flags &= ~JazelleBit;
205 return nextFlags & JazelleBit;
209 nextJazelle(
bool val)
212 nextFlags |= JazelleBit;
214 nextFlags &= ~JazelleBit;
220 return flags & AArch64Bit;
229 flags &= ~AArch64Bit;
235 return nextFlags & AArch64Bit;
239 nextAArch64(
bool val)
242 nextFlags |= AArch64Bit;
244 nextFlags &= ~AArch64Bit;
267 nextItstate(uint8_t value)
269 _nextItstate = value;
280 _itstate = _nextItstate;
282 }
else if (_itstate) {
283 ITSTATE it = _itstate;
284 uint8_t cond_mask = it.mask;
285 uint8_t thumb_cond = it.cond;
287 thumb_cond, cond_mask);
289 uint8_t new_bit =
bits(cond_mask, 4);
290 cond_mask &=
mask(4);
296 thumb_cond, cond_mask);
298 it.cond = thumb_cond;
314 return pc() + (
thumb() ? 4 : 8);
326 npc(
val &~
mask(nextThumb() ? 1 : 2));
339 bool thumbEE = (
thumb() && jazelle());
343 if (
bits(newPC, 0)) {
344 newPC = newPC & ~
mask(1);
349 if (
bits(newPC, 0)) {
351 newPC = newPC & ~
mask(1);
352 }
else if (!
bits(newPC, 1)) {
369 if (!
thumb() && !jazelle())
379 flags == opc.flags && nextFlags == opc.nextFlags &&
380 _itstate == opc._itstate &&
381 _nextItstate == opc._nextItstate &&
382 _illegalExec == opc._illegalExec &&
383 _debugStep == opc._debugStep &&
384 _stepped == opc._stepped;
390 return !(*
this == opc);