From 51cc2ee5dc06567329f05c8c9279730839fc1165 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Wed, 17 Aug 2022 14:55:26 +0300 Subject: [PATCH] pysvp64dis: consult the instruction database --- src/openpower/sv/trans/pysvp64dis.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/openpower/sv/trans/pysvp64dis.py b/src/openpower/sv/trans/pysvp64dis.py index dbbdce94..5d11a796 100644 --- a/src/openpower/sv/trans/pysvp64dis.py +++ b/src/openpower/sv/trans/pysvp64dis.py @@ -48,6 +48,13 @@ class Instruction(_SelectableInt): def major(self): return self[0:6] + @property + def dbrecord(self): + try: + return DATABASE[int(self)] + except KeyError: + return None + class PrefixedInstruction(_SelectableInt): def __init__(self, prefix, suffix, byteorder=ByteOrder.LITTLE): @@ -70,6 +77,10 @@ class PrefixedInstruction(_SelectableInt): def suffix(self): return Instruction(self[32:64]) + @cached_property + def dbrecord(self): + return self.suffix.dbrecord + class SVP64Instruction(PrefixedInstruction): class PrefixError(ValueError): -- 2.30.2