From: Dmitry Selyutin Date: Mon, 12 Dec 2022 21:55:32 +0000 (+0300) Subject: power_insn: consider EXTS operand as signed X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=959ae2b91caad21d354d9fa95b4a427bb9a5f405;p=openpower-isa.git power_insn: consider EXTS operand as signed --- 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