Commit e63ffc38 by Jeff Law

lib2funcs.asm (__outline_prologue): Remove frame pointer support.

        * lib2funcs.asm (__outline_prologue): Remove frame pointer
        support.
        (__outline_prologue_fp): Out of line prologue with frame pointer.
        (__outline_epilogue, outline_epilogue_fp): Similarly.
        * pa.c (compute_frame_size): Allocate enough space to avoid holes
        in the callee register saves.  Remove some special handling of %r3.
        (hppa_expand_prologue): Don't do an out of line prologue/epilogue
        if it would take more insns than an inline prologue/epilogue.
        Don't leave holes in the callee register save set.
        (hppa_expand_prologue): Corresponding changes.  Pass stack size
        to out of line epilogue code.
        * pa.h (FRAME_POINTER_REQUIRED): Revert last change.
        * pa.md (outline_prologue_call): Handle outline prologues which
        don't need frame pointers.
        (outline_epilogue_call): Similarly.
        * t-pro: Reenable multilib code.  Build a set of libraries that
        optimize for space.

From-SVN: r11483
parent e4080ae4
; Subroutines for calling unbound dynamic functions from within GDB for HPPA. ; Subroutines for calling unbound dynamic functions from within GDB for HPPA.
; Copyright (C) 1994, 1995 Free Software Foundation, Inc. ; Subroutines for out of line prologues and epilogues on for the HPPA
; Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
; This file is part of GNU CC. ; This file is part of GNU CC.
...@@ -75,7 +76,7 @@ L$foo ...@@ -75,7 +76,7 @@ L$foo
; ;
; * Creates a new stack frame (sp'), size of the frame is passed in %r21 ; * Creates a new stack frame (sp'), size of the frame is passed in %r21
; ;
; * The old stack pointer is saved at sp ; * The old stack pointer is saved at sp (frame pointer version only).
; ;
; * Saves grs (passed in low 16 bits of %r22 into the stack frame ; * Saves grs (passed in low 16 bits of %r22 into the stack frame
; at sp' + local_fsize (passed in %r19). ; at sp' + local_fsize (passed in %r19).
...@@ -83,7 +84,7 @@ L$foo ...@@ -83,7 +84,7 @@ L$foo
; * Saves frs (passed in high 16 bits of %r22) into the stack ; * Saves frs (passed in high 16 bits of %r22) into the stack
; frame at sp' + local_fsize (passed in %r19). ; frame at sp' + local_fsize (passed in %r19).
; ;
; * Sets up a frame pointer (in %r3). ; * Sets up a frame pointer (in %r3) (frame pointer version only).
; ;
; * Returns to the instruction _immediately_ after the call to ; * Returns to the instruction _immediately_ after the call to
; this function. ; this function.
...@@ -107,9 +108,6 @@ __outline_prologue ...@@ -107,9 +108,6 @@ __outline_prologue
; Make our new frame. ; Make our new frame.
add %r21,%r30,%r30 add %r21,%r30,%r30
; Save our old stack pointer.
stw %r20,0(0,%r20)
; Add in local_fsize to our frame pointer so we do register ; Add in local_fsize to our frame pointer so we do register
; saves into the right place ; saves into the right place
add %r20,%r19,%r20 add %r20,%r19,%r20
...@@ -192,13 +190,124 @@ L$0000 ...@@ -192,13 +190,124 @@ L$0000
fstws,ma %fr12,8(0,%r20) fstws,ma %fr12,8(0,%r20)
nop nop
L$0001 L$0001
; Return
bv,n 0(%r31)
.EXIT
.PROCEND
.align 32
.NSUBSPA $MILLICODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY
.EXPORT __outline_prologue_fp,MILLICODE
__outline_prologue_fp
.PROC
.CALLINFO FRAME=0,NO_CALLS
.ENTRY
copy %r30,%r20
; Subtract 4 from our return pointer so that we return to
; the right location.
ldo -4(%r31),%r31
; Save off %r2
stw %r2,-20(0,%r30)
; Make our new frame.
add %r21,%r30,%r30
; Save our old stack pointer.
stw %r20,0(0,%r20)
; Add in local_fsize to our frame pointer so we do register
; saves into the right place
add %r20,%r19,%r20
; %r22 tells us what registers we need to save. The upper half
; is for fp registers, the lower half for integer registers.
; We put the lower half in %r1 and the upper half into %r22
; for later use.
extru %r22,31,16,%r1
extrs %r22,15,16,%r22
; %r1 now olds a value 0-18 which corresponds to the number
; of grs we need to save. We need to reverse that value so
; we can just into the table and straight-line execute to the
; end of the gr saves.
comb,= %r0,%r1,L$0002
subi 18,%r1,%r1
blr,n %r1,%r0
b,n L$0002
stws,ma %r18,4(0,%r20)
nop
stws,ma %r17,4(0,%r20)
nop
stws,ma %r16,4(0,%r20)
nop
stws,ma %r15,4(0,%r20)
nop
stws,ma %r14,4(0,%r20)
nop
stws,ma %r13,4(0,%r20)
nop
stws,ma %r12,4(0,%r20)
nop
stws,ma %r11,4(0,%r20)
nop
stws,ma %r10,4(0,%r20)
nop
stws,ma %r9,4(0,%r20)
nop
stws,ma %r8,4(0,%r20)
nop
stws,ma %r7,4(0,%r20)
nop
stws,ma %r6,4(0,%r20)
nop
stws,ma %r5,4(0,%r20)
nop
stws,ma %r4,4(0,%r20)
nop
stws,ma %r3,4(0,%r20)
nop
L$0002
; All gr saves are done. Align the temporary frame pointer and
; do the fr saves.
ldo 7(%r20),%r20
depi 0,31,3,%r20
comb,= %r0,%r22,L$0003
subi 21,%r22,%r22
blr,n %r22,%r0
b,n L$0003
fstws,ma %fr21,8(0,%r20)
nop
fstws,ma %fr20,8(0,%r20)
nop
fstws,ma %fr19,8(0,%r20)
nop
fstws,ma %fr18,8(0,%r20)
nop
fstws,ma %fr17,8(0,%r20)
nop
fstws,ma %fr16,8(0,%r20)
nop
fstws,ma %fr15,8(0,%r20)
nop
fstws,ma %fr14,8(0,%r20)
nop
fstws,ma %fr13,8(0,%r20)
nop
fstws,ma %fr12,8(0,%r20)
nop
L$0003
; Return, setting up a frame pointer in the delay slot ; Return, setting up a frame pointer in the delay slot
bv 0(%r31) bv 0(%r31)
sub %r30,%r21,%r3 sub %r30,%r21,%r3
.EXIT .EXIT
.PROCEND .PROCEND
; This is an out-of-line epilogue. It's operation is basically the reverse ; This is an out-of-line epilogue. It's operation is basically the reverse
; of the out-of-line prologue. ; of the out-of-line prologue.
...@@ -209,6 +318,114 @@ __outline_epilogue ...@@ -209,6 +318,114 @@ __outline_epilogue
.PROC .PROC
.CALLINFO FRAME=0,NO_CALLS .CALLINFO FRAME=0,NO_CALLS
.ENTRY .ENTRY
; Get our original stack pointer and put it in %r20
sub %r30,%r21,%r20
; Subtract 4 from our return pointer so that we return to
; the right location.
ldo -4(%r31),%r31
; Reload %r2
ldw -20(0,%r20),%r2
; Add in local_fsize (%r19) to the frame pointer to find
; the saved registers.
add %r20,%r19,%r20
; %r22 tells us what registers we need to restore. The upper half
; is for fp registers, the lower half for integer registers.
; We put the lower half in %r1 and the upper half into %r22
; for later use.
extru %r22,31,16,%r1
extrs %r22,15,16,%r22
; %r1 now olds a value 0-18 which corresponds to the number
; of grs we need to restore. We need to reverse that value so
; we can just into the table and straight-line execute to the
; end of the gr restore.
comb,= %r0,%r1,L$0004
subi 18,%r1,%r1
blr,n %r1,%r0
b,n L$0004
ldws,ma 4(0,%r20),%r18
nop
ldws,ma 4(0,%r20),%r17
nop
ldws,ma 4(0,%r20),%r16
nop
ldws,ma 4(0,%r20),%r15
nop
ldws,ma 4(0,%r20),%r14
nop
ldws,ma 4(0,%r20),%r13
nop
ldws,ma 4(0,%r20),%r12
nop
ldws,ma 4(0,%r20),%r11
nop
ldws,ma 4(0,%r20),%r10
nop
ldws,ma 4(0,%r20),%r9
nop
ldws,ma 4(0,%r20),%r8
nop
ldws,ma 4(0,%r20),%r7
nop
ldws,ma 4(0,%r20),%r6
nop
ldws,ma 4(0,%r20),%r5
nop
ldws,ma 4(0,%r20),%r4
nop
ldws,ma 4(0,%r20),%r3
nop
L$0004
; All gr restore are done. Align the temporary frame pointer and
; do the fr restore.
ldo 7(%r20),%r20
depi 0,31,3,%r20
comb,= %r0,%r22,L$0005
subi 21,%r22,%r22
blr,n %r22,%r0
b,n L$0005
fldws,ma 8(0,%r20),%fr21
nop
fldws,ma 8(0,%r20),%fr20
nop
fldws,ma 8(0,%r20),%fr19
nop
fldws,ma 8(0,%r20),%fr18
nop
fldws,ma 8(0,%r20),%fr17
nop
fldws,ma 8(0,%r20),%fr16
nop
fldws,ma 8(0,%r20),%fr15
nop
fldws,ma 8(0,%r20),%fr14
nop
fldws,ma 8(0,%r20),%fr13
nop
fldws,ma 8(0,%r20),%fr12
nop
L$0005
; Return and deallocate our frame.
bv 0(%r31)
sub %r30,%r21,%r30
.EXIT
.PROCEND
; This is an out-of-line epilogue. It's operation is basically the reverse
; of the out-of-line prologue.
.align 32
.NSUBSPA $MILLICODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY
.EXPORT __outline_epilogue_fp,MILLICODE
__outline_epilogue_fp
.PROC
.CALLINFO FRAME=0,NO_CALLS
.ENTRY
; Make a copy of our frame pointer into %r20 ; Make a copy of our frame pointer into %r20
copy %r3,%r20 copy %r3,%r20
...@@ -238,10 +455,10 @@ __outline_epilogue ...@@ -238,10 +455,10 @@ __outline_epilogue
; of grs we need to restore. We need to reverse that value so ; of grs we need to restore. We need to reverse that value so
; we can just into the table and straight-line execute to the ; we can just into the table and straight-line execute to the
; end of the gr restore. ; end of the gr restore.
comb,= %r0,%r1,L$0002 comb,= %r0,%r1,L$0006
subi 18,%r1,%r1 subi 18,%r1,%r1
blr,n %r1,%r0 blr,n %r1,%r0
b,n L$0002 b,n L$0006
ldws,ma 4(0,%r20),%r18 ldws,ma 4(0,%r20),%r18
nop nop
ldws,ma 4(0,%r20),%r17 ldws,ma 4(0,%r20),%r17
...@@ -274,16 +491,16 @@ __outline_epilogue ...@@ -274,16 +491,16 @@ __outline_epilogue
nop nop
ldws,ma 4(0,%r20),%r3 ldws,ma 4(0,%r20),%r3
nop nop
L$0002 L$0006
; All gr restore are done. Align the temporary frame pointer and ; All gr restore are done. Align the temporary frame pointer and
; do the fr restore. ; do the fr restore.
ldo 7(%r20),%r20 ldo 7(%r20),%r20
depi 0,31,3,%r20 depi 0,31,3,%r20
comb,= %r0,%r22,L$0003 comb,= %r0,%r22,L$0007
subi 21,%r22,%r22 subi 21,%r22,%r22
blr,n %r22,%r0 blr,n %r22,%r0
b,n L$0003 b,n L$0007
fldws,ma 8(0,%r20),%fr21 fldws,ma 8(0,%r20),%fr21
nop nop
fldws,ma 8(0,%r20),%fr20 fldws,ma 8(0,%r20),%fr20
...@@ -304,10 +521,11 @@ L$0002 ...@@ -304,10 +521,11 @@ L$0002
nop nop
fldws,ma 8(0,%r20),%fr12 fldws,ma 8(0,%r20),%fr12
nop nop
L$0003 L$0007
; Return and deallocate our frame. ; Return and deallocate our frame.
bv 0(%r31) bv 0(%r31)
copy %r21,%r30 copy %r21,%r30
.EXIT .EXIT
.PROCEND .PROCEND
...@@ -560,11 +560,9 @@ do { \ ...@@ -560,11 +560,9 @@ do { \
/* Base register for access to local variables of the function. */ /* Base register for access to local variables of the function. */
#define FRAME_POINTER_REGNUM 3 #define FRAME_POINTER_REGNUM 3
/* Value should be nonzero if functions must have frame pointers. /* Value should be nonzero if functions must have frame pointers. */
All functions have frame pointers when optimizing for space
(for now). */
#define FRAME_POINTER_REQUIRED \ #define FRAME_POINTER_REQUIRED \
(current_function_calls_alloca || TARGET_SPACE) (current_function_calls_alloca)
/* C statement to store the difference between the frame pointer /* C statement to store the difference between the frame pointer
and the stack pointer values immediately after the function prologue. and the stack pointer values immediately after the function prologue.
......
;;- Machine description for HP PA-RISC architecture for GNU C compiler ;;- Machine description for HP PA-RISC architecture for GNU C compiler
;; Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc. ;; Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
;; Contributed by the Center for Software Science at the University ;; Contributed by the Center for Software Science at the University
;; of Utah. ;; of Utah.
...@@ -4850,18 +4850,39 @@ ...@@ -4850,18 +4850,39 @@
"" ""
"* "*
{ {
/* Must import the magic millicode routine. */ extern int frame_pointer_needed;
output_asm_insn (\".IMPORT __outline_prologue,MILLICODE\", NULL);
/* The out-of-line prologue will make sure we return to the right /* We need two different versions depending on whether or not we
instruction. */ need a frame pointer. Also note that we return to the instruction
if (TARGET_PORTABLE_RUNTIME) immediately after the branch rather than two instructions after the
break as normally is the case. */
if (frame_pointer_needed)
{ {
output_asm_insn (\"ldil L'__outline_prologue,%%r31\", NULL); /* Must import the magic millicode routine(s). */
output_asm_insn (\"ble,n R'__outline_prologue(%%sr0,%%r31)\", NULL); output_asm_insn (\".IMPORT __outline_prologue_fp,MILLICODE\", NULL);
if (TARGET_PORTABLE_RUNTIME)
{
output_asm_insn (\"ldil L'__outline_prologue_fp,%%r31\", NULL);
output_asm_insn (\"ble,n R'__outline_prologue_fp(%%sr0,%%r31)\",
NULL);
}
else
output_asm_insn (\"bl,n __outline_prologue_fp,%%r31\", NULL);
} }
else else
output_asm_insn (\"bl,n __outline_prologue,%%r31\", NULL); {
/* Must import the magic millicode routine(s). */
output_asm_insn (\".IMPORT __outline_prologue,MILLICODE\", NULL);
if (TARGET_PORTABLE_RUNTIME)
{
output_asm_insn (\"ldil L'__outline_prologue,%%r31\", NULL);
output_asm_insn (\"ble,n R'__outline_prologue(%%sr0,%%r31)\", NULL);
}
else
output_asm_insn (\"bl,n __outline_prologue,%%r31\", NULL);
}
return \"\"; return \"\";
}" }"
[(set_attr "type" "multi") [(set_attr "type" "multi")
...@@ -4882,18 +4903,43 @@ ...@@ -4882,18 +4903,43 @@
"" ""
"* "*
{ {
/* Must import the magic millicode routine. */ extern int frame_pointer_needed;
output_asm_insn (\".IMPORT __outline_epilogue,MILLICODE\", NULL);
/* The out-of-line prologue will make sure we return to the right /* We need two different versions depending on whether or not we
instruction. */ need a frame pointer. Also note that we return to the instruction
if (TARGET_PORTABLE_RUNTIME) immediately after the branch rather than two instructions after the
break as normally is the case. */
if (frame_pointer_needed)
{ {
output_asm_insn (\"ldil L'__outline_epilogue,%%r31\", NULL); /* Must import the magic millicode routine. */
output_asm_insn (\"ble,n R'__outline_epilogue(%%sr0,%%r31)\", NULL); output_asm_insn (\".IMPORT __outline_epilogue_fp,MILLICODE\", NULL);
/* The out-of-line prologue will make sure we return to the right
instruction. */
if (TARGET_PORTABLE_RUNTIME)
{
output_asm_insn (\"ldil L'__outline_epilogue_fp,%%r31\", NULL);
output_asm_insn (\"ble,n R'__outline_epilogue_fp(%%sr0,%%r31)\",
NULL);
}
else
output_asm_insn (\"bl,n __outline_epilogue_fp,%%r31\", NULL);
} }
else else
output_asm_insn (\"bl,n __outline_epilogue,%%r31\", NULL); {
/* Must import the magic millicode routine. */
output_asm_insn (\".IMPORT __outline_epilogue,MILLICODE\", NULL);
/* The out-of-line prologue will make sure we return to the right
instruction. */
if (TARGET_PORTABLE_RUNTIME)
{
output_asm_insn (\"ldil L'__outline_epilogue,%%r31\", NULL);
output_asm_insn (\"ble,n R'__outline_epilogue(%%sr0,%%r31)\", NULL);
}
else
output_asm_insn (\"bl,n __outline_epilogue,%%r31\", NULL);
}
return \"\"; return \"\";
}" }"
[(set_attr "type" "multi") [(set_attr "type" "multi")
......
...@@ -19,3 +19,12 @@ fp-bit.c: $(srcdir)/config/fp-bit.c ...@@ -19,3 +19,12 @@ fp-bit.c: $(srcdir)/config/fp-bit.c
lib2funcs.asm: $(srcdir)/config/pa/lib2funcs.asm lib2funcs.asm: $(srcdir)/config/pa/lib2funcs.asm
rm -f lib2funcs.asm rm -f lib2funcs.asm
cp $(srcdir)/config/pa/lib2funcs.asm . cp $(srcdir)/config/pa/lib2funcs.asm .
# Build the libraries for both speed and space optimizations
MULTILIB_OPTIONS=mspace
MULTILIB_DIRNAMES=space
MULTILIB_MATCHES=
LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment