From 0fb1a8383152c4eb080cb84bc6c161c7e599da8d Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Thu, 1 Jun 2023 00:04:13 +0300 Subject: [PATCH] power_insn: forbid r0 for RA0 and RT0 --- src/openpower/decoder/power_insn.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/openpower/decoder/power_insn.py b/src/openpower/decoder/power_insn.py index f93037dd..d480a3f3 100644 --- a/src/openpower/decoder/power_insn.py +++ b/src/openpower/decoder/power_insn.py @@ -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) -- 2.30.2