summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2011-02-13 17:45:47 -0800
committerGabe Black <gblack@eecs.umich.edu>2011-02-13 17:45:47 -0800
commit77b4a370670bed84d1c000a58d3e668334fdc86b (patch)
treee9cfba7a9c86f34b472664a425478d17ec8ad4fb /src/arch
parent44306e8114236fb943cdf5462b3ae076b672e8eb (diff)
downloadgem5-77b4a370670bed84d1c000a58d3e668334fdc86b.tar.xz
X86: Detect branches taking into account instruction size.
The size of the current instruction determines what the npc should be if there's no branching.
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/x86/types.hh6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/arch/x86/types.hh b/src/arch/x86/types.hh
index d78af1b81..4641141d3 100644
--- a/src/arch/x86/types.hh
+++ b/src/arch/x86/types.hh
@@ -243,6 +243,12 @@ namespace X86ISA
uint8_t size() const { return _size; }
void size(uint8_t newSize) { _size = newSize; }
+ bool
+ branching() const
+ {
+ return this->npc() != this->pc() + size();
+ }
+
void
advance()
{