summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSanti Galan <santi.galan@metempsy.com>2017-04-18 11:08:46 -0500
committerJason Lowe-Power <jason@lowepower.com>2017-04-18 11:12:35 -0500
commit3cc6df46a3cd0aa97cd960f7f284d21c36a05181 (patch)
tree268f087ae4a55dad26c711bede3b9e1d9c381093 /src
parentefe3bfcd0c6e1161bea621a6e512378fe228fed4 (diff)
downloadgem5-3cc6df46a3cd0aa97cd960f7f284d21c36a05181.tar.xz
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
Diffstat (limited to 'src')
-rw-r--r--src/arch/x86/types.hh3
1 files changed, 2 insertions, 1 deletions
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