diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2010-06-02 12:58:10 -0500 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2010-06-02 12:58:10 -0500 |
commit | 3caa75d53aa9c04b238aeae281983d8b73754e98 (patch) | |
tree | 6b1b240a3127872b86262db4342d32d4be0dfc85 /src/arch/arm/insts/static_inst.hh | |
parent | 36eeee013339141994ef3091c4b3726d08395f04 (diff) | |
download | gem5-3caa75d53aa9c04b238aeae281983d8b73754e98.tar.xz |
ARM: Squash the low order bits of the PC when performing a regular branch.
Diffstat (limited to 'src/arch/arm/insts/static_inst.hh')
-rw-r--r-- | src/arch/arm/insts/static_inst.hh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/arch/arm/insts/static_inst.hh b/src/arch/arm/insts/static_inst.hh index 23c04306d..c0d313680 100644 --- a/src/arch/arm/insts/static_inst.hh +++ b/src/arch/arm/insts/static_inst.hh @@ -221,7 +221,13 @@ class ArmStaticInst : public StaticInst static void setNextPC(XC *xc, Addr val) { - xc->setNextPC((xc->readNextPC() & PcModeMask) | + Addr npc = xc->readNextPC(); + if (npc & (ULL(1) << PcTBitShift)) { + val &= ~mask(1); + } else { + val &= ~mask(2); + } + xc->setNextPC((npc & PcModeMask) | (val & ~PcModeMask)); } |