From: Luke Kenneth Casson Leighton Date: Thu, 20 May 2021 22:02:38 +0000 (+0100) Subject: only place underscore in front of index if it is a GPR or FPR X-Git-Tag: xlen-bcd~584 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dc901b5cf8db63c428a55a6b01b90d82f0ce83ee;p=openpower-isa.git only place underscore in front of index if it is a GPR or FPR --- 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