self.__regfetch[str(node.left)].append(node.left)
if isinstance(node.right, (pc_ast.GPR, pc_ast.FPR)):
self.__regfetch[str(node.right)].append(node.left)
+ if isinstance(node.left, (pc_ast.GPR, pc_ast.FPR)):
+ left = f"oppc_reg_fetch({str(self[node.left])})"
+ else:
+ left = str(self[node.left])
+ if isinstance(node.right, (pc_ast.GPR, pc_ast.FPR)):
+ right = f"oppc_reg_fetch({str(self[node.right])})"
+ else:
+ right = str(self[node.right])
+ if isinstance(node.op, (pc_ast.Add, pc_ast.Sub)):
+ op = {
+ pc_ast.Not: "~",
+ pc_ast.Add: "+",
+ pc_ast.Sub: "-",
+ }[node.op.__class__]
+ stmt = " ".join([left, op, right])
+ self[node].emit(stmt=f"({stmt})")
+ else:
+ raise ValueError(node)
@pc_util.Hook(pc_ast.UnaryExpr)
def UnaryExpr(self, node):