From 782c77ab4ccb718709e2ceac24472ddc3da7e7e8 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sun, 10 Jul 2022 17:18:50 +0100 Subject: [PATCH] Indexed SVSHAPE add bypass mode when dim sizes are 1 --- src/openpower/decoder/isa/remapyield.py | 5 +++-- src/openpower/decoder/isa/svshape.py | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/openpower/decoder/isa/remapyield.py b/src/openpower/decoder/isa/remapyield.py index 93de9723..b5fa6465 100644 --- a/src/openpower/decoder/isa/remapyield.py +++ b/src/openpower/decoder/isa/remapyield.py @@ -17,6 +17,7 @@ def iterate_indices(SVSHAPE): if SVSHAPE.invxyz[1]: y_r.reverse() if SVSHAPE.invxyz[2]: z_r.reverse() # start an infinite (wrapping) loop + step = 0 # track src/dst step while True: for z in z_r: # loop over 1st order dimension z_end = z == z_r[-1] @@ -69,9 +70,9 @@ def iterate_indices(SVSHAPE): ((y_end and x_end and z_end)<<2)) if hasattr(SVSHAPE, "postprocess"): # for Indexed mode - result = SVSHAPE.postprocess(result) + result = SVSHAPE.postprocess(result, step) yield result + SVSHAPE.offset, loopends - + step += 1 def demo(): # set the dimension sizes here xdim = 3 diff --git a/src/openpower/decoder/isa/svshape.py b/src/openpower/decoder/isa/svshape.py index dbddd5db..5530b28d 100644 --- a/src/openpower/decoder/isa/svshape.py +++ b/src/openpower/decoder/isa/svshape.py @@ -148,11 +148,13 @@ class SVSHAPE(SelectableInt): def offset(self, value): self.fsi['offset'].eq(value) - def postprocess(self, idx): + def postprocess(self, idx, step): if self.mode != 0b00 or not self.is_indexed(): return idx if self.gpr is None: return idx + if self.xdimsz == 1 and self.ydimsz == 1: + idx = step # no Index remapping remap = self.gpr(self.svgpr+idx).value # TODO: elwidths log ("indexed_iterator", self.svgpr, idx, remap) return remap -- 2.30.2