power_insn: simplify subvl disassembly
authorDmitry Selyutin <ghostmansd@gmail.com>
Sun, 18 Sep 2022 08:06:04 +0000 (11:06 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Sun, 18 Sep 2022 08:06:04 +0000 (11:06 +0300)
src/openpower/decoder/power_insn.py

index a86e281f8a3a434f91b1506c8baa05fdf68523f2..2007aadeee631390eb44cdaaccf3060fedf634e3 100644 (file)
@@ -1283,12 +1283,13 @@ class BaseRM(_Mapping):
 
     @property
     def specifiers(self):
-        if self.subvl == 1:
-            yield "vec2"
-        elif self.subvl == 2:
-            yield "vec3"
-        elif self.subvl == 3:
-            yield "vec4"
+        subvl = int(self.subvl)
+        if subvl > 0:
+            yield {
+                1: "vec2",
+                2: "vec3",
+                3: "vec4",
+            }[subvl]
 
     def disassemble(self, verbosity=Verbosity.NORMAL):
         if verbosity >= Verbosity.VERBOSE: