From 2e03fd611b4d0ddae3147cc9d8b49a4a4b66e688 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Sat, 3 Sep 2022 17:51:48 +0300 Subject: [PATCH] power_insn: support Rc detection --- src/openpower/decoder/power_insn.py | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/openpower/decoder/power_insn.py b/src/openpower/decoder/power_insn.py index 63240646..a39b6d56 100644 --- a/src/openpower/decoder/power_insn.py +++ b/src/openpower/decoder/power_insn.py @@ -682,17 +682,19 @@ class WordInstruction(Instruction): record = db[self] if record is None: yield f"{blob} .long 0x{integer:08x}" + return + + operands = [] + for operand in record.operands.dynamic: + operand = operand.disassemble(self, record) + operands.append(operand) + if operands: + operands = ",".join(operands) + operands = f" {operands}" else: - operands = [] - for operand in record.operands.dynamic: - operand = operand.disassemble(self, record) - operands.append(operand) - if operands: - operands = ",".join(operands) - operands = f" {operands}" - else: - operands = "" - yield f"{blob} {record.name}{operands}" + operands = "" + + yield f"{blob} {record.name}{operands}" class PrefixedInstruction(Instruction): class Prefix(WordInstruction.remap(range(0, 32))): @@ -949,9 +951,10 @@ class SVP64Instruction(PrefixedInstruction): if record is None or record.svp64 is None: yield f"{blob_prefix} .long 0x{int(self.prefix):08x}" yield f"{blob_suffix} .long 0x{int(self.suffix):08x}" - else: - yield f"{blob_prefix} sv.{record.name}" - yield f"{blob_suffix}" + return + + yield f"{blob_prefix} sv.{record.name}" + yield f"{blob_suffix}" def parse(stream, factory): -- 2.30.2