Slightly optimize stack save code for calls to long long functions.

The X register is not used as part of the return value, so it does not have to be preserved.
This commit is contained in:
Stephen Heumann 2021-02-13 17:21:13 -06:00
parent 75234dbf83
commit f41cd241f8
1 changed files with 8 additions and 4 deletions

12
Gen.pas
View File

@ -4716,11 +4716,13 @@ procedure GenTree {op: icptr};
end {if}
else if saveStack or (op^.q <> 0) then begin
stackSaveDepth := stackSaveDepth - 1;
if not (op^.optype in [cgVoid,cgByte,cgUByte,cgWord,cgUWord]) then
if not (op^.optype in [cgVoid,cgByte,cgUByte,cgWord,cgUWord,cgQuad,cgUQuad])
then
GenImplied(m_txy);
GenNative(m_ldx_dir, direct, stackLoc, nil, 0);
GenImplied(m_txs);
if not (op^.optype in [cgVoid,cgByte,cgUByte,cgWord,cgUWord]) then
if not (op^.optype in [cgVoid,cgByte,cgUByte,cgWord,cgUWord,cgQuad,cgUQuad])
then
GenImplied(m_tyx);
if stackSaveDepth <> 0 then begin
GenImplied(m_ply);
@ -4808,11 +4810,13 @@ procedure GenTree {op: icptr};
end {if}
else if saveStack or (op^.q <> 0) then begin
stackSaveDepth := stackSaveDepth - 1;
if not (op^.optype in [cgVoid,cgByte,cgUByte,cgWord,cgUWord]) then
if not (op^.optype in [cgVoid,cgByte,cgUByte,cgWord,cgUWord,cgQuad,cgUQuad])
then
GenImplied(m_txy);
GenNative(m_ldx_dir, direct, stackLoc, nil, 0);
GenImplied(m_txs);
if not (op^.optype in [cgVoid,cgByte,cgUByte,cgWord,cgUWord]) then
if not (op^.optype in [cgVoid,cgByte,cgUByte,cgWord,cgUWord,cgQuad,cgUQuad])
then
GenImplied(m_tyx);
if stackSaveDepth <> 0 then begin
GenImplied(m_ply);