comments/variables-cleanup
[openpower-isa.git] / src / openpower / decoder / isa / svshape.py
index dbddd5dbe1bc731fd67170000699bf0404dd82a0..2bdf530b010ef2e87f44bf004ffdc68c9fde3c1c 100644 (file)
@@ -9,6 +9,8 @@ https://libre-soc.org/openpower/sv/remap
 from openpower.decoder.selectable_int import (FieldSelectableInt, SelectableInt,
                                         selectconcat)
 from openpower.decoder.isa.remapyield import iterate_indices
+from openpower.decoder.isa.remap_preduce_yield import (iterate_indices as
+                                                iterate_preduce_indices)
 from openpower.decoder.isa.remap_fft_yield import iterate_butterfly_indices
 from openpower.decoder.isa.remap_dct_yield import (
                                 iterate_dct_inner_butterfly_indices,
@@ -148,11 +150,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
@@ -161,6 +165,8 @@ class SVSHAPE(SelectableInt):
         log ("SVSHAPE get_iterator", self.mode, self.ydimsz, self.is_indexed())
         if self.mode == 0b00:
             iterate_fn = iterate_indices
+        elif self.mode == 0b10:
+            iterate_fn = iterate_preduce_indices
         elif self.mode in [0b01, 0b11]:
             # further sub-selection
             if self.ydimsz == 1: