From: Dmitry Selyutin Date: Sun, 6 Nov 2022 09:29:55 +0000 (+0300) Subject: power_insn: provide basics for insndb assembly X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7f1084be1ecb13e88c7435f2e1e1da334e3dc060;p=openpower-isa.git power_insn: provide basics for insndb assembly --- diff --git a/src/openpower/sv/trans/svp64.py b/src/openpower/sv/trans/svp64.py index c61e9283..12bef488 100644 --- a/src/openpower/sv/trans/svp64.py +++ b/src/openpower/sv/trans/svp64.py @@ -30,6 +30,7 @@ from openpower.decoder.selectable_int import SelectableInt from openpower.consts import SVP64MODE from openpower.decoder.power_insn import SVP64Instruction from openpower.decoder.power_insn import Database +from openpower.decoder.power_insn import WordInstruction from openpower.decoder.power_enums import find_wiki_dir # for debug logging @@ -821,7 +822,7 @@ def to_number(field): return int(field) -db = Database(find_wiki_dir()) +DB = Database(find_wiki_dir()) # decodes svp64 assembly listings and creates EXT001 svp64 prefixes @@ -859,7 +860,19 @@ class SVP64Asm: fields.append(macro_subst(macros, field)) log("opcode, fields substed", ls, opcode, fields) - # identify if it is a special instruction + # identify if it is a word instruction + record = DB[opcode] + if record is not None: + insn = WordInstruction.assemble(db=DB, + opcode=opcode, arguments=fields) + yield " ".join(( + f".long 0x{int(insn):08X}", + "#", + opcode, + ",".join(fields), + )) + return + custom_insn_hook = CUSTOM_INSNS.get(opcode) if custom_insn_hook is not None: fields = tuple(map(to_number, fields))