From f834a819efaada6553f8ae7c470c7299878592b8 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sat, 9 Jul 2022 21:45:12 +0100 Subject: [PATCH] add gpr lookup in Indexed SVSHAPE iterator (no elwidths yet) --- src/openpower/decoder/isa/svshape.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/openpower/decoder/isa/svshape.py b/src/openpower/decoder/isa/svshape.py index e22395c2..e5d9ed26 100644 --- a/src/openpower/decoder/isa/svshape.py +++ b/src/openpower/decoder/isa/svshape.py @@ -22,8 +22,9 @@ from openpower.util import log class SVSHAPE(SelectableInt): - def __init__(self, value): + def __init__(self, value, gpr=None): SelectableInt.__init__(self, value, 32) + self·gpr = gpr # for Indexed mode offs = 0 # set up sub-fields from Record layout self.fsi = {} @@ -144,9 +145,17 @@ class SVSHAPE(SelectableInt): def offset(self, value): self.fsi['offset'].eq(value) + def _indexed_iterator(self, *args): + idx, stop = yield from iterate_indices(*args) + if self.gpr is None: + return idx, stop + return self.gpr(self.svgpr+idx), stop # TODO: ekwidths + def get_iterator(self): log ("SVSHAPE get_iterator", self.mode, self.ydimsz) - if self.mode == 0b00: + if self.mode == 0b00 and self.is_indexed(): + iterate_fn = self._indexed_iterator + elif self.mode == 0b00: iterate_fn = iterate_indices elif self.mode in [0b01, 0b11]: # further sub-selection -- 2.30.2