power_insn: decouple branch modes
authorDmitry Selyutin <ghostmansd@gmail.com>
Sun, 18 Sep 2022 08:52:13 +0000 (11:52 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Sun, 18 Sep 2022 08:57:46 +0000 (11:57 +0300)
src/openpower/decoder/power_insn.py

index 02028a36091c566b876f0323fd3c87bae1a6f93b..4e900b15076ce55252a0b8366df5286ced2614ea 100644 (file)
@@ -1705,23 +1705,32 @@ class BranchBaseRM(BaseRM):
     sz: BaseRM[23]
 
 
-class BranchRM(BranchBaseRM):
-    class simple(BranchBaseRM):
-        """branch: simple mode"""
-        pass
+class BranchSimpleRM(BranchBaseRM):
+    """branch: simple mode"""
+    pass
 
-    class vls(BranchBaseRM):
-        """branch: VLSET mode"""
-        VSb: BaseRM[7]
-        VLI: BaseRM[21]
 
-    class ctr(BranchBaseRM):
-        """branch: CTR-test mode"""
-        CTi: BaseRM[6]
+class BranchVLSRM(BranchBaseRM):
+    """branch: VLSET mode"""
+    VSb: BaseRM[7]
+    VLI: BaseRM[21]
 
-    class ctrvls(vls, ctr):
-        """branch: CTR-test+VLSET mode"""
-        pass
+
+class BranchCTRRM(BranchBaseRM):
+    """branch: CTR-test mode"""
+    CTi: BaseRM[6]
+
+
+class BranchCTRVLSRM(BranchVLSRM, BranchCTRRM):
+    """branch: CTR-test+VLSET mode"""
+    pass
+
+
+class BranchRM(BranchBaseRM):
+    simple: BranchSimpleRM
+    vls: BranchVLSRM
+    ctr: BranchCTRRM
+    ctrvls: BranchCTRVLSRM
 
 
 class RM(BaseRM):