aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2003-09-25 21:38:43 +0000
committerUlrich Weigand <uweigand@gcc.gnu.org>2003-09-25 21:38:43 +0000
commit7333171fe96ae0487a6a92cd953beb853b30a277 (patch)
tree4f8b5b2b58772ea9abfa06311f3a946b30002cf4 /gcc
parent775ee48ed2474c0bbff42201ef30ab8f14358859 (diff)
downloadgcc-7333171fe96ae0487a6a92cd953beb853b30a277.zip
gcc-7333171fe96ae0487a6a92cd953beb853b30a277.tar.gz
gcc-7333171fe96ae0487a6a92cd953beb853b30a277.tar.bz2
s390.c (s390_emit_prologue): Simplify accesses to FPR slots in the save area.
* config/s390/s390.c (s390_emit_prologue): Simplify accesses to FPR slots in the save area. (s390_emit_epilogue): Likewise. From-SVN: r71799
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/s390/s390.c62
2 files changed, 24 insertions, 44 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index aeb10ca..903c128 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2003-09-25 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.c (s390_emit_prologue): Simplify accesses to
+ FPR slots in the save area.
+ (s390_emit_epilogue): Likewise.
+
2003-09-25 Richard Sandiford <rsandifo@redhat.com>
* cgraph.h (cgraph_remove_edge): Declare.
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 7086d5b..cf68a52 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -5493,37 +5493,18 @@ s390_emit_prologue (void)
/* Save fprs for variable args. */
if (current_function_stdarg)
- {
- /* Save fpr 0 and 2. */
-
- save_fpr (stack_pointer_rtx, STACK_POINTER_OFFSET - 32, 16);
- save_fpr (stack_pointer_rtx, STACK_POINTER_OFFSET - 24, 17);
-
- if (TARGET_64BIT)
- {
- /* Save fpr 4 and 6. */
-
- save_fpr (stack_pointer_rtx, STACK_POINTER_OFFSET - 16, 18);
- save_fpr (stack_pointer_rtx, STACK_POINTER_OFFSET - 8, 19);
- }
- }
+ for (i = 16; i < (TARGET_64BIT ? 20 : 18); i++)
+ save_fpr (stack_pointer_rtx, 16*UNITS_PER_WORD + 8*(i-16), i);
/* Save fprs 4 and 6 if used (31 bit ABI). */
if (!TARGET_64BIT)
- {
- /* Save fpr 4 and 6. */
- if (regs_ever_live[18] && !global_regs[18])
- {
- insn = save_fpr (stack_pointer_rtx, STACK_POINTER_OFFSET - 16, 18);
- RTX_FRAME_RELATED_P (insn) = 1;
- }
- if (regs_ever_live[19] && !global_regs[19])
+ for (i = 18; i < 20; i++)
+ if (regs_ever_live[i] && !global_regs[i])
{
- insn = save_fpr (stack_pointer_rtx, STACK_POINTER_OFFSET - 8, 19);
+ insn = save_fpr (stack_pointer_rtx, 16*UNITS_PER_WORD + 8*(i-16), i);
RTX_FRAME_RELATED_P (insn) = 1;
}
- }
/* Decrement stack pointer. */
@@ -5650,6 +5631,7 @@ s390_emit_epilogue (void)
rtx frame_pointer, return_reg;
int area_bottom, area_top, offset = 0;
rtvec p;
+ int i;
if (TARGET_TPF)
{
@@ -5705,20 +5687,14 @@ s390_emit_epilogue (void)
}
else
{
- if (regs_ever_live[18] && !global_regs[18])
- {
- if (area_bottom > STACK_POINTER_OFFSET - 16)
- area_bottom = STACK_POINTER_OFFSET - 16;
- if (area_top < STACK_POINTER_OFFSET - 8)
- area_top = STACK_POINTER_OFFSET - 8;
- }
- if (regs_ever_live[19] && !global_regs[19])
- {
- if (area_bottom > STACK_POINTER_OFFSET - 8)
- area_bottom = STACK_POINTER_OFFSET - 8;
- if (area_top < STACK_POINTER_OFFSET)
- area_top = STACK_POINTER_OFFSET;
- }
+ for (i = 18; i < 20; i++)
+ if (regs_ever_live[i] && !global_regs[i])
+ {
+ if (area_bottom > 16*UNITS_PER_WORD + 8*(i-16))
+ area_bottom = 16*UNITS_PER_WORD + 8*(i-16);
+ if (area_top < 16*UNITS_PER_WORD + 8*(i-16) + 8)
+ area_top = 16*UNITS_PER_WORD + 8*(i-16) + 8;
+ }
}
/* Check whether we can access the register save area.
@@ -5760,8 +5736,6 @@ s390_emit_epilogue (void)
if (TARGET_64BIT)
{
- int i;
-
if (cfun->machine->save_fprs_p)
for (i = 24; i < 32; i++)
if (regs_ever_live[i] && !global_regs[i])
@@ -5770,10 +5744,10 @@ s390_emit_epilogue (void)
}
else
{
- if (regs_ever_live[18] && !global_regs[18])
- restore_fpr (frame_pointer, offset + STACK_POINTER_OFFSET - 16, 18);
- if (regs_ever_live[19] && !global_regs[19])
- restore_fpr (frame_pointer, offset + STACK_POINTER_OFFSET - 8, 19);
+ for (i = 18; i < 20; i++)
+ if (regs_ever_live[i] && !global_regs[i])
+ restore_fpr (frame_pointer,
+ offset + 16*UNITS_PER_WORD + 8*(i-16), i);
}
/* Return register. */