Mercurial > repos > blastem
comparison cpu_dsl.py @ 1765:7b6831305a6a
Fix calculation for whether coalesceFlags is needed for xchg instruction in CPU DSL
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Wed, 20 Feb 2019 00:34:52 -0800 |
parents | 6e4faa10f9ee |
children | 0c1491818f4b |
comparison
equal
deleted
inserted
replaced
1764:6cc2fa6a1955 | 1765:7b6831305a6a |
---|---|
729 allParamsConst = flagUpdates is None and not prog.conditional | 729 allParamsConst = flagUpdates is None and not prog.conditional |
730 opDef = _opMap.get(self.op) | 730 opDef = _opMap.get(self.op) |
731 for param in self.params: | 731 for param in self.params: |
732 allowConst = (self.op in prog.subroutines or len(procParams) != len(self.params) - 1) and param in parent.regValues | 732 allowConst = (self.op in prog.subroutines or len(procParams) != len(self.params) - 1) and param in parent.regValues |
733 isDst = (not opDef is None) and len(procParams) in opDef.outOp | 733 isDst = (not opDef is None) and len(procParams) in opDef.outOp |
734 if isDst and self.op == 'xchg': | |
735 #xchg uses its regs as both source and destination | |
736 #we need to resolve as both so that disperse/coalesce flag stuff gets done | |
737 prog.resolveParam(param, parent, fieldVals, allowConst, False) | |
734 param = prog.resolveParam(param, parent, fieldVals, allowConst, isDst) | 738 param = prog.resolveParam(param, parent, fieldVals, allowConst, isDst) |
735 | 739 |
736 if (not type(param) is int) and len(procParams) != len(self.params) - 1: | 740 if (not type(param) is int) and len(procParams) != len(self.params) - 1: |
737 allParamsConst = False | 741 allParamsConst = False |
738 procParams.append(param) | 742 procParams.append(param) |