mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-08 09:38:53 +02:00
* renamed nf_swaped to nf_swapped
git-svn-id: trunk@5818 -
This commit is contained in:
parent
a4a54a105d
commit
1d96dcc50d
@ -68,7 +68,7 @@ interface
|
|||||||
else
|
else
|
||||||
if not(unsigned) then
|
if not(unsigned) then
|
||||||
begin
|
begin
|
||||||
if nf_swaped in flags then
|
if nf_swapped in flags then
|
||||||
case NodeType of
|
case NodeType of
|
||||||
ltn:
|
ltn:
|
||||||
GetResFlags:=F_GT;
|
GetResFlags:=F_GT;
|
||||||
@ -93,7 +93,7 @@ interface
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
if nf_swaped in Flags then
|
if nf_swapped in Flags then
|
||||||
case NodeType of
|
case NodeType of
|
||||||
ltn:
|
ltn:
|
||||||
GetResFlags:=F_HI;
|
GetResFlags:=F_HI;
|
||||||
@ -130,7 +130,7 @@ interface
|
|||||||
fpu_fpa11:
|
fpu_fpa11:
|
||||||
begin
|
begin
|
||||||
pass_left_right;
|
pass_left_right;
|
||||||
if (nf_swaped in flags) then
|
if (nf_swapped in flags) then
|
||||||
swapleftright;
|
swapleftright;
|
||||||
|
|
||||||
case nodetype of
|
case nodetype of
|
||||||
@ -175,7 +175,7 @@ interface
|
|||||||
procedure tarmaddnode.second_cmpfloat;
|
procedure tarmaddnode.second_cmpfloat;
|
||||||
begin
|
begin
|
||||||
pass_left_right;
|
pass_left_right;
|
||||||
if (nf_swaped in flags) then
|
if (nf_swapped in flags) then
|
||||||
swapleftright;
|
swapleftright;
|
||||||
|
|
||||||
{ force fpureg as location, left right doesn't matter
|
{ force fpureg as location, left right doesn't matter
|
||||||
@ -224,9 +224,9 @@ interface
|
|||||||
lten,
|
lten,
|
||||||
gten:
|
gten:
|
||||||
begin
|
begin
|
||||||
if (not(nf_swaped in flags) and
|
if (not(nf_swapped in flags) and
|
||||||
(nodetype = lten)) or
|
(nodetype = lten)) or
|
||||||
((nf_swaped in flags) and
|
((nf_swapped in flags) and
|
||||||
(nodetype = gten)) then
|
(nodetype = gten)) then
|
||||||
swapleftright;
|
swapleftright;
|
||||||
tmpreg:=cg.getintregister(current_asmdata.CurrAsmList,location.size);
|
tmpreg:=cg.getintregister(current_asmdata.CurrAsmList,location.size);
|
||||||
@ -270,9 +270,9 @@ interface
|
|||||||
begin
|
begin
|
||||||
cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(false),current_procinfo.CurrTrueLabel);
|
cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(false),current_procinfo.CurrTrueLabel);
|
||||||
{ cheat a little bit for the negative test }
|
{ cheat a little bit for the negative test }
|
||||||
toggleflag(nf_swaped);
|
toggleflag(nf_swapped);
|
||||||
cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(false),current_procinfo.CurrFalseLabel);
|
cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(false),current_procinfo.CurrFalseLabel);
|
||||||
toggleflag(nf_swaped);
|
toggleflag(nf_swapped);
|
||||||
end;
|
end;
|
||||||
lten,gten:
|
lten,gten:
|
||||||
begin
|
begin
|
||||||
|
@ -115,7 +115,7 @@ interface
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
location_swap(left.location,right.location);
|
location_swap(left.location,right.location);
|
||||||
toggleflag(nf_swaped);
|
toggleflag(nf_swapped);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -123,13 +123,13 @@ interface
|
|||||||
if right.location.loc=LOC_REGISTER then
|
if right.location.loc=LOC_REGISTER then
|
||||||
begin
|
begin
|
||||||
{ when swapped another result register }
|
{ when swapped another result register }
|
||||||
if (nodetype=subn) and (nf_swaped in flags) then
|
if (nodetype=subn) and (nf_swapped in flags) then
|
||||||
begin
|
begin
|
||||||
cg64.a_op64_reg_reg(current_asmdata.CurrAsmList,op,location.size,
|
cg64.a_op64_reg_reg(current_asmdata.CurrAsmList,op,location.size,
|
||||||
left.location.register64,
|
left.location.register64,
|
||||||
right.location.register64);
|
right.location.register64);
|
||||||
location_swap(left.location,right.location);
|
location_swap(left.location,right.location);
|
||||||
toggleflag(nf_swaped);
|
toggleflag(nf_swapped);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -141,7 +141,7 @@ interface
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{ right.location<>LOC_REGISTER }
|
{ right.location<>LOC_REGISTER }
|
||||||
if (nodetype=subn) and (nf_swaped in flags) then
|
if (nodetype=subn) and (nf_swapped in flags) then
|
||||||
begin
|
begin
|
||||||
r:=cg.getintregister(current_asmdata.CurrAsmList,OS_INT);
|
r:=cg.getintregister(current_asmdata.CurrAsmList,OS_INT);
|
||||||
cg64.a_load64low_loc_reg(current_asmdata.CurrAsmList,right.location,r);
|
cg64.a_load64low_loc_reg(current_asmdata.CurrAsmList,right.location,r);
|
||||||
@ -204,9 +204,9 @@ interface
|
|||||||
begin
|
begin
|
||||||
cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),current_procinfo.CurrTrueLabel);
|
cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),current_procinfo.CurrTrueLabel);
|
||||||
{ cheat a little bit for the negative test }
|
{ cheat a little bit for the negative test }
|
||||||
toggleflag(nf_swaped);
|
toggleflag(nf_swapped);
|
||||||
cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),current_procinfo.CurrFalseLabel);
|
cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),current_procinfo.CurrFalseLabel);
|
||||||
toggleflag(nf_swaped);
|
toggleflag(nf_swapped);
|
||||||
end;
|
end;
|
||||||
lten,gten:
|
lten,gten:
|
||||||
begin
|
begin
|
||||||
@ -286,7 +286,7 @@ interface
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
location_swap(left.location,right.location);
|
location_swap(left.location,right.location);
|
||||||
toggleflag(nf_swaped);
|
toggleflag(nf_swapped);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ implementation
|
|||||||
else
|
else
|
||||||
if not(unsigned) then
|
if not(unsigned) then
|
||||||
begin
|
begin
|
||||||
if nf_swaped in flags then
|
if nf_swapped in flags then
|
||||||
case nodetype of
|
case nodetype of
|
||||||
ltn : getresflags:=F_G;
|
ltn : getresflags:=F_G;
|
||||||
lten : getresflags:=F_GE;
|
lten : getresflags:=F_GE;
|
||||||
@ -85,7 +85,7 @@ implementation
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
if nf_swaped in flags then
|
if nf_swapped in flags then
|
||||||
case nodetype of
|
case nodetype of
|
||||||
ltn : getresflags:=F_A;
|
ltn : getresflags:=F_A;
|
||||||
lten : getresflags:=F_AE;
|
lten : getresflags:=F_AE;
|
||||||
@ -136,7 +136,7 @@ implementation
|
|||||||
|
|
||||||
// get the operands in the correct order, there are no special cases
|
// get the operands in the correct order, there are no special cases
|
||||||
// here, everything is register-based
|
// here, everything is register-based
|
||||||
if nf_swaped in flags then
|
if nf_swapped in flags then
|
||||||
swapleftright;
|
swapleftright;
|
||||||
|
|
||||||
// put both operands in a register
|
// put both operands in a register
|
||||||
@ -183,7 +183,7 @@ implementation
|
|||||||
pass_left_right;
|
pass_left_right;
|
||||||
|
|
||||||
{
|
{
|
||||||
if (nf_swaped in flags) then
|
if (nf_swapped in flags) then
|
||||||
swapleftright;
|
swapleftright;
|
||||||
}
|
}
|
||||||
{ force fpureg as location, left right doesn't matter
|
{ force fpureg as location, left right doesn't matter
|
||||||
@ -229,9 +229,9 @@ implementation
|
|||||||
end;
|
end;
|
||||||
lten,gten:
|
lten,gten:
|
||||||
begin
|
begin
|
||||||
If (not(nf_swaped in flags) and
|
If (not(nf_swapped in flags) and
|
||||||
(nodetype = lten)) or
|
(nodetype = lten)) or
|
||||||
((nf_swaped in flags) and
|
((nf_swapped in flags) and
|
||||||
(nodetype = gten)) then
|
(nodetype = gten)) then
|
||||||
swapleftright;
|
swapleftright;
|
||||||
// now we have to check whether left >= right
|
// now we have to check whether left >= right
|
||||||
|
@ -142,7 +142,7 @@ interface
|
|||||||
left.location.register := tmpreg;
|
left.location.register := tmpreg;
|
||||||
{$ifdef x86}
|
{$ifdef x86}
|
||||||
{ left operand is now on top of the stack, instead of the right one! }
|
{ left operand is now on top of the stack, instead of the right one! }
|
||||||
toggleflag(nf_swaped);
|
toggleflag(nf_swapped);
|
||||||
{$endif x86}
|
{$endif x86}
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -260,7 +260,7 @@ interface
|
|||||||
We need an extra check if left is a register because the
|
We need an extra check if left is a register because the
|
||||||
default case can skip the register loading when the
|
default case can skip the register loading when the
|
||||||
setelementn is in a register (PFV) }
|
setelementn is in a register (PFV) }
|
||||||
if (nf_swaped in flags) and
|
if (nf_swapped in flags) and
|
||||||
(left.nodetype=setelementn) then
|
(left.nodetype=setelementn) then
|
||||||
swapleftright;
|
swapleftright;
|
||||||
if (right.nodetype=setelementn) and
|
if (right.nodetype=setelementn) and
|
||||||
@ -307,7 +307,7 @@ interface
|
|||||||
subn :
|
subn :
|
||||||
begin
|
begin
|
||||||
cgop:=OP_AND;
|
cgop:=OP_AND;
|
||||||
if (not(nf_swaped in flags)) then
|
if (not(nf_swapped in flags)) then
|
||||||
if (right.location.loc=LOC_CONSTANT) then
|
if (right.location.loc=LOC_CONSTANT) then
|
||||||
right.location.value := not(right.location.value)
|
right.location.value := not(right.location.value)
|
||||||
else
|
else
|
||||||
@ -511,7 +511,7 @@ interface
|
|||||||
end;
|
end;
|
||||||
subn:
|
subn:
|
||||||
begin
|
begin
|
||||||
if (nf_swaped in flags) then
|
if (nf_swapped in flags) then
|
||||||
swapleftright;
|
swapleftright;
|
||||||
|
|
||||||
if left.location.loc <> LOC_CONSTANT then
|
if left.location.loc <> LOC_CONSTANT then
|
||||||
@ -554,7 +554,7 @@ interface
|
|||||||
end;
|
end;
|
||||||
subn:
|
subn:
|
||||||
begin
|
begin
|
||||||
if (nf_swaped in flags) then
|
if (nf_swapped in flags) then
|
||||||
swapleftright;
|
swapleftright;
|
||||||
|
|
||||||
if left.location.loc <> LOC_CONSTANT then
|
if left.location.loc <> LOC_CONSTANT then
|
||||||
@ -697,7 +697,7 @@ interface
|
|||||||
end
|
end
|
||||||
else { subtract is a special case since its not commutative }
|
else { subtract is a special case since its not commutative }
|
||||||
begin
|
begin
|
||||||
if (nf_swaped in flags) then
|
if (nf_swapped in flags) then
|
||||||
swapleftright;
|
swapleftright;
|
||||||
if left.location.loc<>LOC_CONSTANT then
|
if left.location.loc<>LOC_CONSTANT then
|
||||||
begin
|
begin
|
||||||
|
@ -285,7 +285,7 @@ implementation
|
|||||||
exit;
|
exit;
|
||||||
|
|
||||||
{ ofcourse not commutative }
|
{ ofcourse not commutative }
|
||||||
if nf_swaped in flags then
|
if nf_swapped in flags then
|
||||||
swapleftright;
|
swapleftright;
|
||||||
|
|
||||||
if genjumps then
|
if genjumps then
|
||||||
|
@ -224,7 +224,7 @@ implementation
|
|||||||
if (p.nodetype in [orn,andn]) and
|
if (p.nodetype in [orn,andn]) and
|
||||||
is_boolean(p.left.resultdef) then
|
is_boolean(p.left.resultdef) then
|
||||||
begin
|
begin
|
||||||
if nf_swaped in p.flags then
|
if nf_swapped in p.flags then
|
||||||
internalerror(234234);
|
internalerror(234234);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -245,10 +245,10 @@ implementation
|
|||||||
hp:=p.left;
|
hp:=p.left;
|
||||||
p.left:=p.right;
|
p.left:=p.right;
|
||||||
p.right:=hp;
|
p.right:=hp;
|
||||||
if nf_swaped in p.flags then
|
if nf_swapped in p.flags then
|
||||||
exclude(p.flags,nf_swaped)
|
exclude(p.flags,nf_swapped)
|
||||||
else
|
else
|
||||||
include(p.flags,nf_swaped);
|
include(p.flags,nf_swapped);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -197,7 +197,7 @@ interface
|
|||||||
{ all boolean field of ttree are now collected in flags }
|
{ all boolean field of ttree are now collected in flags }
|
||||||
tnodeflag = (
|
tnodeflag = (
|
||||||
nf_swapable, { tbinop operands can be swaped }
|
nf_swapable, { tbinop operands can be swaped }
|
||||||
nf_swaped, { tbinop operands are swaped }
|
nf_swapped, { tbinop operands are swaped }
|
||||||
nf_error,
|
nf_error,
|
||||||
|
|
||||||
{ general }
|
{ general }
|
||||||
@ -1118,10 +1118,10 @@ implementation
|
|||||||
swapp:=right;
|
swapp:=right;
|
||||||
right:=left;
|
right:=left;
|
||||||
left:=swapp;
|
left:=swapp;
|
||||||
if nf_swaped in flags then
|
if nf_swapped in flags then
|
||||||
exclude(flags,nf_swaped)
|
exclude(flags,nf_swapped)
|
||||||
else
|
else
|
||||||
include(flags,nf_swaped);
|
include(flags,nf_swapped);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
@ -193,9 +193,9 @@ interface
|
|||||||
begin
|
begin
|
||||||
cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags,current_procinfo.CurrTrueLabel);
|
cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags,current_procinfo.CurrTrueLabel);
|
||||||
{ cheat a little bit for the negative test }
|
{ cheat a little bit for the negative test }
|
||||||
toggleflag(nf_swaped);
|
toggleflag(nf_swapped);
|
||||||
cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags,current_procinfo.CurrFalseLabel);
|
cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags,current_procinfo.CurrFalseLabel);
|
||||||
toggleflag(nf_swaped);
|
toggleflag(nf_swapped);
|
||||||
end;
|
end;
|
||||||
lten,gten:
|
lten,gten:
|
||||||
begin
|
begin
|
||||||
@ -276,7 +276,7 @@ interface
|
|||||||
subn :
|
subn :
|
||||||
begin
|
begin
|
||||||
op:=OP_SUB;
|
op:=OP_SUB;
|
||||||
if (nf_swaped in flags) then
|
if (nf_swapped in flags) then
|
||||||
swapleftright;
|
swapleftright;
|
||||||
end;
|
end;
|
||||||
ltn,lten,
|
ltn,lten,
|
||||||
@ -642,7 +642,7 @@ interface
|
|||||||
if (right.location.loc=LOC_MMXREGISTER) then
|
if (right.location.loc=LOC_MMXREGISTER) then
|
||||||
begin
|
begin
|
||||||
location_swap(left.location,right.location);
|
location_swap(left.location,right.location);
|
||||||
toggleflag(nf_swaped);
|
toggleflag(nf_swapped);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -671,7 +671,7 @@ interface
|
|||||||
{ at this point, left.location.loc should be LOC_MMXREGISTER }
|
{ at this point, left.location.loc should be LOC_MMXREGISTER }
|
||||||
if right.location.loc<>LOC_MMXREGISTER then
|
if right.location.loc<>LOC_MMXREGISTER then
|
||||||
begin
|
begin
|
||||||
if (nodetype=subn) and (nf_swaped in flags) then
|
if (nodetype=subn) and (nf_swapped in flags) then
|
||||||
begin
|
begin
|
||||||
if right.location.loc=LOC_CMMXREGISTER then
|
if right.location.loc=LOC_CMMXREGISTER then
|
||||||
begin
|
begin
|
||||||
@ -707,11 +707,11 @@ interface
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{ right.location=LOC_MMXREGISTER }
|
{ right.location=LOC_MMXREGISTER }
|
||||||
if (nodetype=subn) and (nf_swaped in flags) then
|
if (nodetype=subn) and (nf_swapped in flags) then
|
||||||
begin
|
begin
|
||||||
emit_reg_reg(op,S_NO,left.location.register,right.location.register);
|
emit_reg_reg(op,S_NO,left.location.register,right.location.register);
|
||||||
location_swap(left.location,right.location);
|
location_swap(left.location,right.location);
|
||||||
toggleflag(nf_swaped);
|
toggleflag(nf_swapped);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -860,7 +860,7 @@ interface
|
|||||||
end;
|
end;
|
||||||
subn:
|
subn:
|
||||||
begin
|
begin
|
||||||
if (nf_swaped in flags) then
|
if (nf_swapped in flags) then
|
||||||
swapleftright;
|
swapleftright;
|
||||||
if left.location.loc <> LOC_CONSTANT then
|
if left.location.loc <> LOC_CONSTANT then
|
||||||
if right.location.loc <> LOC_CONSTANT then
|
if right.location.loc <> LOC_CONSTANT then
|
||||||
@ -905,7 +905,7 @@ interface
|
|||||||
subn:
|
subn:
|
||||||
begin
|
begin
|
||||||
op := A_SUBO;
|
op := A_SUBO;
|
||||||
if (nf_swaped in flags) then
|
if (nf_swapped in flags) then
|
||||||
swapleftright;
|
swapleftright;
|
||||||
end;
|
end;
|
||||||
muln:
|
muln:
|
||||||
@ -929,7 +929,7 @@ interface
|
|||||||
end;
|
end;
|
||||||
subn:
|
subn:
|
||||||
begin
|
begin
|
||||||
if nf_swaped in flags then
|
if nf_swapped in flags then
|
||||||
swapleftright;
|
swapleftright;
|
||||||
current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_reg(A_SUB,location.register,
|
current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_reg(A_SUB,location.register,
|
||||||
left.location.register,right.location.register));
|
left.location.register,right.location.register));
|
||||||
|
@ -253,7 +253,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
subn:
|
subn:
|
||||||
begin
|
begin
|
||||||
if (nf_swaped in flags) then
|
if (nf_swapped in flags) then
|
||||||
swapleftright;
|
swapleftright;
|
||||||
if left.location.loc <> LOC_CONSTANT then
|
if left.location.loc <> LOC_CONSTANT then
|
||||||
if right.location.loc <> LOC_CONSTANT then begin
|
if right.location.loc <> LOC_CONSTANT then begin
|
||||||
@ -295,7 +295,7 @@ begin
|
|||||||
subn:
|
subn:
|
||||||
begin
|
begin
|
||||||
op := A_SUBO;
|
op := A_SUBO;
|
||||||
if (nf_swaped in flags) then
|
if (nf_swapped in flags) then
|
||||||
swapleftright;
|
swapleftright;
|
||||||
end;
|
end;
|
||||||
muln:
|
muln:
|
||||||
|
@ -144,7 +144,7 @@ implementation
|
|||||||
equaln : result.flag:=F_EQ;
|
equaln : result.flag:=F_EQ;
|
||||||
unequaln : result.flag:=F_NE;
|
unequaln : result.flag:=F_NE;
|
||||||
else
|
else
|
||||||
if nf_swaped in flags then
|
if nf_swapped in flags then
|
||||||
case nodetype of
|
case nodetype of
|
||||||
ltn : result.flag:=F_GT;
|
ltn : result.flag:=F_GT;
|
||||||
lten : result.flag:=F_GE;
|
lten : result.flag:=F_GE;
|
||||||
@ -335,7 +335,7 @@ implementation
|
|||||||
|
|
||||||
// get the operands in the correct order, there are no special cases
|
// get the operands in the correct order, there are no special cases
|
||||||
// here, everything is register-based
|
// here, everything is register-based
|
||||||
if nf_swaped in flags then
|
if nf_swapped in flags then
|
||||||
swapleftright;
|
swapleftright;
|
||||||
|
|
||||||
// put both operands in a register
|
// put both operands in a register
|
||||||
@ -406,7 +406,7 @@ implementation
|
|||||||
case nodetype of
|
case nodetype of
|
||||||
addn :
|
addn :
|
||||||
begin
|
begin
|
||||||
if (nf_swaped in flags) and (left.nodetype=setelementn) then
|
if (nf_swapped in flags) and (left.nodetype=setelementn) then
|
||||||
swapleftright;
|
swapleftright;
|
||||||
{ are we adding set elements ? }
|
{ are we adding set elements ? }
|
||||||
if right.nodetype=setelementn then
|
if right.nodetype=setelementn then
|
||||||
@ -443,7 +443,7 @@ implementation
|
|||||||
subn :
|
subn :
|
||||||
begin
|
begin
|
||||||
cgop:=OP_AND;
|
cgop:=OP_AND;
|
||||||
if (not(nf_swaped in flags)) then
|
if (not(nf_swapped in flags)) then
|
||||||
if (right.location.loc=LOC_CONSTANT) then
|
if (right.location.loc=LOC_CONSTANT) then
|
||||||
right.location.value := not(right.location.value)
|
right.location.value := not(right.location.value)
|
||||||
else
|
else
|
||||||
@ -479,9 +479,9 @@ implementation
|
|||||||
end;
|
end;
|
||||||
lten,gten:
|
lten,gten:
|
||||||
begin
|
begin
|
||||||
If (not(nf_swaped in flags) and
|
If (not(nf_swapped in flags) and
|
||||||
(nodetype = lten)) or
|
(nodetype = lten)) or
|
||||||
((nf_swaped in flags) and
|
((nf_swapped in flags) and
|
||||||
(nodetype = gten)) then
|
(nodetype = gten)) then
|
||||||
swapleftright;
|
swapleftright;
|
||||||
// now we have to check whether left >= right
|
// now we have to check whether left >= right
|
||||||
|
@ -68,7 +68,7 @@ interface
|
|||||||
else
|
else
|
||||||
if not(unsigned) then
|
if not(unsigned) then
|
||||||
begin
|
begin
|
||||||
if nf_swaped in flags then
|
if nf_swapped in flags then
|
||||||
case NodeType of
|
case NodeType of
|
||||||
ltn:
|
ltn:
|
||||||
GetResFlags:=F_G;
|
GetResFlags:=F_G;
|
||||||
@ -93,7 +93,7 @@ interface
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
if nf_swaped in Flags then
|
if nf_swapped in Flags then
|
||||||
case NodeType of
|
case NodeType of
|
||||||
ltn:
|
ltn:
|
||||||
GetResFlags:=F_A;
|
GetResFlags:=F_A;
|
||||||
@ -129,7 +129,7 @@ interface
|
|||||||
result:=F_FNE;
|
result:=F_FNE;
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
if nf_swaped in Flags then
|
if nf_swapped in Flags then
|
||||||
case NodeType of
|
case NodeType of
|
||||||
ltn:
|
ltn:
|
||||||
result:=F_FG;
|
result:=F_FG;
|
||||||
@ -161,7 +161,7 @@ interface
|
|||||||
op : TAsmOp;
|
op : TAsmOp;
|
||||||
begin
|
begin
|
||||||
pass_left_right;
|
pass_left_right;
|
||||||
if (nf_swaped in flags) then
|
if (nf_swapped in flags) then
|
||||||
swapleftright;
|
swapleftright;
|
||||||
|
|
||||||
{ force fpureg as location, left right doesn't matter
|
{ force fpureg as location, left right doesn't matter
|
||||||
@ -218,7 +218,7 @@ interface
|
|||||||
op : tasmop;
|
op : tasmop;
|
||||||
begin
|
begin
|
||||||
pass_left_right;
|
pass_left_right;
|
||||||
if (nf_swaped in flags) then
|
if (nf_swapped in flags) then
|
||||||
swapleftright;
|
swapleftright;
|
||||||
|
|
||||||
{ force fpureg as location, left right doesn't matter
|
{ force fpureg as location, left right doesn't matter
|
||||||
@ -284,9 +284,9 @@ interface
|
|||||||
begin
|
begin
|
||||||
cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),current_procinfo.CurrTrueLabel);
|
cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),current_procinfo.CurrTrueLabel);
|
||||||
{ cheat a little bit for the negative test }
|
{ cheat a little bit for the negative test }
|
||||||
toggleflag(nf_swaped);
|
toggleflag(nf_swapped);
|
||||||
cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),current_procinfo.CurrFalseLabel);
|
cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags(unsigned),current_procinfo.CurrFalseLabel);
|
||||||
toggleflag(nf_swaped);
|
toggleflag(nf_swapped);
|
||||||
end;
|
end;
|
||||||
lten,gten:
|
lten,gten:
|
||||||
begin
|
begin
|
||||||
|
@ -88,14 +88,14 @@ unit nx86add;
|
|||||||
begin
|
begin
|
||||||
{ right.location is a LOC_REGISTER }
|
{ right.location is a LOC_REGISTER }
|
||||||
{ when swapped another result register }
|
{ when swapped another result register }
|
||||||
if (nodetype=subn) and (nf_swaped in flags) then
|
if (nodetype=subn) and (nf_swapped in flags) then
|
||||||
begin
|
begin
|
||||||
if extra_not then
|
if extra_not then
|
||||||
emit_reg(A_NOT,TCGSize2Opsize[opsize],left.location.register);
|
emit_reg(A_NOT,TCGSize2Opsize[opsize],left.location.register);
|
||||||
emit_reg_reg(op,TCGSize2Opsize[opsize],left.location.register,right.location.register);
|
emit_reg_reg(op,TCGSize2Opsize[opsize],left.location.register,right.location.register);
|
||||||
{ newly swapped also set swapped flag }
|
{ newly swapped also set swapped flag }
|
||||||
location_swap(left.location,right.location);
|
location_swap(left.location,right.location);
|
||||||
toggleflag(nf_swaped);
|
toggleflag(nf_swapped);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -109,7 +109,7 @@ unit nx86add;
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{ right.location is not a LOC_REGISTER }
|
{ right.location is not a LOC_REGISTER }
|
||||||
if (nodetype=subn) and (nf_swaped in flags) then
|
if (nodetype=subn) and (nf_swapped in flags) then
|
||||||
begin
|
begin
|
||||||
if extra_not then
|
if extra_not then
|
||||||
cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_NOT,opsize,left.location.register,left.location.register);
|
cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_NOT,opsize,left.location.register,left.location.register);
|
||||||
@ -199,7 +199,7 @@ unit nx86add;
|
|||||||
(right.location.loc=LOC_REGISTER) then
|
(right.location.loc=LOC_REGISTER) then
|
||||||
begin
|
begin
|
||||||
location_swap(left.location,right.location);
|
location_swap(left.location,right.location);
|
||||||
toggleflag(nf_swaped);
|
toggleflag(nf_swapped);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -221,7 +221,7 @@ unit nx86add;
|
|||||||
location_force_fpureg(current_asmdata.CurrAsmList,left.location,false)
|
location_force_fpureg(current_asmdata.CurrAsmList,left.location,false)
|
||||||
else
|
else
|
||||||
{ left was on the stack => swap }
|
{ left was on the stack => swap }
|
||||||
toggleflag(nf_swaped);
|
toggleflag(nf_swapped);
|
||||||
end
|
end
|
||||||
{ the nominator in st0 }
|
{ the nominator in st0 }
|
||||||
else if (left.location.loc<>LOC_FPUREGISTER) then
|
else if (left.location.loc<>LOC_FPUREGISTER) then
|
||||||
@ -229,7 +229,7 @@ unit nx86add;
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{ fpu operands are always in the wrong order on the stack }
|
{ fpu operands are always in the wrong order on the stack }
|
||||||
toggleflag(nf_swaped);
|
toggleflag(nf_swapped);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -282,7 +282,7 @@ unit nx86add;
|
|||||||
else
|
else
|
||||||
if not(unsigned) then
|
if not(unsigned) then
|
||||||
begin
|
begin
|
||||||
if nf_swaped in flags then
|
if nf_swapped in flags then
|
||||||
case nodetype of
|
case nodetype of
|
||||||
ltn : getresflags:=F_G;
|
ltn : getresflags:=F_G;
|
||||||
lten : getresflags:=F_GE;
|
lten : getresflags:=F_GE;
|
||||||
@ -299,7 +299,7 @@ unit nx86add;
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
if nf_swaped in flags then
|
if nf_swapped in flags then
|
||||||
case nodetype of
|
case nodetype of
|
||||||
ltn : getresflags:=F_A;
|
ltn : getresflags:=F_A;
|
||||||
lten : getresflags:=F_AE;
|
lten : getresflags:=F_AE;
|
||||||
@ -342,7 +342,7 @@ unit nx86add;
|
|||||||
{ as it is done for subn }
|
{ as it is done for subn }
|
||||||
{ instead of two registers!!!! }
|
{ instead of two registers!!!! }
|
||||||
{ adding elements is not commutative }
|
{ adding elements is not commutative }
|
||||||
if (nf_swaped in flags) and (left.nodetype=setelementn) then
|
if (nf_swapped in flags) and (left.nodetype=setelementn) then
|
||||||
swapleftright;
|
swapleftright;
|
||||||
{ are we adding set elements ? }
|
{ are we adding set elements ? }
|
||||||
if right.nodetype=setelementn then
|
if right.nodetype=setelementn then
|
||||||
@ -366,10 +366,10 @@ unit nx86add;
|
|||||||
subn :
|
subn :
|
||||||
begin
|
begin
|
||||||
op:=A_AND;
|
op:=A_AND;
|
||||||
if (not(nf_swaped in flags)) and
|
if (not(nf_swapped in flags)) and
|
||||||
(right.location.loc=LOC_CONSTANT) then
|
(right.location.loc=LOC_CONSTANT) then
|
||||||
right.location.value := not(right.location.value)
|
right.location.value := not(right.location.value)
|
||||||
else if (nf_swaped in flags) and
|
else if (nf_swapped in flags) and
|
||||||
(left.location.loc=LOC_CONSTANT) then
|
(left.location.loc=LOC_CONSTANT) then
|
||||||
left.location.value := not(left.location.value)
|
left.location.value := not(left.location.value)
|
||||||
else
|
else
|
||||||
@ -406,8 +406,8 @@ unit nx86add;
|
|||||||
op:=A_CMP;
|
op:=A_CMP;
|
||||||
lten,gten:
|
lten,gten:
|
||||||
begin
|
begin
|
||||||
if (not(nf_swaped in flags) and (nodetype = lten)) or
|
if (not(nf_swapped in flags) and (nodetype = lten)) or
|
||||||
((nf_swaped in flags) and (nodetype = gten)) then
|
((nf_swapped in flags) and (nodetype = gten)) then
|
||||||
swapleftright;
|
swapleftright;
|
||||||
location_force_reg(current_asmdata.CurrAsmList,left.location,opsize,true);
|
location_force_reg(current_asmdata.CurrAsmList,left.location,opsize,true);
|
||||||
emit_op_right_left(A_AND,opsize);
|
emit_op_right_left(A_AND,opsize);
|
||||||
@ -528,7 +528,7 @@ unit nx86add;
|
|||||||
if (right.location.loc=LOC_MMXREGISTER) then
|
if (right.location.loc=LOC_MMXREGISTER) then
|
||||||
begin
|
begin
|
||||||
location_swap(left.location,right.location);
|
location_swap(left.location,right.location);
|
||||||
toggleflag(nf_swaped);
|
toggleflag(nf_swapped);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -555,7 +555,7 @@ unit nx86add;
|
|||||||
{ at this point, left.location.loc should be LOC_MMXREGISTER }
|
{ at this point, left.location.loc should be LOC_MMXREGISTER }
|
||||||
if right.location.loc<>LOC_MMXREGISTER then
|
if right.location.loc<>LOC_MMXREGISTER then
|
||||||
begin
|
begin
|
||||||
if (nodetype=subn) and (nf_swaped in flags) then
|
if (nodetype=subn) and (nf_swapped in flags) then
|
||||||
begin
|
begin
|
||||||
hreg:=tcgx86(cg).getmmxregister(current_asmdata.CurrAsmList);
|
hreg:=tcgx86(cg).getmmxregister(current_asmdata.CurrAsmList);
|
||||||
if right.location.loc=LOC_CMMXREGISTER then
|
if right.location.loc=LOC_CMMXREGISTER then
|
||||||
@ -588,11 +588,11 @@ unit nx86add;
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{ right.location=LOC_MMXREGISTER }
|
{ right.location=LOC_MMXREGISTER }
|
||||||
if (nodetype=subn) and (nf_swaped in flags) then
|
if (nodetype=subn) and (nf_swapped in flags) then
|
||||||
begin
|
begin
|
||||||
emit_reg_reg(op,S_NO,left.location.register,right.location.register);
|
emit_reg_reg(op,S_NO,left.location.register,right.location.register);
|
||||||
location_swap(left.location,right.location);
|
location_swap(left.location,right.location);
|
||||||
toggleflag(nf_swaped);
|
toggleflag(nf_swapped);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -632,7 +632,7 @@ unit nx86add;
|
|||||||
if right.nodetype=setelementn then
|
if right.nodetype=setelementn then
|
||||||
begin
|
begin
|
||||||
{ adding elements is not commutative }
|
{ adding elements is not commutative }
|
||||||
{ if nf_swaped in flags then
|
{ if nf_swapped in flags then
|
||||||
swapleftright;}
|
swapleftright;}
|
||||||
{ bts requires both elements to be registers }
|
{ bts requires both elements to be registers }
|
||||||
{ location_force_reg(current_asmdata.CurrAsmList,left.location,opsize_2_cgsize[opsize],false);
|
{ location_force_reg(current_asmdata.CurrAsmList,left.location,opsize_2_cgsize[opsize],false);
|
||||||
@ -657,8 +657,8 @@ unit nx86add;
|
|||||||
end;
|
end;
|
||||||
lten,gten:
|
lten,gten:
|
||||||
begin
|
begin
|
||||||
if (not(nf_swaped in flags) and (nodetype = lten)) or
|
if (not(nf_swapped in flags) and (nodetype = lten)) or
|
||||||
((nf_swaped in flags) and (nodetype = gten)) then
|
((nf_swapped in flags) and (nodetype = gten)) then
|
||||||
swapleftright;
|
swapleftright;
|
||||||
location_force_reg(current_asmdata.CurrAsmList,left.location,opsize,true);
|
location_force_reg(current_asmdata.CurrAsmList,left.location,opsize,true);
|
||||||
emit_op_right_left(A_AND,opsize);
|
emit_op_right_left(A_AND,opsize);
|
||||||
@ -696,7 +696,7 @@ unit nx86add;
|
|||||||
op : topcg;
|
op : topcg;
|
||||||
begin
|
begin
|
||||||
pass_left_right;
|
pass_left_right;
|
||||||
if (nf_swaped in flags) then
|
if (nf_swapped in flags) then
|
||||||
swapleftright;
|
swapleftright;
|
||||||
|
|
||||||
case nodetype of
|
case nodetype of
|
||||||
@ -728,7 +728,7 @@ unit nx86add;
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
if (nf_swaped in flags) then
|
if (nf_swapped in flags) then
|
||||||
swapleftright;
|
swapleftright;
|
||||||
|
|
||||||
location_force_mmregscalar(current_asmdata.CurrAsmList,left.location,false);
|
location_force_mmregscalar(current_asmdata.CurrAsmList,left.location,false);
|
||||||
@ -779,10 +779,10 @@ unit nx86add;
|
|||||||
else
|
else
|
||||||
internalerror(200402221);
|
internalerror(200402221);
|
||||||
end;
|
end;
|
||||||
if nf_swaped in flags then
|
if nf_swapped in flags then
|
||||||
exclude(flags,nf_swaped)
|
exclude(flags,nf_swapped)
|
||||||
else
|
else
|
||||||
include(flags,nf_swaped)
|
include(flags,nf_swapped)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -815,7 +815,7 @@ unit nx86add;
|
|||||||
op : topcg;
|
op : topcg;
|
||||||
begin
|
begin
|
||||||
pass_left_right;
|
pass_left_right;
|
||||||
if (nf_swaped in flags) then
|
if (nf_swapped in flags) then
|
||||||
swapleftright;
|
swapleftright;
|
||||||
|
|
||||||
case nodetype of
|
case nodetype of
|
||||||
@ -884,7 +884,7 @@ unit nx86add;
|
|||||||
left_and_right_must_be_fpureg;
|
left_and_right_must_be_fpureg;
|
||||||
|
|
||||||
{ if we swaped the tree nodes, then use the reverse operator }
|
{ if we swaped the tree nodes, then use the reverse operator }
|
||||||
if nf_swaped in flags then
|
if nf_swapped in flags then
|
||||||
begin
|
begin
|
||||||
if (nodetype=slashn) then
|
if (nodetype=slashn) then
|
||||||
op:=A_FDIVRP
|
op:=A_FDIVRP
|
||||||
@ -925,7 +925,7 @@ unit nx86add;
|
|||||||
emit_reg(A_FNSTSW,S_NO,NR_AX);
|
emit_reg(A_FNSTSW,S_NO,NR_AX);
|
||||||
emit_none(A_SAHF,S_NO);
|
emit_none(A_SAHF,S_NO);
|
||||||
cg.ungetcpuregister(current_asmdata.CurrAsmList,NR_AX);
|
cg.ungetcpuregister(current_asmdata.CurrAsmList,NR_AX);
|
||||||
if nf_swaped in flags then
|
if nf_swapped in flags then
|
||||||
begin
|
begin
|
||||||
case nodetype of
|
case nodetype of
|
||||||
equaln : resflags:=F_E;
|
equaln : resflags:=F_E;
|
||||||
@ -958,7 +958,7 @@ unit nx86add;
|
|||||||
tcgx86(cg).dec_fpu_stack;
|
tcgx86(cg).dec_fpu_stack;
|
||||||
|
|
||||||
{ load fpu flags }
|
{ load fpu flags }
|
||||||
if nf_swaped in flags then
|
if nf_swapped in flags then
|
||||||
begin
|
begin
|
||||||
case nodetype of
|
case nodetype of
|
||||||
equaln : resflags:=F_E;
|
equaln : resflags:=F_E;
|
||||||
|
@ -186,7 +186,7 @@ implementation
|
|||||||
exit;
|
exit;
|
||||||
|
|
||||||
{ ofcourse not commutative }
|
{ ofcourse not commutative }
|
||||||
if nf_swaped in flags then
|
if nf_swapped in flags then
|
||||||
swapleftright;
|
swapleftright;
|
||||||
|
|
||||||
if not(left.location.loc in [LOC_REGISTER,LOC_CREGISTER,LOC_REFERENCE,LOC_CREFERENCE]) then
|
if not(left.location.loc in [LOC_REGISTER,LOC_CREGISTER,LOC_REFERENCE,LOC_CREFERENCE]) then
|
||||||
|
Loading…
Reference in New Issue
Block a user