oppc/code: support XLEN
authorDmitry Selyutin <ghostmansd@gmail.com>
Fri, 12 Jan 2024 19:33:05 +0000 (22:33 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Tue, 16 Jan 2024 19:10:07 +0000 (22:10 +0300)
src/openpower/oppc/pc_code.py

index 0c64d40ecae678e034aa8dc77c55ac19ad7d25fd..67d4f42feba24e743f08b1fc10b88d9ca04f6a24 100644 (file)
@@ -148,6 +148,11 @@ class CodeVisitor(pc_util.Visitor):
         times = str(self[node.times])
         self[node].emit(f"oppc_repeat({subject}, {times})")
 
+    @pc_util.Hook(pc_ast.XLEN)
+    def XLEN(self, node):
+        yield node
+        self[node].emit(f"ctx->XLEN")
+
     @pc_util.Hook(pc_ast.Call.Name)
     def CallName(self, node):
         yield node