insndb/db: introduce selectors command
authorDmitry Selyutin <ghostmansd@gmail.com>
Thu, 22 Jun 2023 18:43:03 +0000 (21:43 +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 4c725fee66cf79b313b161c859c5bae892d1f7fb..4d3b91da82ebbb25065e4f455f6fd2c2460a27ca 100644 (file)
@@ -106,7 +106,7 @@ class PCodeVisitor(InstructionVisitor):
         yield node
 
 
-class ExtrasVisitor(SVP64InstructionVisitor):
+class SelectorsVisitor(InstructionVisitor):
     @mdis.dispatcher.Hook(
             In1Sel, In2Sel, In3Sel, CRInSel, CRIn2Sel,
             OutSel, CROutSel,
@@ -120,6 +120,8 @@ class ExtrasVisitor(SVP64InstructionVisitor):
         print(typename, node)
         yield node
 
+
+class ExtrasVisitor(SVP64InstructionVisitor, SelectorsVisitor):
     @mdis.dispatcher.Hook(SVP64Record.ExtraMap)
     @contextlib.contextmanager
     def dispatch_extramap(self, node):
@@ -163,6 +165,10 @@ def main():
             PCodeVisitor,
             "print instruction pseudocode",
         ),
+        "selectors": (
+            SelectorsVisitor,
+            "print instruction selectors",
+        ),
         "extras": (
             ExtrasVisitor,
             "print instruction extras (SVP64)",