summaryrefslogtreecommitdiff
path: root/src/arch/arm/insts/static_inst.hh
diff options
context:
space:
mode:
authorAli Saidi <Ali.Saidi@ARM.com>2010-10-01 16:02:45 -0500
committerAli Saidi <Ali.Saidi@ARM.com>2010-10-01 16:02:45 -0500
commitb331b02669f95adf4744b1e7db50ad4b231fb704 (patch)
tree682fc56d99d2efd7fd45651ad6d1ee35560d19f1 /src/arch/arm/insts/static_inst.hh
parentaef4a9904e0324b2aba2ddc212768d5b0c72b566 (diff)
downloadgem5-b331b02669f95adf4744b1e7db50ad4b231fb704.tar.xz
ARM: Clean up use of TBit and JBit.
Rather tha constantly using ULL(1) << PcXBitShift define those directly. Additionally, add some helper functions to further clean up the code.
Diffstat (limited to 'src/arch/arm/insts/static_inst.hh')
-rw-r--r--src/arch/arm/insts/static_inst.hh14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/arch/arm/insts/static_inst.hh b/src/arch/arm/insts/static_inst.hh
index 7ea3405af..ad89a1a79 100644
--- a/src/arch/arm/insts/static_inst.hh
+++ b/src/arch/arm/insts/static_inst.hh
@@ -43,6 +43,7 @@
#define __ARCH_ARM_INSTS_STATICINST_HH__
#include "arch/arm/faults.hh"
+#include "arch/arm/utility.hh"
#include "base/trace.hh"
#include "cpu/static_inst.hh"
@@ -219,8 +220,7 @@ class ArmStaticInst : public StaticInst
readPC(XC *xc)
{
Addr pc = xc->readPC();
- Addr tBit = pc & (ULL(1) << PcTBitShift);
- if (tBit)
+ if (isThumb(pc))
return pc + 4;
else
return pc + 8;
@@ -232,7 +232,7 @@ class ArmStaticInst : public StaticInst
setNextPC(XC *xc, Addr val)
{
Addr npc = xc->readNextPC();
- if (npc & (ULL(1) << PcTBitShift)) {
+ if (isThumb(npc)) {
val &= ~mask(1);
} else {
val &= ~mask(2);
@@ -280,8 +280,8 @@ class ArmStaticInst : public StaticInst
setIWNextPC(XC *xc, Addr val)
{
Addr stateBits = xc->readPC() & PcModeMask;
- Addr jBit = (ULL(1) << PcJBitShift);
- Addr tBit = (ULL(1) << PcTBitShift);
+ Addr jBit = PcJBit;
+ Addr tBit = PcTBit;
bool thumbEE = (stateBits == (tBit | jBit));
Addr newPc = (val & ~PcModeMask);
@@ -312,8 +312,8 @@ class ArmStaticInst : public StaticInst
setAIWNextPC(XC *xc, Addr val)
{
Addr stateBits = xc->readPC() & PcModeMask;
- Addr jBit = (ULL(1) << PcJBitShift);
- Addr tBit = (ULL(1) << PcTBitShift);
+ Addr jBit = PcJBit;
+ Addr tBit = PcTBit;
if (!jBit && !tBit) {
setIWNextPC(xc, val);
} else {