diff options
author | Michael Meissner <meissner@gcc.gnu.org> | 1995-07-25 14:17:45 +0000 |
---|---|---|
committer | Michael Meissner <meissner@gcc.gnu.org> | 1995-07-25 14:17:45 +0000 |
commit | 5eb387b858bbec655fa5faa258af1e0451ca796e (patch) | |
tree | 9ef079e9848c3afc594121b8934c7771a81251df | |
parent | abeeaf0fe808966cddff734553d23476b800db87 (diff) | |
download | gcc-5eb387b858bbec655fa5faa258af1e0451ca796e.zip gcc-5eb387b858bbec655fa5faa258af1e0451ca796e.tar.gz gcc-5eb387b858bbec655fa5faa258af1e0451ca796e.tar.bz2 |
store LR in caller's frame, not current frame for V.4
From-SVN: r10154
-rw-r--r-- | gcc/config/rs6000/eabi.asm | 325 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 4 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.md | 18 |
3 files changed, 254 insertions, 93 deletions
diff --git a/gcc/config/rs6000/eabi.asm b/gcc/config/rs6000/eabi.asm index 81788a3..38674dd 100644 --- a/gcc/config/rs6000/eabi.asm +++ b/gcc/config/rs6000/eabi.asm @@ -110,91 +110,270 @@ __eabi: mflr 0 # Called with r11 pointing to the stack header word of the caller of the # function, just beyond the end of the floating point save area. - .globl _savefpr_14_l - .globl _savefpr_15_l - .globl _savefpr_16_l - .globl _savefpr_17_l - .globl _savefpr_18_l - .globl _savefpr_19_l - .globl _savefpr_20_l - .globl _savefpr_21_l - .globl _savefpr_22_l - .globl _savefpr_23_l - .globl _savefpr_24_l - .globl _savefpr_25_l - .globl _savefpr_26_l - .globl _savefpr_27_l - .globl _savefpr_28_l - .globl _savefpr_29_l - .globl _savefpr_30_l - .globl _savefpr_31_l + .globl _savefpr_14 + .globl _savefpr_15 + .globl _savefpr_16 + .globl _savefpr_17 + .globl _savefpr_18 + .globl _savefpr_19 + .globl _savefpr_20 + .globl _savefpr_21 + .globl _savefpr_22 + .globl _savefpr_23 + .globl _savefpr_24 + .globl _savefpr_25 + .globl _savefpr_26 + .globl _savefpr_27 + .globl _savefpr_28 + .globl _savefpr_29 + .globl _savefpr_30 + .globl _savefpr_31 .long 0x00400000 # traceback tag -_savefpr_14_l: stfd 14,-144(11) # save fp registers -_savefpr_15_l: stfd 15,-136(11) -_savefpr_16_l: stfd 16,-128(11) -_savefpr_17_l: stfd 17,-120(11) -_savefpr_18_l: stfd 18,-112(11) -_savefpr_19_l: stfd 19,-104(11) -_savefpr_20_l: stfd 20,-96(11) -_savefpr_21_l: stfd 21,-88(11) -_savefpr_22_l: stfd 22,-80(11) -_savefpr_23_l: stfd 23,-72(11) -_savefpr_24_l: stfd 24,-64(11) -_savefpr_25_l: stfd 25,-56(11) -_savefpr_26_l: stfd 26,-48(11) -_savefpr_27_l: stfd 27,-40(11) -_savefpr_28_l: stfd 28,-32(11) -_savefpr_29_l: stfd 29,-24(11) -_savefpr_30_l: stfd 30,-16(11) -_savefpr_31_l: stfd 31,-8(11) - stw 0,4(11) # save return address also +_savefpr_14: stfd 14,-144(11) # save fp registers +_savefpr_15: stfd 15,-136(11) +_savefpr_16: stfd 16,-128(11) +_savefpr_17: stfd 17,-120(11) +_savefpr_18: stfd 18,-112(11) +_savefpr_19: stfd 19,-104(11) +_savefpr_20: stfd 20,-96(11) +_savefpr_21: stfd 21,-88(11) +_savefpr_22: stfd 22,-80(11) +_savefpr_23: stfd 23,-72(11) +_savefpr_24: stfd 24,-64(11) +_savefpr_25: stfd 25,-56(11) +_savefpr_26: stfd 26,-48(11) +_savefpr_27: stfd 27,-40(11) +_savefpr_28: stfd 28,-32(11) +_savefpr_29: stfd 29,-24(11) +_savefpr_30: stfd 30,-16(11) +_savefpr_31: stfd 31,-8(11) blr +# Routines for saving integer registers, called by the compiler. +# Called with r11 pointing to the stack header word of the caller of the +# function, just beyond the end of the integer save area. + + .globl _savegpr_14 + .globl _savegpr_15 + .globl _savegpr_16 + .globl _savegpr_17 + .globl _savegpr_18 + .globl _savegpr_19 + .globl _savegpr_20 + .globl _savegpr_21 + .globl _savegpr_22 + .globl _savegpr_23 + .globl _savegpr_24 + .globl _savegpr_25 + .globl _savegpr_26 + .globl _savegpr_27 + .globl _savegpr_28 + .globl _savegpr_29 + .globl _savegpr_30 + .globl _savegpr_31 + + .long 0x00400000 # traceback tag +_savegpr_14: stw 14,-72(11) # save gp registers +_savegpr_15: stw 15,-68(11) +_savegpr_16: stw 16,-64(11) +_savegpr_17: stw 17,-60(11) +_savegpr_18: stw 18,-56(11) +_savegpr_19: stw 19,-52(11) +_savegpr_20: stw 20,-48(11) +_savegpr_21: stw 21,-44(11) +_savegpr_22: stw 22,-40(11) +_savegpr_23: stw 23,-36(11) +_savegpr_24: stw 24,-32(11) +_savegpr_25: stw 25,-28(11) +_savegpr_26: stw 26,-24(11) +_savegpr_27: stw 27,-20(11) +_savegpr_28: stw 28,-16(11) +_savegpr_29: stw 29,-12(11) +_savegpr_30: stw 30,-8(11) +_savegpr_31: stw 31,-4(11) + blr # Routines for restoring floating point registers, called by the compiler. # Called with r11 pointing to the stack header word of the caller of the # function, just beyond the end of the floating point save area. - .globl _restfpr_14_l - .globl _restfpr_15_l - .globl _restfpr_16_l - .globl _restfpr_17_l - .globl _restfpr_18_l - .globl _restfpr_19_l - .globl _restfpr_20_l - .globl _restfpr_21_l - .globl _restfpr_22_l - .globl _restfpr_23_l - .globl _restfpr_24_l - .globl _restfpr_25_l - .globl _restfpr_26_l - .globl _restfpr_27_l - .globl _restfpr_28_l - .globl _restfpr_29_l - .globl _restfpr_30_l - .globl _restfpr_31_l + .globl _restfpr_14 + .globl _restfpr_15 + .globl _restfpr_16 + .globl _restfpr_17 + .globl _restfpr_18 + .globl _restfpr_19 + .globl _restfpr_20 + .globl _restfpr_21 + .globl _restfpr_22 + .globl _restfpr_23 + .globl _restfpr_24 + .globl _restfpr_25 + .globl _restfpr_26 + .globl _restfpr_27 + .globl _restfpr_28 + .globl _restfpr_29 + .globl _restfpr_30 + .globl _restfpr_31 + + .long 0x00600000 # traceback tag +_restfpr_14: lfd 14,-144(11) # restore fp registers +_restfpr_15: lfd 15,-136(11) +_restfpr_16: lfd 16,-128(11) +_restfpr_17: lfd 17,-120(11) +_restfpr_18: lfd 18,-112(11) +_restfpr_19: lfd 19,-104(11) +_restfpr_20: lfd 20,-96(11) +_restfpr_21: lfd 21,-88(11) +_restfpr_22: lfd 22,-80(11) +_restfpr_23: lfd 23,-72(11) +_restfpr_24: lfd 24,-64(11) +_restfpr_25: lfd 25,-56(11) +_restfpr_26: lfd 26,-48(11) +_restfpr_27: lfd 27,-40(11) +_restfpr_28: lfd 28,-32(11) +_restfpr_29: lfd 29,-24(11) +_restfpr_30: lfd 30,-16(11) +_restfpr_31: lfd 31,-8(11) + blr + +# Routines for restoring integer registers, called by the compiler. +# Called with r11 pointing to the stack header word of the caller of the +# function, just beyond the end of the integer restore area. + + .globl _restgpr_14 + .globl _restgpr_15 + .globl _restgpr_16 + .globl _restgpr_17 + .globl _restgpr_18 + .globl _restgpr_19 + .globl _restgpr_20 + .globl _restgpr_21 + .globl _restgpr_22 + .globl _restgpr_23 + .globl _restgpr_24 + .globl _restgpr_25 + .globl _restgpr_26 + .globl _restgpr_27 + .globl _restgpr_28 + .globl _restgpr_29 + .globl _restgpr_30 + .globl _restgpr_31 .long 0x00600000 # traceback tag -_restfpr_14_l: lfd 14,-144(11) # restore fp registers -_restfpr_15_l: lfd 15,-136(11) -_restfpr_16_l: lfd 16,-128(11) -_restfpr_17_l: lfd 17,-120(11) -_restfpr_18_l: lfd 18,-112(11) -_restfpr_19_l: lfd 19,-104(11) -_restfpr_20_l: lfd 20,-96(11) -_restfpr_21_l: lfd 21,-88(11) -_restfpr_22_l: lfd 22,-80(11) -_restfpr_23_l: lfd 23,-72(11) -_restfpr_24_l: lfd 24,-64(11) -_restfpr_25_l: lfd 25,-56(11) -_restfpr_26_l: lfd 26,-48(11) -_restfpr_27_l: lfd 27,-40(11) -_restfpr_28_l: lfd 28,-32(11) -_restfpr_29_l: lfd 29,-24(11) -_restfpr_30_l: lfd 30,-16(11) -_restfpr_31_l: lwz 0,4(11) # caller's caller address +_restgpr_14: lwz 14,-72(11) # rest gp registers +_restgpr_15: lwz 15,-68(11) +_restgpr_16: lwz 16,-64(11) +_restgpr_17: lwz 17,-60(11) +_restgpr_18: lwz 18,-56(11) +_restgpr_19: lwz 19,-52(11) +_restgpr_20: lwz 20,-48(11) +_restgpr_21: lwz 21,-44(11) +_restgpr_22: lwz 22,-40(11) +_restgpr_23: lwz 23,-36(11) +_restgpr_24: lwz 24,-32(11) +_restgpr_25: lwz 25,-28(11) +_restgpr_26: lwz 26,-24(11) +_restgpr_27: lwz 27,-20(11) +_restgpr_28: lwz 28,-16(11) +_restgpr_29: lwz 29,-12(11) +_restgpr_30: lwz 30,-8(11) +_restgpr_31: lwz 31,-4(11) + blr + +# Routines for restoring floating point registers, called by the compiler. +# Called with r11 pointing to the stack header word of the caller of the +# function, just beyond the end of the floating point save area. +# In addition to restoring the fp registers, it will return to the caller's +# caller + + .globl _restfpr_14_x + .globl _restfpr_15_x + .globl _restfpr_16_x + .globl _restfpr_17_x + .globl _restfpr_18_x + .globl _restfpr_19_x + .globl _restfpr_20_x + .globl _restfpr_21_x + .globl _restfpr_22_x + .globl _restfpr_23_x + .globl _restfpr_24_x + .globl _restfpr_25_x + .globl _restfpr_26_x + .globl _restfpr_27_x + .globl _restfpr_28_x + .globl _restfpr_29_x + .globl _restfpr_30_x + .globl _restfpr_31_x + + .long 0x00600000 # traceback tag +_restfpr_14_x: lfd 14,-144(11) # restore fp registers +_restfpr_15_x: lfd 15,-136(11) +_restfpr_16_x: lfd 16,-128(11) +_restfpr_17_x: lfd 17,-120(11) +_restfpr_18_x: lfd 18,-112(11) +_restfpr_19_x: lfd 19,-104(11) +_restfpr_20_x: lfd 20,-96(11) +_restfpr_21_x: lfd 21,-88(11) +_restfpr_22_x: lfd 22,-80(11) +_restfpr_23_x: lfd 23,-72(11) +_restfpr_24_x: lfd 24,-64(11) +_restfpr_25_x: lfd 25,-56(11) +_restfpr_26_x: lfd 26,-48(11) +_restfpr_27_x: lfd 27,-40(11) +_restfpr_28_x: lfd 28,-32(11) +_restfpr_29_x: lfd 29,-24(11) +_restfpr_30_x: lfd 30,-16(11) +_restfpr_31_x: lwz 0,4(11) lfd 31,-8(11) mtlr 0 mr 1,11 blr + +# Routines for restoring integer registers, called by the compiler. +# Called with r11 pointing to the stack header word of the caller of the +# function, just beyond the end of the integer restore area. + + .globl _restgpr_14_x + .globl _restgpr_15_x + .globl _restgpr_16_x + .globl _restgpr_17_x + .globl _restgpr_18_x + .globl _restgpr_19_x + .globl _restgpr_20_x + .globl _restgpr_21_x + .globl _restgpr_22_x + .globl _restgpr_23_x + .globl _restgpr_24_x + .globl _restgpr_25_x + .globl _restgpr_26_x + .globl _restgpr_27_x + .globl _restgpr_28_x + .globl _restgpr_29_x + .globl _restgpr_30_x + .globl _restgpr_31_x + + .long 0x00600000 # traceback tag +_restgpr_14_x: lwz 14,-72(11) # rest gp registers +_restgpr_15_x: lwz 15,-68(11) +_restgpr_16_x: lwz 16,-64(11) +_restgpr_17_x: lwz 17,-60(11) +_restgpr_18_x: lwz 18,-56(11) +_restgpr_19_x: lwz 19,-52(11) +_restgpr_20_x: lwz 20,-48(11) +_restgpr_21_x: lwz 21,-44(11) +_restgpr_22_x: lwz 22,-40(11) +_restgpr_23_x: lwz 23,-36(11) +_restgpr_24_x: lwz 24,-32(11) +_restgpr_25_x: lwz 25,-28(11) +_restgpr_26_x: lwz 26,-24(11) +_restgpr_27_x: lwz 27,-20(11) +_restgpr_28_x: lwz 28,-16(11) +_restgpr_29_x: lwz 29,-12(11) +_restgpr_30_x: lwz 30,-8(11) +_restgpr_31_x: lwz 0,4(11) + lwz 31,-4(11) + mtlr 0 + mr 1,11 + blr diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 424b025..bb87a78 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -2166,7 +2166,7 @@ rs6000_makes_calls () SP----> +---------------------------------------+ | back chain to caller | 0 +---------------------------------------+ - | saved LR | 4 + | caller's saved LR | 4 +---------------------------------------+ | Parameter save area (P) | 8 +---------------------------------------+ @@ -2274,7 +2274,7 @@ rs6000_stack_info () if (v4_call_p) { info_ptr->cr_save_offset = info_ptr->gp_save_offset - reg_size; - info_ptr->lr_save_offset = - info_ptr->total_size + reg_size; + info_ptr->lr_save_offset = reg_size; } else { diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 06de488..cda871b 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -5251,22 +5251,9 @@ { rtx chain = gen_reg_rtx (Pmode); rtx stack_bot = gen_rtx (MEM, Pmode, stack_pointer_rtx); rtx neg_op0; - rtx lr_addr = NULL_RTX; - rtx lr = NULL_RTX; emit_move_insn (chain, stack_bot); -#ifdef TARGET_V4_CALLS - if (TARGET_V4_CALLS) - { - lr = gen_reg_rtx (Pmode); - lr_addr = gen_rtx (MEM, Pmode, gen_rtx (PLUS, Pmode, - stack_pointer_rtx, - GEN_INT (4))); - emit_move_insn (lr, lr_addr); - } -#endif - if (GET_CODE (operands[0]) != CONST_INT || INTVAL (operands[0]) < -32767 || INTVAL (operands[0]) > 32768) @@ -5285,11 +5272,6 @@ else emit_insn (gen_movsi_update (stack_pointer_rtx, stack_pointer_rtx, neg_op0, chain)); -#ifdef TARGET_V4_CALLS - if (TARGET_V4_CALLS) - emit_move_insn (lr_addr, lr); -#endif - DONE; }") |