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 <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
This commit is contained in:
Gabe Black
2021-08-14 02:52:33 -07:00
parent 1e9db5b9cf
commit 695c8b7f49

View File

@@ -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();
}
}
}