Do a few more native code peephole optimizations.

Patch from Kelvin Sherlock.
This commit is contained in:
Stephen Heumann 2017-09-09 20:17:42 -05:00
parent e7cc513ad4
commit a3170ea715
1 changed files with 23 additions and 0 deletions

View File

@ -1422,6 +1422,19 @@ var
Remove(ns+1);
end; {if}
m_eor_imm:
if npeep[ns+1].opcode = m_eor_imm then begin
operand := operand ! npeep[ns+1].operand;
Remove(ns+1);
end; {if}
m_ora_imm:
if npeep[ns+1].opcode = m_ora_imm then begin
operand := operand | npeep[ns+1].operand;
Remove(ns+1);
end; {if}
m_asl_a:
if npeep[ns+1].opcode = m_tay then
if npeep[ns+2].opcode = m_iny then
@ -1725,6 +1738,16 @@ var
Remove(ns);
end; {if}
{ kws }
{ stz $xx, stz $xx }
m_stz_abs, m_stz_absX, m_stz_dir, m_stz_dirX:
if npeep[ns].opcode = npeep[ns+1].opcode then begin
if npeep[ns].operand = npeep[ns+1].operand then begin
Remove(ns+1)
end; {if}
end; {if}
otherwise: ;
end; {case}