From 017bd4f2baaa28e4244bdbfc310813d4a2622189 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Fri, 12 Jan 2024 22:24:22 +0300 Subject: [PATCH] oppc/code: support repeat expr --- src/openpower/oppc/pc_code.py | 7 +++++++ 1 file changed, 7 insertions(+) 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 -- 2.30.2