From 28d806f7ddc1a24c649cfcc1ebff41f089e269d3 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Sun, 6 Nov 2022 12:29:55 +0300 Subject: [PATCH] power_insn: support GPR operands --- src/openpower/decoder/power_insn.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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" -- 2.30.2