From 2dff68e6ae63bb2938264ef4c6318c07d5702b47 Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Sat, 9 Jul 2022 21:48:56 -0500 Subject: [PATCH] Eliminate an unnecessary instruction in quad-to-word conversion. The TAY instruction would set the flags, but that is unnecessary because pc_cnv is a "NeedsCondition" operation (and some other conversions also do not reliably set the flags). The code is also changed to preserve the Y register, possibly facilitating register optimizations. --- Gen.pas | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Gen.pas b/Gen.pas index 8bf6ff5..460601e 100644 --- a/Gen.pas +++ b/Gen.pas @@ -1939,15 +1939,14 @@ else if op^.q = realToUQuad then begin else if op^.q in [quadToWord,uquadToWord,quadToUWord,uquadToUWord] then begin GenImplied(m_pla); GenImplied(m_plx); - GenImplied(m_ply); - GenImplied(m_ply); - GenImplied(m_tay); + GenImplied(m_plx); + GenImplied(m_plx); end {else if} else if op^.q in [quadToUByte,uquadToUByte] then begin GenImplied(m_pla); GenImplied(m_plx); - GenImplied(m_ply); - GenImplied(m_ply); + GenImplied(m_plx); + GenImplied(m_plx); GenNative(m_and_imm, immediate, $00FF, nil, 0); end {else if} else if op^.q in [quadToByte,uquadToByte] then begin