From: Dmitry Selyutin Date: Sun, 6 Nov 2022 09:29:55 +0000 (+0300) Subject: power_insn: support GPR operands X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=28d806f7ddc1a24c649cfcc1ebff41f089e269d3;p=openpower-isa.git power_insn: support GPR operands --- diff --git a/src/openpower/decoder/power_insn.py b/src/openpower/decoder/power_insn.py index 9d77cbdb..933741b8 100644 --- a/src/openpower/decoder/power_insn.py +++ b/src/openpower/decoder/power_insn.py @@ -742,6 +742,14 @@ class RegisterOperand(DynamicOperand): class GPROperand(RegisterOperand): + def assemble(self, value, insn, record): + if isinstance(value, str): + value = value.lower() + if value.startswith("r"): + value = value[1:] + value = int(value, 0) + return super().assemble(value=value, insn=insn, record=record) + def disassemble(self, insn, record, verbosity=Verbosity.NORMAL, indent=""): prefix = "" if (verbosity <= Verbosity.SHORT) else "r"