mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-26 02:12:50 +02:00
* do not allocate an extra register for some integer operations if not needed
git-svn-id: trunk@43412 -
This commit is contained in:
parent
b0ac0ddcc9
commit
c8f746b881
@ -1664,7 +1664,8 @@ implementation
|
|||||||
LOC_MMREGISTER,LOC_CMMREGISTER:
|
LOC_MMREGISTER,LOC_CMMREGISTER:
|
||||||
a_loadmm_reg_intreg(list,loc.size,tosize,loc.register,reg,mms_movescalar);
|
a_loadmm_reg_intreg(list,loc.size,tosize,loc.register,reg,mms_movescalar);
|
||||||
else
|
else
|
||||||
internalerror(200109092);
|
begin writeln(loc.loc);
|
||||||
|
internalerror(200109092); end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -245,8 +245,8 @@ unit nx86add;
|
|||||||
{ maybe we can reuse a constant register when the
|
{ maybe we can reuse a constant register when the
|
||||||
operation is a comparison that doesn't change the
|
operation is a comparison that doesn't change the
|
||||||
value of the register }
|
value of the register }
|
||||||
hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,opdef,(nodetype in [ltn,lten,gtn,gten,equaln,unequaln]));
|
hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,opdef,(nodetype in [ltn,lten,gtn,gten,equaln,unequaln]));
|
||||||
location:=left.location;
|
location:=left.location;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -1474,8 +1474,9 @@ unit nx86add;
|
|||||||
|
|
||||||
pass_left_right;
|
pass_left_right;
|
||||||
|
|
||||||
{ do have to allocate a register? If yes, then three opcode instructions are better }
|
{ do have to allocate a register? If yes, then three opcode instructions are better, however for sub three op code instructions
|
||||||
if ((left.location.loc<>LOC_REGISTER) and (right.location.loc<>LOC_REGISTER)) or
|
make no sense if right is a reference }
|
||||||
|
if ((left.location.loc<>LOC_REGISTER) and (right.location.loc<>LOC_REGISTER) and ((nodetype<>subn) or not(right.location.loc in [LOC_REFERENCE,LOC_CREFERENCE]))) or
|
||||||
((nodetype=addn) and (left.location.loc in [LOC_REGISTER,LOC_CREGISTER,LOC_CONSTANT]) and (right.location.loc in [LOC_REGISTER,LOC_CREGISTER,LOC_CONSTANT])) then
|
((nodetype=addn) and (left.location.loc in [LOC_REGISTER,LOC_CREGISTER,LOC_CONSTANT]) and (right.location.loc in [LOC_REGISTER,LOC_CREGISTER,LOC_CONSTANT])) then
|
||||||
begin
|
begin
|
||||||
{ allocate registers }
|
{ allocate registers }
|
||||||
@ -1524,12 +1525,10 @@ unit nx86add;
|
|||||||
begin
|
begin
|
||||||
if right.location.loc<>LOC_REGISTER then
|
if right.location.loc<>LOC_REGISTER then
|
||||||
begin
|
begin
|
||||||
{ tmpreg:=cg.getintregister(current_asmdata.CurrAsmList,opsize);
|
tmpreg:=cg.getintregister(current_asmdata.CurrAsmList,opsize);
|
||||||
cg.a_load_loc_reg(current_asmdata.CurrAsmList,opsize,left.location,tmpreg);
|
cg.a_load_loc_reg(current_asmdata.CurrAsmList,opsize,left.location,tmpreg);
|
||||||
location_reset(left.location,LOC_REGISTER,opsize);
|
location_reset(left.location,LOC_REGISTER,opsize);
|
||||||
left.location.register:=tmpreg;
|
left.location.register:=tmpreg;
|
||||||
}
|
|
||||||
Internalerror(2018031102);
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user