mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 16:49:20 +02:00
* Xtensa: fixed TCPUAddNode.second_cmpsmallset
git-svn-id: trunk@46678 -
This commit is contained in:
parent
beac71ed24
commit
03a0e6e82f
@ -101,14 +101,19 @@ interface
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TCPUAddNode.second_cmpsmallset;
|
procedure TCPUAddNode.second_cmpsmallset;
|
||||||
var
|
var
|
||||||
tmpreg : tregister;
|
tmpreg : tregister;
|
||||||
cond: TOpCmp;
|
|
||||||
instr: taicpu;
|
|
||||||
truelab, falselab: TAsmLabel;
|
truelab, falselab: TAsmLabel;
|
||||||
begin
|
begin
|
||||||
pass_left_right;
|
pass_left_right;
|
||||||
|
|
||||||
|
if (not(nf_swapped in flags) and
|
||||||
|
(nodetype = lten)) or
|
||||||
|
((nf_swapped in flags) and
|
||||||
|
(nodetype = gten)) then
|
||||||
|
swapleftright;
|
||||||
|
|
||||||
current_asmdata.getjumplabel(truelab);
|
current_asmdata.getjumplabel(truelab);
|
||||||
current_asmdata.getjumplabel(falselab);
|
current_asmdata.getjumplabel(falselab);
|
||||||
|
|
||||||
@ -116,18 +121,27 @@ interface
|
|||||||
force_reg_left_right(false,false);
|
force_reg_left_right(false,false);
|
||||||
|
|
||||||
case nodetype of
|
case nodetype of
|
||||||
equaln: cond:=OC_EQ;
|
equaln:
|
||||||
unequaln: cond:=OC_NE;
|
begin
|
||||||
ltn: cond:=OC_LT;
|
cg.a_cmp_reg_reg_label(current_asmdata.CurrAsmList,OS_INT,OC_EQ,left.location.register,right.location.register,location.truelabel);
|
||||||
lten: cond:=OC_LT;
|
cg.a_jmp_always(current_asmdata.CurrAsmList,location.falselabel);
|
||||||
gtn: cond:=OC_GT;
|
end;
|
||||||
gten: cond:=OC_GTE;
|
unequaln:
|
||||||
else
|
begin
|
||||||
internalerror(2020030801);
|
cg.a_cmp_reg_reg_label(current_asmdata.CurrAsmList,OS_INT,OC_NE,left.location.register,right.location.register,location.truelabel);
|
||||||
|
cg.a_jmp_always(current_asmdata.CurrAsmList,location.falselabel);
|
||||||
|
end;
|
||||||
|
lten,
|
||||||
|
gten:
|
||||||
|
begin
|
||||||
|
tmpreg:=cg.getintregister(current_asmdata.CurrAsmList,location.size);
|
||||||
|
cg.a_op_reg_reg_reg(current_asmdata.CurrAsmList,OP_AND,OS_32,left.location.register,right.location.register,tmpreg);
|
||||||
|
cg.a_cmp_reg_reg_label(current_asmdata.CurrAsmList,OS_INT,OC_EQ,tmpreg,right.location.register,location.truelabel);
|
||||||
|
cg.a_jmp_always(current_asmdata.CurrAsmList,location.falselabel);
|
||||||
|
end;
|
||||||
|
else
|
||||||
|
internalerror(2020082401);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
cg.a_cmp_reg_reg_label(current_asmdata.CurrAsmList,OS_INT,cond,left.location.register,right.location.register,location.truelabel);
|
|
||||||
cg.a_jmp_always(current_asmdata.CurrAsmList,location.falselabel);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user