mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 07:09:23 +02:00
* use stmw/lmw when saving/restoring a lot of registers, to reduce generated
code size and thus instruction cache pressure. git-svn-id: trunk@1785 -
This commit is contained in:
parent
715cfa08eb
commit
cc44a19af5
@ -1197,10 +1197,22 @@ const
|
|||||||
if regcounter2 in rg[R_INTREGISTER].used_in_proc then
|
if regcounter2 in rg[R_INTREGISTER].used_in_proc then
|
||||||
begin
|
begin
|
||||||
usesgpr:=true;
|
usesgpr:=true;
|
||||||
|
if (regcounter2 <= RS_R22) or
|
||||||
|
((cs_littlesize in aktglobalswitches) and
|
||||||
|
{ with RS_R30 it's also already smaller, but too big a speed trade-off to make }
|
||||||
|
(regcounter2 <= RS_R29)) then
|
||||||
|
begin
|
||||||
|
dec(href.offset,(RS_R31-regcounter2+1)*sizeof(aint));
|
||||||
|
list.concat(taicpu.op_reg_ref(A_STMW,newreg(R_INTREGISTER,regcounter2,R_SUBNONE),href));
|
||||||
|
break;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
a_load_reg_ref(list,OS_INT,OS_INT,newreg(R_INTREGISTER,regcounter2,R_SUBNONE),href);
|
a_load_reg_ref(list,OS_INT,OS_INT,newreg(R_INTREGISTER,regcounter2,R_SUBNONE),href);
|
||||||
dec(href.offset,4);
|
dec(href.offset,4);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
{
|
{
|
||||||
r.enum:=R_INTREGISTER;
|
r.enum:=R_INTREGISTER;
|
||||||
r.:=;
|
r.:=;
|
||||||
@ -1338,10 +1350,22 @@ const
|
|||||||
if regcounter2 in rg[R_INTREGISTER].used_in_proc then
|
if regcounter2 in rg[R_INTREGISTER].used_in_proc then
|
||||||
begin
|
begin
|
||||||
usesgpr:=true;
|
usesgpr:=true;
|
||||||
|
if (regcounter2 <= RS_R22) or
|
||||||
|
((cs_littlesize in aktglobalswitches) and
|
||||||
|
{ with RS_R30 it's also already smaller, but too big a speed trade-off to make }
|
||||||
|
(regcounter2 <= RS_R29)) then
|
||||||
|
begin
|
||||||
|
dec(href.offset,(RS_R31-regcounter2+1)*sizeof(aint));
|
||||||
|
list.concat(taicpu.op_reg_ref(A_LMW,newreg(R_INTREGISTER,regcounter2,R_SUBNONE),href));
|
||||||
|
break;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
a_load_ref_reg(list,OS_INT,OS_INT,href,newreg(R_INTREGISTER,regcounter2,R_SUBNONE));
|
a_load_ref_reg(list,OS_INT,OS_INT,href,newreg(R_INTREGISTER,regcounter2,R_SUBNONE));
|
||||||
dec(href.offset,4);
|
dec(href.offset,4);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
(*
|
(*
|
||||||
reference_reset_base(href,r2,-((NR_R31-ord(firstreggpr)) shr 8+1)*4);
|
reference_reset_base(href,r2,-((NR_R31-ord(firstreggpr)) shr 8+1)*4);
|
||||||
|
Loading…
Reference in New Issue
Block a user