From: Santi Galan Date: Tue, 18 Apr 2017 16:08:46 +0000 (-0500) Subject: x86: fixed branching() computation for branch uops X-Git-Tag: v19.0.0.0~2844 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3cc6df46a3cd0aa97cd960f7f284d21c36a05181;p=gem5.git x86: fixed branching() computation for branch uops When a branch micro-op belongs to a flow and the micro-op does not change the nPC and just updates the nuPC (like a 'rep movs' flow), branching() function always returns not-taken no matter actual micro-branch outcome. Provided fix adds to the equation nuPC attribute checking since these kind of branch micro-op only updates that pointer. This issue has been found while debugging the performance of a copy-loop implemented with memcopy function. Without the fix, 'rep movss' internal micro-branch was always predicted as not-taken causing an squash event after every branch micro-branch execution. Using the provided test, branch mispredition went from 1922 without the fix to 7. Change-Id: I1bcbefae26aef47e3135817ef99b53d0ea0a98fa --- diff --git a/src/arch/x86/types.hh b/src/arch/x86/types.hh index 954f9f16e..8d47b7efb 100644 --- a/src/arch/x86/types.hh +++ b/src/arch/x86/types.hh @@ -318,7 +318,8 @@ namespace X86ISA bool branching() const { - return this->npc() != this->pc() + size(); + return (this->npc() != this->pc() + size()) || + (this->nupc() != this->upc() + 1); } void