# HG changeset patch # User Michael Pavone # Date 1550651692 28800 # Node ID 7b6831305a6a8d9e4c2bc71243cc525d5dd54bda # Parent 6cc2fa6a1955865f677987278c3f1368e8aca08f Fix calculation for whether coalesceFlags is needed for xchg instruction in CPU DSL diff -r 6cc2fa6a1955 -r 7b6831305a6a cpu_dsl.py --- a/cpu_dsl.py Wed Feb 20 00:16:27 2019 -0800 +++ b/cpu_dsl.py Wed Feb 20 00:34:52 2019 -0800 @@ -731,6 +731,10 @@ 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: