* fixed ARM stackframe optimization when float registers are used.

git-svn-id: trunk@8032 -
This commit is contained in:
yury 2007-07-12 21:55:34 +00:00
parent 1cc1d4ebf2
commit bd0cafd545
3 changed files with 9 additions and 10 deletions

View File

@ -1304,15 +1304,15 @@ unit cgcpu;
if firstfloatreg<>RS_NO then
begin
reference_reset(ref);
if tarmprocinfo(current_procinfo).floatregstart<=-1023 then
if tg.direction*tarmprocinfo(current_procinfo).floatregstart>=1023 then
begin
a_load_const_reg(list,OS_ADDR,-tarmprocinfo(current_procinfo).floatregstart,NR_R12);
list.concat(taicpu.op_reg_reg_reg(A_SUB,NR_R12,NR_FRAME_POINTER_REG,NR_R12));
list.concat(taicpu.op_reg_reg_reg(A_SUB,NR_R12,current_procinfo.framepointer,NR_R12));
ref.base:=NR_R12;
end
else
begin
ref.base:=NR_FRAME_POINTER_REG;
ref.base:=current_procinfo.framepointer;
ref.offset:=tarmprocinfo(current_procinfo).floatregstart;
end;
list.concat(taicpu.op_reg_const_ref(A_SFM,newreg(R_FPUREGISTER,firstfloatreg,R_SUBWHOLE),
@ -1347,15 +1347,15 @@ unit cgcpu;
if firstfloatreg<>RS_NO then
begin
reference_reset(ref);
if tarmprocinfo(current_procinfo).floatregstart<=-1023 then
if tg.direction*tarmprocinfo(current_procinfo).floatregstart>=1023 then
begin
a_load_const_reg(list,OS_ADDR,-tarmprocinfo(current_procinfo).floatregstart,NR_R12);
list.concat(taicpu.op_reg_reg_reg(A_SUB,NR_R12,NR_FRAME_POINTER_REG,NR_R12));
list.concat(taicpu.op_reg_reg_reg(A_SUB,NR_R12,current_procinfo.framepointer,NR_R12));
ref.base:=NR_R12;
end
else
begin
ref.base:=NR_FRAME_POINTER_REG;
ref.base:=current_procinfo.framepointer;
ref.offset:=tarmprocinfo(current_procinfo).floatregstart;
end;
list.concat(taicpu.op_reg_const_ref(A_LFM,newreg(R_FPUREGISTER,firstfloatreg,R_SUBWHOLE),

View File

@ -91,7 +91,9 @@ unit cpupi;
floatsavesize:=0;
floatsavesize:=align(floatsavesize,max(current_settings.alignment.localalignmin,4));
result:=Align(tg.direction*tg.lasttemp,max(current_settings.alignment.localalignmin,4))+maxpushedparasize+floatsavesize;
floatregstart:=-result+maxpushedparasize;
floatregstart:=tg.direction*result+maxpushedparasize;
if tg.direction=1 then
dec(floatregstart,floatsavesize);
end;

View File

@ -846,9 +846,6 @@ implementation
((flags*[pi_has_assembler_block,pi_uses_exceptions,pi_is_assembler,
pi_needs_implicit_finally,pi_has_implicit_finally,pi_has_stackparameter,
pi_needs_stackframe])=[])
{$ifdef arm}
and ((cs_fp_emulation in current_settings.moduleswitches) or not (pi_uses_fpu in flags))
{$endif arm}
)
then
begin