From 25253288a742690c1e1c256cecafbdc47749ce23 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Wed, 20 Feb 2019 00:34:52 -0800 Subject: Fix calculation for whether coalesceFlags is needed for xchg instruction in CPU DSL --- cpu_dsl.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cpu_dsl.py') diff --git a/cpu_dsl.py b/cpu_dsl.py index 44f8b7e..611dd96 100755 --- a/cpu_dsl.py +++ b/cpu_dsl.py @@ -731,6 +731,10 @@ class NormalOp: for param in self.params: allowConst = (self.op in prog.subroutines or len(procParams) != len(self.params) - 1) and param in parent.regValues isDst = (not opDef is None) and len(procParams) in opDef.outOp + if isDst and self.op == 'xchg': + #xchg uses its regs as both source and destination + #we need to resolve as both so that disperse/coalesce flag stuff gets done + prog.resolveParam(param, parent, fieldVals, allowConst, False) param = prog.resolveParam(param, parent, fieldVals, allowConst, isDst) if (not type(param) is int) and len(procParams) != len(self.params) - 1: -- cgit v1.2.3