power_insn: support FPR operands assembly
authorDmitry Selyutin <ghostmansd@gmail.com>
Sun, 6 Nov 2022 09:29:55 +0000 (12:29 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Sun, 15 Jan 2023 19:47:22 +0000 (22:47 +0300)
src/openpower/decoder/power_insn.py

index 933741b8ea20b30f7f9d26a20e473109cd511ed9..279db99cb6539cafb521a2b8f4a8838f71b5ae68 100644 (file)
@@ -759,6 +759,14 @@ class GPROperand(RegisterOperand):
 
 
 class FPROperand(RegisterOperand):
+    def assemble(self, value, insn, record):
+        if isinstance(value, str):
+            value = value.lower()
+            if value.startswith("f"):
+                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 "f"