Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/50248 )
Change subject: cpu-o3: Remove TheISA:: types from forwardOldRegs.
......................................................................
cpu-o3: Remove TheISA:: types from forwardOldRegs.
Use information from the registers' RegClass-es and the generic getReg
and setReg API to forward the registers value without having to refer to
the register class constant/index, or the type of complex registers.
Change-Id: I0426a606185edc0aabbf4b77c825b618b4640590
---
M src/cpu/o3/dyn_inst.hh
1 file changed, 6 insertions(+), 29 deletions(-)
diff --git a/src/cpu/o3/dyn_inst.hh b/src/cpu/o3/dyn_inst.hh
index 23b5910..bd5aed3 100644
--- a/src/cpu/o3/dyn_inst.hh
+++ b/src/cpu/o3/dyn_inst.hh
@@ -1132,37 +1132,14 @@
for (int idx = 0; idx < numDestRegs(); idx++) {
PhysRegIdPtr prev_phys_reg = regs.prevDestIdx(idx);
const RegId& original_dest_reg = staticInst->destRegIdx(idx);
- switch (original_dest_reg.classValue()) {
- case IntRegClass:
- case FloatRegClass:
- case CCRegClass:
+ const auto bytes = original_dest_reg.regClass().regBytes();
+ if (bytes == sizeof(RegVal)) {
setRegOperand(staticInst.get(), idx,
cpu->getReg(prev_phys_reg));
- break;
- case VecRegClass:
- {
- TheISA::VecRegContainer val;
- cpu->getReg(prev_phys_reg, &val);
- setRegOperand(staticInst.get(), idx, &val);
- }
- break;
- case VecElemClass:
- setRegOperand(staticInst.get(), idx,
- cpu->getReg(prev_phys_reg));
- break;
- case VecPredRegClass:
- {
- TheISA::VecPredRegContainer val;
- cpu->getReg(prev_phys_reg, &val);
- setRegOperand(staticInst.get(), idx, &val);
- }
- break;
- case MiscRegClass:
- // no need to forward misc reg values
- break;
- default:
- panic("Unknown register class: %d",
- (int)original_dest_reg.classValue());
+ } else {
+ uint8_t val[original_dest_reg.regClass().regBytes()];
+ cpu->getReg(prev_phys_reg, val);
+ setRegOperand(staticInst.get(), idx, val);
}
}
}
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/50248
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: I0426a606185edc0aabbf4b77c825b618b4640590
Gerrit-Change-Number: 50248
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <gabe.bl...@gmail.com>
Gerrit-MessageType: newchange
_______________________________________________
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