pysvp64dis: introduce Prefix and RM classes
authorDmitry Selyutin <ghostmansd@gmail.com>
Tue, 16 Aug 2022 21:40:39 +0000 (00:40 +0300)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 29 Aug 2022 19:38:10 +0000 (20:38 +0100)
src/openpower/sv/trans/pysvp64dis.py

index 4bd056f998c9bcf7b70135033e27562629798c1c..4923e59f1e341869a805288fd4a2bed241e59e80 100644 (file)
@@ -59,13 +59,19 @@ class PrefixedInstruction(_SelectableInt):
 
 
 class SVP64Instruction(PrefixedInstruction):
-    @cached_property
-    def prefix(self):
-        return _SVP64PrefixFields(super().prefix)
+    class Prefix(_SVP64PrefixFields):
+        class RM(_SVP64RMFields):
+            @cached_property
+            def sv_mode(self):
+                return (self.mode & 0b11)
+
+        @property
+        def rm(self):
+            return self.__class__.RM(super().rm)
 
     @cached_property
-    def rm(self):
-        return _SVP64RMFields(self.prefix.rm)
+    def prefix(self):
+        return self.__class__.Prefix(super().prefix)
 
 
 def load(ifile, byteorder, **_):