From 959ae2b91caad21d354d9fa95b4a427bb9a5f405 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Tue, 13 Dec 2022 00:55:32 +0300 Subject: [PATCH] power_insn: consider EXTS operand as signed --- src/openpower/decoder/power_insn.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/openpower/decoder/power_insn.py b/src/openpower/decoder/power_insn.py index d1a6c5eb..d498e21b 100644 --- a/src/openpower/decoder/power_insn.py +++ b/src/openpower/decoder/power_insn.py @@ -925,6 +925,12 @@ class SignedOperand(DynamicOperand): value = int(value, 0) return super().assemble(value=value, insn=insn) + def assemble(self, value, insn): + span = self.span + if isinstance(value, str): + value = int(value, 0) + insn[span] = value + def disassemble(self, insn, verbosity=Verbosity.NORMAL, indent=""): span = self.span @@ -1404,7 +1410,7 @@ class CR5Operand(ConditionRegisterFieldOperand): @_dataclasses.dataclass(eq=True, frozen=True) -class EXTSOperand(DynamicOperand): +class EXTSOperand(SignedOperand): field: str # real name to report nz: int = 0 # number of zeros fmt: str = "d" # integer formatter -- 2.30.2