1
0
mirror of https://github.com/cc65/cc65.git synced 2024-07-04 13:29:35 +00:00

Replacement in OptShift3 is even possible, when X is used later.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5773 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz 2012-07-08 13:05:57 +00:00
parent 440cc47770
commit 59ae850db7

View File

@ -381,7 +381,7 @@ unsigned OptShift3 (CodeSeg* S)
*
* ror a
*
* if X is zero on entry and unused later. For shift counts > 1, more
* if X is zero on entry. For shift counts > 1, more
*
* shr a
*
@ -413,9 +413,8 @@ unsigned OptShift3 (CodeSeg* S)
L[2]->OPC == OP65_JSR &&
(Shift = GetShift (L[2]->Arg)) != SHIFT_NONE &&
SHIFT_DIR (Shift) == SHIFT_DIR_RIGHT &&
(Count = SHIFT_COUNT (Shift)) > 0 &&
!RegXUsed (S, I+3)) {
(Count = SHIFT_COUNT (Shift)) > 0) {
/* Add the replacement insn instead */
CodeEntry* X = NewCodeEntry (OP65_ROR, AM65_ACC, "a", 0, L[2]->LI);
CS_InsertEntry (S, X, I+3);