From 4bf432f370522572f94cbd04e0da772c5438cfc0 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Mon, 14 Nov 2022 00:07:01 +0300 Subject: [PATCH] pysvp64asm: allow insndb-based assembly --- src/openpower/sv/trans/svp64.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/openpower/sv/trans/svp64.py b/src/openpower/sv/trans/svp64.py index d93d988f..2a17ec3d 100644 --- a/src/openpower/sv/trans/svp64.py +++ b/src/openpower/sv/trans/svp64.py @@ -293,6 +293,25 @@ class SVP64Asm: else: v30b_op = v30b_op_orig + record = None + if os.environ.get("INSNDB"): + record = DB[v30b_op] + if record is not None: + insn = SVP64Instruction.assemble(db=DB, + opcode=v30b_op_orig, + arguments=fields, + specifiers=opmodes) + prefix = int(insn.prefix) + suffix = int(insn.suffix) + yield " ".join(( + f".long 0x{prefix:08X};", + f".long 0x{suffix:08X};", + "#", + opcode, + ",".join(fields), + )) + return + # look up the 32-bit op (original, with "." if it has it) if v30b_op_orig in isa.instr: isa_instr = isa.instr[v30b_op_orig] -- 2.30.2