From 695c8b7f49aca067e87898257d4742e01b9c9631 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Sat, 14 Aug 2021 02:52:33 -0700 Subject: [PATCH] cpu-minor: Use the InvalidRegClass to track invalid RegIds. Use that instead of the zero register. This avoids two assumptions, first that there is a zero register in the first place, and second that the zero register is an integer. It also avoids referring to the IntRegClass in non-ISA specific code. It's very likely that all ISAs will have integer registers, but we should not build in assumptions about what types of registers an ISA has in general. For instance, not all ISAs have vector predicate registers, or a scalar floating point register file. Change-Id: I730fec90f42b90b5be7e1baddf896e18c53e8510 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49711 Maintainer: Gabe Black Tested-by: kokoro Reviewed-by: Giacomo Travaglini --- src/cpu/minor/scoreboard.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cpu/minor/scoreboard.cc b/src/cpu/minor/scoreboard.cc index 4637b8d88e..0e6ea7533a 100644 --- a/src/cpu/minor/scoreboard.cc +++ b/src/cpu/minor/scoreboard.cc @@ -84,6 +84,9 @@ Scoreboard::findIndex(const RegId& reg, Index &scoreboard_index) /* Don't bother with Misc registers */ ret = false; break; + case InvalidRegClass: + ret = false; + break; default: panic("Unknown register class: %d", reg.classValue()); } @@ -135,8 +138,8 @@ Scoreboard::markupInstDests(MinorDynInstPtr inst, Cycles retire_time, " regIndex: %d final numResults: %d returnCycle: %d\n", *inst, index, numResults[index], returnCycle[index]); } else { - /* Use zeroReg to mark invalid/untracked dests */ - inst->flatDestRegIdx[dest_index] = RegId(IntRegClass, zeroReg); + /* Use an invalid ID to mark invalid/untracked dests */ + inst->flatDestRegIdx[dest_index] = RegId(); } } }