From 1b1b3264b2900e1d692bd32dce0e398b46953631 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Wed, 17 Aug 2022 15:13:06 +0300 Subject: [PATCH] pysvp64dis: consider instruction name --- src/openpower/sv/trans/pysvp64dis.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/openpower/sv/trans/pysvp64dis.py b/src/openpower/sv/trans/pysvp64dis.py index 5d11a796..5a7bc6f7 100644 --- a/src/openpower/sv/trans/pysvp64dis.py +++ b/src/openpower/sv/trans/pysvp64dis.py @@ -42,7 +42,9 @@ class Instruction(_SelectableInt): return f"{self.__class__.__name__}({self.value:08x})" def __str__(self): - return f".long 0x{self.value:08x}" + if not self.dbrecord: + return f".long 0x{self.value:08x}" + return f".long 0x{self.value:08x} # {self.dbrecord.name}" @property def major(self): @@ -67,7 +69,9 @@ class PrefixedInstruction(_SelectableInt): return f"{self.__class__.__name__}({self.value:016x})" def __str__(self): - return f".llong 0x{self.value:016x}" + if self.dbrecord is None: + return f".llong 0x{self.value:016x}" + return f".llong 0x{self.value:016x} # {self.dbrecord.name}" @cached_property def prefix(self): @@ -105,7 +109,9 @@ class SVP64Instruction(PrefixedInstruction): return super().__init__(prefix, suffix, byteorder) def __str__(self): - return (super().__str__() + " # sv") + if self.dbrecord is None: + return f".llong 0x{self.value:016x}" + return f".llong 0x{self.value:016x} # sv.{self.dbrecord.name}" @cached_property def prefix(self): -- 2.30.2