From: Dmitry Selyutin Date: Sun, 30 Apr 2023 18:50:19 +0000 (+0300) Subject: power_insn: forbid zero for non-zero operands X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d5917112f90f242d59241a83da64ce35aef83e3f;p=openpower-isa.git power_insn: forbid zero for non-zero operands --- diff --git a/src/openpower/decoder/power_insn.py b/src/openpower/decoder/power_insn.py index 486d1d65..b9d92508 100644 --- a/src/openpower/decoder/power_insn.py +++ b/src/openpower/decoder/power_insn.py @@ -1148,6 +1148,8 @@ class NonZeroOperand(DynamicOperand): value = int(value, 0) if not isinstance(value, int): raise ValueError("non-integer operand") + if value == 0: + raise ValueError("non-zero operand") value -= 1 return super().assemble(value=value, insn=insn)