Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/52603 )
Change subject: cpu-o3: Manually flatten the index for vector reg elements.
......................................................................
cpu-o3: Manually flatten the index for vector reg elements.
There is a function for this purpose in RegId called flatIndex(), which
I had attempted to use with PhysRegId which inherits from RegId.
Unfortunately, PhysRegId redefines the flatIndex() method and makes it
do something completely different, which is to turn map the index into a
linearization of all registers in the CPU.
Instead of using the decoy wrong method, and because the one we actually
want is not accessible, we can just manually compute the flattened index
in the two places we use it.
Change-Id: I8bd02f0be0f4fb3742da48b2955e9e75ec57245b
---
M src/cpu/o3/regfile.hh
1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/src/cpu/o3/regfile.hh b/src/cpu/o3/regfile.hh
index 31db6f0..cb3aee3 100644
--- a/src/cpu/o3/regfile.hh
+++ b/src/cpu/o3/regfile.hh
@@ -226,7 +226,9 @@
readVecElem(PhysRegIdPtr phys_reg) const
{
assert(phys_reg->is(VecElemClass));
- RegVal val = vectorElemRegFile[phys_reg->flatIndex()];
+ RegVal val = vectorElemRegFile[
+ phys_reg->index() * TheISA::NumVecElemPerVecReg +
+ phys_reg->elemIndex()];
DPRINTF(IEW, "RegFile: Access to element %d of vector register %i,"
" has data %#x\n", phys_reg->elemIndex(),
phys_reg->index(), val);
@@ -313,7 +315,8 @@
DPRINTF(IEW, "RegFile: Setting element %d of vector register %i to"
" %#x\n", phys_reg->elemIndex(), int(phys_reg->index()),
val);
- vectorElemRegFile[phys_reg->flatIndex()] = val;
+ vectorElemRegFile[phys_reg->index() * TheISA::NumVecElemPerVecReg +
+ phys_reg->elemIndex()] = val;
}
/** Sets a predicate register to the given value. */
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/52603
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I8bd02f0be0f4fb3742da48b2955e9e75ec57245b
Gerrit-Change-Number: 52603
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s