move D-Immediate rewriting in ISACaller into separate function
[openpower-isa.git] / src / openpower / decoder / isa / svshape.py
index 7e9ad3227a1431aeaff5b827fceb5bd985b5246b..5530b28de0ed0a5c8f139bc35156a04173b10d31 100644 (file)
@@ -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
@@ -179,8 +181,8 @@ class SVSHAPE(SelectableInt):
 
 if __name__ == '__main__':
     os.environ['SILENCELOG'] = "1"
-    xdim = 2
-    ydim = 3
+    xdim = 3
+    ydim = 2000
     zdim = 1
     SVSHAPE0 = SVSHAPE(0)
     SVSHAPE0.lims = [xdim, ydim, zdim]
@@ -188,9 +190,9 @@ if __name__ == '__main__':
     SVSHAPE0.mode = 0b00
     SVSHAPE0.skip = 0b00
     SVSHAPE0.offset = 0       # experiment with different offset, here
-    SVSHAPE0.invxyz = [0,0,1] # inversion if desired
+    SVSHAPE0.invxyz = [0,0,1] # xy inversion (indices 0,1) , skip if desired (2)
 
-    VL = xdim * ydim * zdim
+    VL = 6 # xdim * ydim * zdim
 
     print ("Matrix Indexed Mode", SVSHAPE0.order, SVSHAPE0.invxyz)
     for idx, new_idx in enumerate(SVSHAPE0.get_iterator()):
@@ -200,7 +202,6 @@ if __name__ == '__main__':
 
     print ("")
 
-
     xdim = 3
     ydim = 2
     zdim = 1