mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-01-01 13:29:32 +00:00
Optimize LDA+TAY to LDY (when A is unused after).
This pattern comes up in the new return code when returning a local variable.
This commit is contained in:
parent
854a6779a9
commit
cf9f19c93d
13
Native.pas
13
Native.pas
@ -1773,11 +1773,22 @@ var
|
||||
npeep[ns+2] := npeep[ns];
|
||||
Remove(ns);
|
||||
end {else if}
|
||||
else if npeep[ns+1].opcode = m_xba then
|
||||
else if npeep[ns+1].opcode = m_xba then begin
|
||||
if npeep[ns+2].opcode = m_and_imm then
|
||||
if npeep[ns+2].operand = $00FF then begin
|
||||
operand := operand+1;
|
||||
Remove(ns+1);
|
||||
end {if}
|
||||
end {else if}
|
||||
else if npeep[ns+1].opcode = m_tay then
|
||||
if npeep[ns+2].opcode = m_lda_dir then begin
|
||||
opcode := m_ldy_dir;
|
||||
Remove(ns+1);
|
||||
end {if}
|
||||
else if npeep[ns+2].opcode = m_pld then
|
||||
if npeep[ns+3].opcode = m_tsc then begin
|
||||
opcode := m_ldy_dir;
|
||||
Remove(ns+1);
|
||||
end; {if}
|
||||
|
||||
m_ldx_dir:
|
||||
|
Loading…
Reference in New Issue
Block a user