From dc901b5cf8db63c428a55a6b01b90d82f0ce83ee Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 20 May 2021 23:02:38 +0100 Subject: [PATCH] only place underscore in front of index if it is a GPR or FPR --- src/openpower/decoder/pseudo/parser.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/openpower/decoder/pseudo/parser.py b/src/openpower/decoder/pseudo/parser.py index d403a089..314c89e8 100644 --- a/src/openpower/decoder/pseudo/parser.py +++ b/src/openpower/decoder/pseudo/parser.py @@ -423,7 +423,10 @@ class PowerParser: print(astor.dump_tree(p[1])) # replace GPR(x) with GPR[x] idx = p[1].args[0].id - ridx = ast.Name("_%s" % idx, ast.Load()) + if idx in regs + fregs: + ridx = ast.Name("_%s" % idx, ast.Load()) + else: + ridx = ast.Name(idx, ast.Load()) p[1] = ast.Subscript(p[1].func, ridx, ast.Load()) if idx in self.gprs: self.read_regs.add(idx) # add to list of regs to read -- 2.30.2