From: Dmitry Selyutin Date: Sun, 14 Jan 2024 20:25:11 +0000 (+0300) Subject: oppc/code: support TRAP X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b2da69f13041de45d5a31c891b2b3bfc62598659;p=openpower-isa.git oppc/code: support TRAP --- diff --git a/src/openpower/oppc/pc_code.py b/src/openpower/oppc/pc_code.py index 293a7d64..97810acf 100644 --- a/src/openpower/oppc/pc_code.py +++ b/src/openpower/oppc/pc_code.py @@ -630,9 +630,13 @@ class CodeVisitor(pc_util.Visitor): def Symbol(self, node): yield node with self.pseudocode(node=node): - if str(node) not in ("fallthrough",): - self.__decls.add(str(node)) - self[node].emit(stmt=f"&{str(node)}") + decl = str(node) + if decl not in ("fallthrough",): + if decl in ("TRAP",): + self[node].emit(stmt=f"{decl}();") + else: + self.__decls.add(decl) + self[node].emit(stmt=f"&{decl}") @pc_util.Hook(Instruction) def Instruction(self, node):