power_insn: forbid r0 for RA0 and RT0
authorDmitry Selyutin <ghostmansd@gmail.com>
Wed, 31 May 2023 21:04:13 +0000 (00:04 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Thu, 1 Jun 2023 18:38:44 +0000 (21:38 +0300)
src/openpower/decoder/power_insn.py

index f93037ddb72f48a37123ea86d9e37be1201dcc39..d480a3f3dac4073743c1b32cff8451d970a2057c 100644 (file)
@@ -1264,6 +1264,8 @@ class ExtendableOperand(DynamicOperand):
                 value = value[1:]
                 vector = True
             if value.startswith(prefix):
+                if (self.extra_reg.or_zero and (value == f"{prefix}0")):
+                    raise ValueError(value)
                 value = value[len(prefix):]
             value = int(value, 0)