|
@@ -518,6 +518,8 @@ interface
|
|
|
|
|
|
procedure ti8086addnode.second_cmp64bit;
|
|
procedure ti8086addnode.second_cmp64bit;
|
|
var
|
|
var
|
|
|
|
+ truelabel,
|
|
|
|
+ falselabel : tasmlabel;
|
|
hregister,
|
|
hregister,
|
|
hregister2 : tregister;
|
|
hregister2 : tregister;
|
|
href : treference;
|
|
href : treference;
|
|
@@ -536,10 +538,10 @@ interface
|
|
case nodetype of
|
|
case nodetype of
|
|
ltn,gtn:
|
|
ltn,gtn:
|
|
begin
|
|
begin
|
|
- cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),current_procinfo.CurrTrueLabel);
|
|
|
|
|
|
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),location.truelabel);
|
|
{ cheat a little bit for the negative test }
|
|
{ cheat a little bit for the negative test }
|
|
toggleflag(nf_swapped);
|
|
toggleflag(nf_swapped);
|
|
- cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),current_procinfo.CurrFalseLabel);
|
|
|
|
|
|
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),location.falselabel);
|
|
toggleflag(nf_swapped);
|
|
toggleflag(nf_swapped);
|
|
end;
|
|
end;
|
|
lten,gten:
|
|
lten,gten:
|
|
@@ -549,19 +551,19 @@ interface
|
|
nodetype:=ltn
|
|
nodetype:=ltn
|
|
else
|
|
else
|
|
nodetype:=gtn;
|
|
nodetype:=gtn;
|
|
- cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),current_procinfo.CurrTrueLabel);
|
|
|
|
|
|
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),location.truelabel);
|
|
{ cheat for the negative test }
|
|
{ cheat for the negative test }
|
|
if nodetype=ltn then
|
|
if nodetype=ltn then
|
|
nodetype:=gtn
|
|
nodetype:=gtn
|
|
else
|
|
else
|
|
nodetype:=ltn;
|
|
nodetype:=ltn;
|
|
- cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),current_procinfo.CurrFalseLabel);
|
|
|
|
|
|
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),location.falselabel);
|
|
nodetype:=oldnodetype;
|
|
nodetype:=oldnodetype;
|
|
end;
|
|
end;
|
|
equaln:
|
|
equaln:
|
|
- cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,current_procinfo.CurrFalseLabel);
|
|
|
|
|
|
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,location.falselabel);
|
|
unequaln:
|
|
unequaln:
|
|
- cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,current_procinfo.CurrTrueLabel);
|
|
|
|
|
|
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,location.truelabel);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -580,10 +582,10 @@ interface
|
|
begin
|
|
begin
|
|
{ the comparisaion of the low word have to be }
|
|
{ the comparisaion of the low word have to be }
|
|
{ always unsigned! }
|
|
{ always unsigned! }
|
|
- cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(true),current_procinfo.CurrTrueLabel);
|
|
|
|
|
|
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(true),location.truelabel);
|
|
{ cheat a little bit for the negative test }
|
|
{ cheat a little bit for the negative test }
|
|
toggleflag(nf_swapped);
|
|
toggleflag(nf_swapped);
|
|
- cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(true),current_procinfo.CurrFalseLabel);
|
|
|
|
|
|
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(true),location.falselabel);
|
|
toggleflag(nf_swapped);
|
|
toggleflag(nf_swapped);
|
|
end;
|
|
end;
|
|
lten,gten:
|
|
lten,gten:
|
|
@@ -593,19 +595,19 @@ interface
|
|
nodetype:=ltn
|
|
nodetype:=ltn
|
|
else
|
|
else
|
|
nodetype:=gtn;
|
|
nodetype:=gtn;
|
|
- cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(true),current_procinfo.CurrTrueLabel);
|
|
|
|
|
|
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(true),location.truelabel);
|
|
{ cheat for the negative test }
|
|
{ cheat for the negative test }
|
|
if nodetype=ltn then
|
|
if nodetype=ltn then
|
|
nodetype:=gtn
|
|
nodetype:=gtn
|
|
else
|
|
else
|
|
nodetype:=ltn;
|
|
nodetype:=ltn;
|
|
- cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(true),current_procinfo.CurrFalseLabel);
|
|
|
|
|
|
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(true),location.falselabel);
|
|
nodetype:=oldnodetype;
|
|
nodetype:=oldnodetype;
|
|
end;
|
|
end;
|
|
equaln:
|
|
equaln:
|
|
- cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,current_procinfo.CurrFalseLabel);
|
|
|
|
|
|
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,location.falselabel);
|
|
unequaln:
|
|
unequaln:
|
|
- cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,current_procinfo.CurrTrueLabel);
|
|
|
|
|
|
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,location.truelabel);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -618,23 +620,25 @@ interface
|
|
begin
|
|
begin
|
|
{ the comparisaion of the low word have to be }
|
|
{ the comparisaion of the low word have to be }
|
|
{ always unsigned! }
|
|
{ always unsigned! }
|
|
- cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(true),current_procinfo.CurrTrueLabel);
|
|
|
|
- cg.a_jmp_always(current_asmdata.CurrAsmList,current_procinfo.CurrFalseLabel);
|
|
|
|
|
|
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(true),location.truelabel);
|
|
|
|
+ cg.a_jmp_always(current_asmdata.CurrAsmList,location.falselabel);
|
|
end;
|
|
end;
|
|
equaln:
|
|
equaln:
|
|
begin
|
|
begin
|
|
- cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,current_procinfo.CurrFalseLabel);
|
|
|
|
- cg.a_jmp_always(current_asmdata.CurrAsmList,current_procinfo.CurrTrueLabel);
|
|
|
|
|
|
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,location.falselabel);
|
|
|
|
+ cg.a_jmp_always(current_asmdata.CurrAsmList,location.truelabel);
|
|
end;
|
|
end;
|
|
unequaln:
|
|
unequaln:
|
|
begin
|
|
begin
|
|
- cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,current_procinfo.CurrTrueLabel);
|
|
|
|
- cg.a_jmp_always(current_asmdata.CurrAsmList,current_procinfo.CurrFalseLabel);
|
|
|
|
|
|
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,location.truelabel);
|
|
|
|
+ cg.a_jmp_always(current_asmdata.CurrAsmList,location.falselabel);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
begin
|
|
begin
|
|
|
|
+ truelabel:=nil;
|
|
|
|
+ falselabel:=nil;
|
|
pass_left_right;
|
|
pass_left_right;
|
|
|
|
|
|
unsigned:=((left.resultdef.typ=orddef) and
|
|
unsigned:=((left.resultdef.typ=orddef) and
|
|
@@ -642,6 +646,11 @@ interface
|
|
((right.resultdef.typ=orddef) and
|
|
((right.resultdef.typ=orddef) and
|
|
(torddef(right.resultdef).ordtype=u64bit));
|
|
(torddef(right.resultdef).ordtype=u64bit));
|
|
|
|
|
|
|
|
+ { we have LOC_JUMP as result }
|
|
|
|
+ current_asmdata.getjumplabel(truelabel);
|
|
|
|
+ current_asmdata.getjumplabel(falselabel);
|
|
|
|
+ location_reset_jump(location,truelabel,falselabel);
|
|
|
|
+
|
|
{ left and right no register? }
|
|
{ left and right no register? }
|
|
{ then one must be demanded }
|
|
{ then one must be demanded }
|
|
if (left.location.loc<>LOC_REGISTER) then
|
|
if (left.location.loc<>LOC_REGISTER) then
|
|
@@ -709,7 +718,7 @@ interface
|
|
middlejmp64bitcmp;
|
|
middlejmp64bitcmp;
|
|
emit_ref_reg(A_CMP,S_W,right.location.reference,left.location.register64.reglo);
|
|
emit_ref_reg(A_CMP,S_W,right.location.reference,left.location.register64.reglo);
|
|
lastjmp64bitcmp;
|
|
lastjmp64bitcmp;
|
|
- cg.a_jmp_always(current_asmdata.CurrAsmList,current_procinfo.CurrFalseLabel);
|
|
|
|
|
|
+ cg.a_jmp_always(current_asmdata.CurrAsmList,location.falselabel);
|
|
location_freetemp(current_asmdata.CurrAsmList,right.location);
|
|
location_freetemp(current_asmdata.CurrAsmList,right.location);
|
|
end;
|
|
end;
|
|
LOC_CONSTANT :
|
|
LOC_CONSTANT :
|
|
@@ -727,13 +736,12 @@ interface
|
|
internalerror(200203282);
|
|
internalerror(200203282);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
-
|
|
|
|
- { we have LOC_JUMP as result }
|
|
|
|
- location_reset(location,LOC_JUMP,OS_NO)
|
|
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure ti8086addnode.second_cmp32bit;
|
|
procedure ti8086addnode.second_cmp32bit;
|
|
var
|
|
var
|
|
|
|
+ truelabel,
|
|
|
|
+ falselabel: tasmlabel;
|
|
hregister : tregister;
|
|
hregister : tregister;
|
|
href : treference;
|
|
href : treference;
|
|
unsigned : boolean;
|
|
unsigned : boolean;
|
|
@@ -751,10 +759,10 @@ interface
|
|
case nodetype of
|
|
case nodetype of
|
|
ltn,gtn:
|
|
ltn,gtn:
|
|
begin
|
|
begin
|
|
- cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),current_procinfo.CurrTrueLabel);
|
|
|
|
|
|
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),location.truelabel);
|
|
{ cheat a little bit for the negative test }
|
|
{ cheat a little bit for the negative test }
|
|
toggleflag(nf_swapped);
|
|
toggleflag(nf_swapped);
|
|
- cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),current_procinfo.CurrFalseLabel);
|
|
|
|
|
|
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),location.falselabel);
|
|
toggleflag(nf_swapped);
|
|
toggleflag(nf_swapped);
|
|
end;
|
|
end;
|
|
lten,gten:
|
|
lten,gten:
|
|
@@ -764,19 +772,19 @@ interface
|
|
nodetype:=ltn
|
|
nodetype:=ltn
|
|
else
|
|
else
|
|
nodetype:=gtn;
|
|
nodetype:=gtn;
|
|
- cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),current_procinfo.CurrTrueLabel);
|
|
|
|
|
|
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),location.truelabel);
|
|
{ cheat for the negative test }
|
|
{ cheat for the negative test }
|
|
if nodetype=ltn then
|
|
if nodetype=ltn then
|
|
nodetype:=gtn
|
|
nodetype:=gtn
|
|
else
|
|
else
|
|
nodetype:=ltn;
|
|
nodetype:=ltn;
|
|
- cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),current_procinfo.CurrFalseLabel);
|
|
|
|
|
|
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),location.falselabel);
|
|
nodetype:=oldnodetype;
|
|
nodetype:=oldnodetype;
|
|
end;
|
|
end;
|
|
equaln:
|
|
equaln:
|
|
- cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,current_procinfo.CurrFalseLabel);
|
|
|
|
|
|
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,location.falselabel);
|
|
unequaln:
|
|
unequaln:
|
|
- cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,current_procinfo.CurrTrueLabel);
|
|
|
|
|
|
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,location.truelabel);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -789,23 +797,25 @@ interface
|
|
begin
|
|
begin
|
|
{ the comparisaion of the low dword have to be }
|
|
{ the comparisaion of the low dword have to be }
|
|
{ always unsigned! }
|
|
{ always unsigned! }
|
|
- cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(true),current_procinfo.CurrTrueLabel);
|
|
|
|
- cg.a_jmp_always(current_asmdata.CurrAsmList,current_procinfo.CurrFalseLabel);
|
|
|
|
|
|
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(true),location.truelabel);
|
|
|
|
+ cg.a_jmp_always(current_asmdata.CurrAsmList,location.falselabel);
|
|
end;
|
|
end;
|
|
equaln:
|
|
equaln:
|
|
begin
|
|
begin
|
|
- cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,current_procinfo.CurrFalseLabel);
|
|
|
|
- cg.a_jmp_always(current_asmdata.CurrAsmList,current_procinfo.CurrTrueLabel);
|
|
|
|
|
|
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,location.falselabel);
|
|
|
|
+ cg.a_jmp_always(current_asmdata.CurrAsmList,location.truelabel);
|
|
end;
|
|
end;
|
|
unequaln:
|
|
unequaln:
|
|
begin
|
|
begin
|
|
- cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,current_procinfo.CurrTrueLabel);
|
|
|
|
- cg.a_jmp_always(current_asmdata.CurrAsmList,current_procinfo.CurrFalseLabel);
|
|
|
|
|
|
+ cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,location.truelabel);
|
|
|
|
+ cg.a_jmp_always(current_asmdata.CurrAsmList,location.falselabel);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
begin
|
|
begin
|
|
|
|
+ truelabel:=nil;
|
|
|
|
+ falselabel:=nil;
|
|
pass_left_right;
|
|
pass_left_right;
|
|
|
|
|
|
unsigned:=((left.resultdef.typ=orddef) and
|
|
unsigned:=((left.resultdef.typ=orddef) and
|
|
@@ -814,6 +824,11 @@ interface
|
|
(torddef(right.resultdef).ordtype=u32bit)) or
|
|
(torddef(right.resultdef).ordtype=u32bit)) or
|
|
is_hugepointer(left.resultdef);
|
|
is_hugepointer(left.resultdef);
|
|
|
|
|
|
|
|
+ { we have LOC_JUMP as result }
|
|
|
|
+ current_asmdata.getjumplabel(truelabel);
|
|
|
|
+ current_asmdata.getjumplabel(falselabel);
|
|
|
|
+ location_reset_jump(location,truelabel,falselabel);
|
|
|
|
+
|
|
{ left and right no register? }
|
|
{ left and right no register? }
|
|
{ then one must be demanded }
|
|
{ then one must be demanded }
|
|
if (left.location.loc<>LOC_REGISTER) then
|
|
if (left.location.loc<>LOC_REGISTER) then
|
|
@@ -866,7 +881,7 @@ interface
|
|
dec(href.offset,2);
|
|
dec(href.offset,2);
|
|
emit_ref_reg(A_CMP,S_W,href,left.location.register);
|
|
emit_ref_reg(A_CMP,S_W,href,left.location.register);
|
|
secondjmp32bitcmp;
|
|
secondjmp32bitcmp;
|
|
- cg.a_jmp_always(current_asmdata.CurrAsmList,current_procinfo.CurrFalseLabel);
|
|
|
|
|
|
+ cg.a_jmp_always(current_asmdata.CurrAsmList,location.falselabel);
|
|
location_freetemp(current_asmdata.CurrAsmList,right.location);
|
|
location_freetemp(current_asmdata.CurrAsmList,right.location);
|
|
end;
|
|
end;
|
|
LOC_CONSTANT :
|
|
LOC_CONSTANT :
|
|
@@ -880,9 +895,6 @@ interface
|
|
internalerror(200203282);
|
|
internalerror(200203282);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
-
|
|
|
|
- { we have LOC_JUMP as result }
|
|
|
|
- location_reset(location,LOC_JUMP,OS_NO)
|
|
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|