From 3059c6df5c3d6e951a4e85f2b83e2cfaa6a46bbb Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Mon, 7 Dec 2020 04:16:09 -0800 Subject: [PATCH] arch: Add a mechanism to pad the src or dest reg index arrays. ARM reaches in and pads out the source register index list behind the parser's back to force dest regs to also be sources in case an instruction fails predication and needs to forward the original register values. It shouldn't be hacking up these values in that way, but since it is, this will let it continue to do so while still fitting in the new system where each instruction allocates its src/dest reg index arrays to size. Change-Id: Ia296be9f63123f18f6cdc0d3bb1314d33e759b3a Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38380 Reviewed-by: Giacomo Travaglini Maintainer: Giacomo Travaglini Tested-by: kokoro --- src/arch/isa_parser/isa_parser.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/arch/isa_parser/isa_parser.py b/src/arch/isa_parser/isa_parser.py index ff54889fe..9ca813e50 100755 --- a/src/arch/isa_parser/isa_parser.py +++ b/src/arch/isa_parser/isa_parser.py @@ -107,7 +107,8 @@ class Template(object): myDict['reg_idx_arr_decl'] = \ 'RegId srcRegIdxArr[%d]; RegId destRegIdxArr[%d]' % \ - (d.operands.numSrcRegs, d.operands.numDestRegs) + (d.operands.numSrcRegs + d.srcRegIdxPadding, + d.operands.numDestRegs + d.destRegIdxPadding) # The reinterpret casts are largely because an array with a known # size cannot be passed as an argument which is an array with an @@ -391,6 +392,9 @@ class InstObjParams(object): self.operands = OperandList(parser, compositeCode) + self.srcRegIdxPadding = 0 + self.destRegIdxPadding = 0 + # The header of the constructor declares the variables to be used # in the body of the constructor. header = '' @@ -464,6 +468,12 @@ class InstObjParams(object): else: self.fp_enable_check = '' + def padSrcRegIdx(self, padding): + self.srcRegIdxPadding = padding + + def padDestRegIdx(self, padding): + self.destRegIdxPadding = padding + ####################### # -- 2.30.2