From 0be3bbe531b8bf2ddbba895c44004fb187821ade Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Sun, 14 Jan 2024 17:40:46 +0300 Subject: [PATCH] oppc/code: support more special symbols --- src/openpower/oppc/pc_code.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/openpower/oppc/pc_code.py b/src/openpower/oppc/pc_code.py index 28dfb34a..bbacaff1 100644 --- a/src/openpower/oppc/pc_code.py +++ b/src/openpower/oppc/pc_code.py @@ -307,14 +307,12 @@ class CodeVisitor(pc_util.Visitor): for (level, stmt) in self[transient]: self[node].emit(stmt=stmt, level=level) - @pc_util.Hook(pc_ast.Overflow) - def Overflow(self, node): + @pc_util.Hook(pc_ast.Overflow, pc_ast.CR3, pc_ast.CR5, + pc_ast.XER, pc_ast.Reserve, pc_ast.Special) + def Special(self, node): yield node - (value, bits) = ("OPPC_OVERFLOW", "(uint8_t)OPPC_OVERFLOW") - transient = self.transient(node=node, value=value, bits=bits) with self.pseudocode(node=node): - for (level, stmt) in self[transient]: - self[node].emit(stmt=stmt, level=level) + self[node].emit(stmt=f"&OPPC_{str(node).upper()}") @pc_util.Hook(pc_ast.SubscriptExpr) def SubscriptExpr(self, node): -- 2.30.2