Bobby Bruce has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/56243 )

Change subject: arch-riscv: rvc instruction is mistaken as branch
......................................................................

arch-riscv: rvc instruction is mistaken as branch

Fetch in O3CPU mistakes the normal non-branching compressed
instructions, and regards it as a branch. This issue interrupts
the consecutive instruction stream, thus affecting performance
of cpu front-end.
This fix sets the compressed for PCState during decoding.

Jira Issue: https://gem5.atlassian.net/browse/GEM5-1137

Change-Id: I7607d563bba8a08869e104877fc3c11c94cbe904
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/54644
Reviewed-by: Jin Cui <cuijinb...@gmail.com>
Reviewed-by: Ayaz Akram <yazak...@ucdavis.edu>
Maintainer: Jason Lowe-Power <power...@gmail.com>
Tested-by: kokoro <noreply+kok...@google.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56243
Reviewed-by: Jason Lowe-Power <power...@gmail.com>
---
M src/arch/riscv/decoder.cc
1 file changed, 26 insertions(+), 0 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass




diff --git a/src/arch/riscv/decoder.cc b/src/arch/riscv/decoder.cc
index 4fbcc64..a02415f 100644
--- a/src/arch/riscv/decoder.cc
+++ b/src/arch/riscv/decoder.cc
@@ -105,8 +105,10 @@

     if (compressed(emi)) {
         next_pc.npc(next_pc.instAddr() + sizeof(machInst) / 2);
+        next_pc.compressed(true);
     } else {
         next_pc.npc(next_pc.instAddr() + sizeof(machInst));
+        next_pc.compressed(false);
     }

     return decode(emi, next_pc.instAddr());

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/56243
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: minor-release-v21-2-1
Gerrit-Change-Id: I7607d563bba8a08869e104877fc3c11c94cbe904
Gerrit-Change-Number: 56243
Gerrit-PatchSet: 2
Gerrit-Owner: Bobby Bruce <bbr...@ucdavis.edu>
Gerrit-Reviewer: Ayaz Akram <yazak...@ucdavis.edu>
Gerrit-Reviewer: Bobby Bruce <bbr...@ucdavis.edu>
Gerrit-Reviewer: Jason Lowe-Power <power...@gmail.com>
Gerrit-Reviewer: Jin Cui <cuijinb...@gmail.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to