From 3caa75d53aa9c04b238aeae281983d8b73754e98 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Wed, 2 Jun 2010 12:58:10 -0500 Subject: ARM: Squash the low order bits of the PC when performing a regular branch. --- src/arch/arm/insts/static_inst.hh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/arch/arm/insts/static_inst.hh') 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)); } -- cgit v1.2.3