mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-06-07 03:29:29 +00:00
Generate better code for pc_not on boolean operands.
This commit is contained in:
parent
b5b76b624c
commit
687a5eaa45
16
Gen.pas
16
Gen.pas
|
@ -5422,8 +5422,12 @@ procedure GenTree {op: icptr};
|
||||||
|
|
||||||
var
|
var
|
||||||
lab1: integer;
|
lab1: integer;
|
||||||
|
operandIsBoolean: boolean;
|
||||||
|
|
||||||
begin {GenntNgiNot}
|
begin {GenntNgiNot}
|
||||||
|
if op^.opcode = pc_not then
|
||||||
|
operandIsBoolean := op^.left^.opcode in
|
||||||
|
[pc_and,pc_ior,pc_neq,pc_equ,pc_geq,pc_leq,pc_les,pc_grt,pc_not];
|
||||||
GenTree(op^.left);
|
GenTree(op^.left);
|
||||||
case op^.opcode of
|
case op^.opcode of
|
||||||
pc_bnt:
|
pc_bnt:
|
||||||
|
@ -5435,11 +5439,13 @@ procedure GenTree {op: icptr};
|
||||||
end; {case pc_ngi}
|
end; {case pc_ngi}
|
||||||
|
|
||||||
pc_not: begin
|
pc_not: begin
|
||||||
lab1 := GenLabel;
|
if not operandIsBoolean then begin
|
||||||
GenImpliedForFlags(m_tax);
|
lab1 := GenLabel;
|
||||||
GenNative(m_beq, relative, lab1, nil, 0);
|
GenImpliedForFlags(m_tax);
|
||||||
GenNative(m_lda_imm, immediate, 1, nil, 0);
|
GenNative(m_beq, relative, lab1, nil, 0);
|
||||||
GenLab(lab1);
|
GenNative(m_lda_imm, immediate, 1, nil, 0);
|
||||||
|
GenLab(lab1);
|
||||||
|
end; {if}
|
||||||
GenNative(m_eor_imm, immediate, 1, nil, 0);
|
GenNative(m_eor_imm, immediate, 1, nil, 0);
|
||||||
end; {if}
|
end; {if}
|
||||||
end; {case}
|
end; {case}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user