From 649f50d6d512567e69fe4768b7d755cba66dc6c9 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sun, 7 Jun 2020 13:24:29 +0100 Subject: [PATCH] Revert "if referred to through GPR (GPR[RA]), add to read_regs in parser" This reverts commit 18db92ba0f33dfcd036eeddbc42c54eb3cf06ce3. --- src/soc/decoder/isa/comparefixed.patch | 11 ++++++++++- src/soc/decoder/pseudo/parser.py | 3 --- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/soc/decoder/isa/comparefixed.patch b/src/soc/decoder/isa/comparefixed.patch index 56cdefcc..b80e7be4 100644 --- a/src/soc/decoder/isa/comparefixed.patch +++ b/src/soc/decoder/isa/comparefixed.patch @@ -51,7 +51,7 @@ return (CR,) @inject() -- def op_cmpeqb(self, RA, RB, CR): +- def op_cmpeqb(self, RB, CR): - src1 = GPR[RA] - src1 = src1[56:64] + def op_cmpeqb(self, RA, RB, CR): @@ -70,3 +70,12 @@ return (CR,) comparefixed_instrs = {} +@@ -136,7 +135,7 @@ + form='X', + asmregs=[['BF', 'L', 'RA', 'RB']]) + comparefixed_instrs['cmpeqb'] = instruction_info(func=op_cmpeqb, +- read_regs=OrderedSet(['RB']), ++ read_regs=OrderedSet(['RA', 'RB']), + uninit_regs=OrderedSet(), write_regs=OrderedSet(['CR']), + special_regs=OrderedSet(['CR']), op_fields=OrderedSet(['BF']), + form='X', diff --git a/src/soc/decoder/pseudo/parser.py b/src/soc/decoder/pseudo/parser.py index 5bb28c7d..d2466eac 100644 --- a/src/soc/decoder/pseudo/parser.py +++ b/src/soc/decoder/pseudo/parser.py @@ -369,9 +369,6 @@ class PowerParser: print(astor.dump_tree(p[1])) # replace GPR(x) with GPR[x] idx = p[1].args[0] - # and add index to read_regs if it is a gpr - if idx in self.gprs: - self.read_regs.add(name) p[1] = ast.Subscript(p[1].func, idx, ast.Load()) elif isinstance(p[1], ast.Call) and p[1].func.id == 'MEM': print("mem assign") -- 2.30.2