From 5ee94f4a3dadda357c6d28b60c19b3638146f9a7 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Sun, 13 Feb 2011 17:41:10 -0800 Subject: X86: Only reset npc to reflect instruction length once. When redirecting fetch to handle branches, the npc of the current pc state needs to be left alone. This change makes the pc state record whether or not the npc already reflects a real value by making it keep track of the current instruction size, or if no size has been set. --- src/arch/x86/predecoder.hh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/arch/x86/predecoder.hh') diff --git a/src/arch/x86/predecoder.hh b/src/arch/x86/predecoder.hh index c06ec18bc..5c67e28e1 100644 --- a/src/arch/x86/predecoder.hh +++ b/src/arch/x86/predecoder.hh @@ -225,7 +225,11 @@ namespace X86ISA { assert(emiIsReady); emiIsReady = false; - nextPC.npc(nextPC.pc() + getInstSize()); + if (!nextPC.size()) { + Addr size = getInstSize(); + nextPC.size(size); + nextPC.npc(nextPC.pc() + size); + } return emi; } }; -- cgit v1.2.3