summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryury <yury@3ad0048d-3df7-0310-abae-a5850022a9f2>2007-07-14 08:49:12 +0000
committeryury <yury@3ad0048d-3df7-0310-abae-a5850022a9f2>2007-07-14 08:49:12 +0000
commit0baf40b9ea3b0327dc30aa13e75d2fbf74ac0572 (patch)
treeeef550e3a24bae9ccbaff6758a881937d2cbe387
parentfb5dc77b1c9586e3f7981841a9eab3158b80fa3b (diff)
downloadfpc-0baf40b9ea3b0327dc30aa13e75d2fbf74ac0572.tar.gz
Merged revisions 8032 via svnmerge from
http://svn.freepascal.org/svn/fpc/trunk ........ r8032 | yury | 2007-07-13 00:55:34 +0300 (Пт, 13 июл 2007) | 1 line * fixed ARM stackframe optimization when float registers are used. ........ git-svn-id: http://svn.freepascal.org/svn/fpc/branches/fixes_2_2@8044 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r--compiler/arm/cgcpu.pas12
-rw-r--r--compiler/arm/cpupi.pas4
-rw-r--r--compiler/psub.pas3
3 files changed, 9 insertions, 10 deletions
diff --git a/compiler/arm/cgcpu.pas b/compiler/arm/cgcpu.pas
index 114a7411a1..72e7b6a87c 100644
--- a/compiler/arm/cgcpu.pas
+++ b/compiler/arm/cgcpu.pas
@@ -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),
diff --git a/compiler/arm/cpupi.pas b/compiler/arm/cpupi.pas
index f8ac1c2240..ef02d5063a 100644
--- a/compiler/arm/cpupi.pas
+++ b/compiler/arm/cpupi.pas
@@ -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;
diff --git a/compiler/psub.pas b/compiler/psub.pas
index 5c64d74b87..e082fa775c 100644
--- a/compiler/psub.pas
+++ b/compiler/psub.pas
@@ -801,9 +801,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