bug 1155: redo SVShape is_triangle
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 28 Feb 2024 20:55:09 +0000 (20:55 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 28 Feb 2024 20:55:09 +0000 (20:55 +0000)
src/openpower/decoder/isa/svshape.py

index 9525b1539f79012e9c1f770a764539fb5ddcfe7c..ce833a148ac22be89d7858f3ccb155d8023a1e24 100644 (file)
@@ -51,10 +51,7 @@ class SVSHAPE(SelectableInt):
 
     def is_triangle(self):
         "REMAP Triangle Mode"
-        return False  # FIXME(lkcl): causes a RecursionError through `skip`
-                      # please don't push a revert without also fixing it:
-                      # https://bugs.libre-soc.org/show_bug.cgi?id=1155#c55
-        return self.mode == 0b11 and self.skip in [0b00, 0b01]
+        return self.mode == 0b11 and self._skip in [0b00, 0b01]
 
     @property
     def submode2(self):
@@ -145,17 +142,20 @@ class SVSHAPE(SelectableInt):
     def submode(self):
         return self.fsi['skip'].asint(msb0=True)
 
+    @property
+    def _skip(self):
+        return self.fsi['skip'].asint(msb0=True)
+
     @property
     def skip(self):
         if self.is_indexed() or self.is_triangle():
             inv = self.fsi['invxyz'].asint(msb0=True)
             return (inv & 0b100) >> 2
-        return self.fsi['skip'].asint(msb0=True)
+        return self._skip
 
     @skip.setter
     def skip(self, value):
-        assert not (self.is_indexed() or self.is_triangle()) # TODO
-        self.fsi['skip'].eq(value)
+        return self.fsi['skip'].eq(value)
 
     @property
     def offset(self):