mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-11-05 02:07:22 +00:00
Optimize quad == 0 comparisons.
This commit is contained in:
parent
5c92a8a0d3
commit
36d31ab37c
17
Gen.pas
17
Gen.pas
@ -2308,7 +2308,18 @@ else
|
||||
end; {case optype of cgReal..cgExtended}
|
||||
|
||||
cgQuad,cgUQuad: begin
|
||||
if SimpleQuadLoad(op^.left) and SimpleQuadLoad(op^.right)
|
||||
if SimpleQuadLoad(op^.left) and (op^.right^.opcode = pc_ldc)
|
||||
and (op^.right^.qval.hi = 0) and (op^.right^.qval.lo = 0) then begin
|
||||
lab1 := GenLabel;
|
||||
OpOnWordOfQuad(m_lda_imm, op^.left, 0);
|
||||
if not volatile then
|
||||
GenNative(m_bne, relative, lab1, nil, 0);
|
||||
OpOnWordOfQuad(m_ora_imm, op^.left, 2);
|
||||
OpOnWordOfQuad(m_ora_imm, op^.left, 4);
|
||||
OpOnWordOfQuad(m_ora_imm, op^.left, 6);
|
||||
GenLab(lab1);
|
||||
end {if}
|
||||
else if SimpleQuadLoad(op^.left) and SimpleQuadLoad(op^.right)
|
||||
and not volatile then begin
|
||||
lab1 := GenLabel;
|
||||
OpOnWordOfQuad(m_lda_imm, op^.left, 0);
|
||||
@ -5019,6 +5030,8 @@ case op^.opcode of {do the operation}
|
||||
end; {GenUnaryQuad}
|
||||
|
||||
|
||||
{$segment 'gen2'}
|
||||
|
||||
procedure GenTree {op: icptr};
|
||||
|
||||
{ generate code for op and its children }
|
||||
@ -7116,8 +7129,6 @@ end; {GenTree}
|
||||
|
||||
{---------------------------------------------------------------}
|
||||
|
||||
{$segment 'gen2'}
|
||||
|
||||
procedure Gen {blk: blockPtr};
|
||||
|
||||
{ Generates native code for a list of blocks }
|
||||
|
Loading…
Reference in New Issue
Block a user