From: Dmitry Selyutin Date: Tue, 16 Jan 2024 19:09:45 +0000 (+0300) Subject: oppc/code: generalize casts X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=69cc27d2ab6caf4072565466940782170e3ee2e8;p=openpower-isa.git oppc/code: generalize casts --- diff --git a/src/openpower/oppc/pc_code.py b/src/openpower/oppc/pc_code.py index 13b6fc65..50a64446 100644 --- a/src/openpower/oppc/pc_code.py +++ b/src/openpower/oppc/pc_code.py @@ -116,7 +116,7 @@ class CodeVisitor(pc_util.Visitor): def fixup_ternary(self, node): self[node].clear() - test = self.call(name="oppc_bool", code=[ + test = self.call(name="oppc_cast_bool", code=[ self[node.test], ]) self[node].emit(stmt="(") @@ -528,7 +528,7 @@ class CodeVisitor(pc_util.Visitor): @pc_util.Hook(pc_ast.IfExpr) def IfExpr(self, node): yield node - test = self.call(name="oppc_bool", code=[ + test = self.call(name="oppc_cast_bool", code=[ self[node.test], ]) self[node].emit(stmt="if (") @@ -547,7 +547,7 @@ class CodeVisitor(pc_util.Visitor): @pc_util.Hook(pc_ast.SwitchExpr) def SwitchExpr(self, node): yield node - subject = self.call(name="oppc_int64", code=[ + subject = self.call(name="oppc_cast_int64", code=[ self[node.subject], ]) self[node].emit(stmt="switch (")