insndb/db: introduce etype command
authorDmitry Selyutin <ghostmansd@gmail.com>
Thu, 22 Jun 2023 19:09:07 +0000 (22:09 +0300)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 22 Dec 2023 19:26:19 +0000 (19:26 +0000)
src/openpower/insndb/db.py

index e64fdc1ee7a9bba4d7ff9198a1520762ac75d396..b0411d25b0136fa7c6c382429ff45441d407ec95 100644 (file)
@@ -18,6 +18,7 @@ from openpower.insndb.core import (
     Walker,
 )
 from openpower.decoder.power_enums import (
+    SVEType,
     SVPType,
     SVExtra,
     In1Sel,
@@ -122,6 +123,14 @@ class SelectorsVisitor(InstructionVisitor):
         yield node
 
 
+class ETypeVisitor(SVP64InstructionVisitor):
+    @mdis.dispatcher.Hook(SVEType)
+    @contextlib.contextmanager
+    def dispatch_ptype(self, node):
+        print(node)
+        yield node
+
+
 class PTypeVisitor(SVP64InstructionVisitor):
     @mdis.dispatcher.Hook(SVPType)
     @contextlib.contextmanager
@@ -178,6 +187,10 @@ def main():
             SelectorsVisitor,
             "print instruction selectors",
         ),
+        "etype": (
+            ETypeVisitor,
+            "print instruction etype",
+        ),
         "ptype": (
             PTypeVisitor,
             "print instruction ptype",