From: Dmitry Selyutin Date: Sat, 17 Sep 2022 13:52:34 +0000 (+0300) Subject: power_insn: support specifiers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e74a899d19193beb0ff34ca870b08b57dfc227a9;p=openpower-isa.git power_insn: support specifiers --- diff --git a/src/openpower/decoder/power_insn.py b/src/openpower/decoder/power_insn.py index bfaf2fa7..fcb673e7 100644 --- a/src/openpower/decoder/power_insn.py +++ b/src/openpower/decoder/power_insn.py @@ -1278,6 +1278,10 @@ class BaseRM(_Mapping): extra2: Extra2.remap(range(10, 19)) extra3: Extra3.remap(range(10, 19)) + @property + def specifiers(self): + yield from () + def disassemble(self, verbosity=Verbosity.NORMAL): if verbosity >= Verbosity.VERBOSE: indent = (" " * 4) @@ -1712,20 +1716,30 @@ class SVP64Instruction(PrefixedInstruction): yield f"{blob_suffix}.long 0x{int(self.suffix):08x}" return + name = f"sv.{record.name}" + + Rc = False + if record.mdwn.operands["Rc"] is not None: + Rc = bool(self.suffix[record.fields["Rc"]]) + rm = self.prefix.rm.select(record=record, Rc=Rc) + + specifiers = tuple(rm.specifiers) + if specifiers: + specifiers = f"/{'/'.join(specifiers)}" + else: + specifiers = "" + operands = tuple(map(_operator.itemgetter(1), self.dynamic_operands(db=db, verbosity=verbosity))) if operands: - yield f"{blob_prefix}sv.{record.name} {','.join(operands)}" + operands = f" {','.join(operands)}" else: - yield f"{blob_prefix}{record.name}" + operands = "" + + yield f"{blob_prefix}{name}{specifiers}{operands}" if blob_suffix: yield f"{blob_suffix}" - Rc = False - if record.mdwn.operands["Rc"] is not None: - Rc = bool(self.suffix[record.fields["Rc"]]) - - rm = self.prefix.rm.select(record=record, Rc=Rc) if verbosity >= Verbosity.VERBOSE: indent = (" " * 4) binary = self.binary