From: Dmitry Selyutin Date: Fri, 12 Jan 2024 19:24:22 +0000 (+0300) Subject: oppc/code: support repeat expr X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=227988d7c636f3dc008af6e0648eef5ec63d96b9;p=openpower-isa.git oppc/code: support repeat expr --- diff --git a/src/openpower/oppc/pc_code.py b/src/openpower/oppc/pc_code.py index a4bbe665..0c64d40e 100644 --- a/src/openpower/oppc/pc_code.py +++ b/src/openpower/oppc/pc_code.py @@ -141,6 +141,13 @@ class CodeVisitor(pc_util.Visitor): yield node self[node].emit(stmt=f"ctx->fpr[OPPC_FPR_{str(node)}]") + @pc_util.Hook(pc_ast.RepeatExpr) + def RepeatExpr(self, node): + yield node + subject = str(self[node.subject]) + times = str(self[node.times]) + self[node].emit(f"oppc_repeat({subject}, {times})") + @pc_util.Hook(pc_ast.Call.Name) def CallName(self, node): yield node