From 77b4a370670bed84d1c000a58d3e668334fdc86b Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Sun, 13 Feb 2011 17:45:47 -0800 Subject: [PATCH] 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. --- src/arch/x86/types.hh | 6 ++++++ 1 file changed, 6 insertions(+) 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() { -- 2.30.2