cpu: Replace fixed sized arrays in the O3 inst with variable arrays.
The only way to allocate fixed sized arrays which will definitely be big enough for all source/destination registers for a given instruction is to track the maximum number of each at compile time, and then size the arrays appropriately. That creates a point of centralization which prevents breaking up decoder and instruction definitions into more modular pieces, and if multiple ISAs are ever built at once, would require coordination between all ISAs, and wasting memory for most of them. The dynamic allocation overhead is minimized by allocating the storage for all variable arrays in one chunk, and then placing the arrays there using placement new. There is still some overhead, although less than it might be otherwise. Change-Id: Id2c42869cba944deb97da01ca9e0e70186e22532 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38384 Reviewed-by: Jason Lowe-Power <power.jg@gmail.com> Maintainer: Jason Lowe-Power <power.jg@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -1342,8 +1342,8 @@ DefaultCommit<Impl>::commitHead(const DynInstPtr &head_inst, unsigned inst_num)
|
||||
|
||||
// Update the commit rename map
|
||||
for (int i = 0; i < head_inst->numDestRegs(); i++) {
|
||||
renameMap[tid]->setEntry(head_inst->flattenedDestRegIdx(i),
|
||||
head_inst->renamedDestRegIdx(i));
|
||||
renameMap[tid]->setEntry(head_inst->regs.flattenedDestIdx(i),
|
||||
head_inst->regs.renamedDestIdx(i));
|
||||
}
|
||||
|
||||
// hardware transactional memory
|
||||
|
||||
Reference in New Issue
Block a user