summaryrefslogtreecommitdiff
path: root/gcc/config/rs6000/rs6000.md
diff options
context:
space:
mode:
authorfroydnj <froydnj@138bc75d-0d04-0410-961f-82ee72b054a4>2008-06-26 20:12:41 +0000
committerfroydnj <froydnj@138bc75d-0d04-0410-961f-82ee72b054a4>2008-06-26 20:12:41 +0000
commit9ef25fc1003ee050c1bfe24af6575cb72b157ce2 (patch)
treea4b578b731cb2590f6903b103e988eaafd60303a /gcc/config/rs6000/rs6000.md
parent25ae9ba2890e790638f27e8006d2090e74d1bfb1 (diff)
downloadgcc-9ef25fc1003ee050c1bfe24af6575cb72b157ce2.tar.gz
* config/rs6000/rs6000.c (emit_allocate_stack): Add copy_r11
parameter. Copy stack_reg to r11 where appropriate. (no_global_regs_above): Add gpr parameter. (rs6000_stack_info): Only add padding for SPE save area if we are saving SPE GPRs and CR. (saveres_routine_syms): New variable. (FIRST_SAVRES_REGISTER, LAST_SAVRES_REGISTER, N_SAVRES_REGISTERS): Define. (rs6000_savres_routine_sym): New function. (rs6000_emit_stack_reset, rs6000_restore_saved_cr): New functions, split out of... (rs6000_emit_epilogue): ...here. Use rs6000_use_multiple_p and rs6000_savres_strategy. Restore GPRs out-of-line if appropriate. Tweak FPR out-of-line saving. (rs6000_make_savres_rtx): New function. (rs6000_use_multiple_p): New function. (rs6000_savres_strategy): New function. (rs6000_emit_prologue): Use rs6000_savres_strategy. Save GPRs out-of-line if appropriate. * config/rs6000/sysv4.h (FP_SAVE_INLINE): Save FPRs out-of-line if we are optimizing for size. (GP_SAVE_INLINE): Define. (SAVE_FP_SUFFIX, RESTORE_FP_SUFFIX): Only use _l on 64-bit targets. * config/rs6000/darwin.h (GP_SAVE_INLINE): Define. * config/rs6000/aix.h (GP_SAVE_INLINE): Define. * config/rs6000/rs6000.md (*save_gpregs_<mode>): New insn. (*save_fpregs_<mode>): Add use of r11. (*restore_gpregs_<mode>): New insn. (*return_and_restore_gpregs_<mode>): New insn. (*return_and_restore_fpregs_<mode>): Adjust to clobber LR and use r11. * config/rs6000/spe.md (*save_gpregs_spe): New insn. (*restore_gpregs_spe): New insn. (*return_and_restore_gpregs_spe): New insn. * config/rs6000/predicates.md (save_world_operation): Fix check. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@137160 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/rs6000/rs6000.md')
-rw-r--r--gcc/config/rs6000/rs6000.md57
1 files changed, 49 insertions, 8 deletions
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index e3912c76646..461eda7c6a5 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -14421,12 +14421,25 @@
"{stm|stmw} %2,%1"
[(set_attr "type" "store_ux")])
+(define_insn "*save_gpregs_<mode>"
+ [(match_parallel 0 "any_parallel_operand"
+ [(clobber (reg:P 65))
+ (use (match_operand:P 1 "symbol_ref_operand" "s"))
+ (use (match_operand:P 2 "gpc_reg_operand" "r"))
+ (set (match_operand:P 3 "memory_operand" "=m")
+ (match_operand:P 4 "gpc_reg_operand" "r"))])]
+ ""
+ "bl %z1"
+ [(set_attr "type" "branch")
+ (set_attr "length" "4")])
+
(define_insn "*save_fpregs_<mode>"
[(match_parallel 0 "any_parallel_operand"
[(clobber (reg:P 65))
- (use (match_operand:P 1 "call_operand" "s"))
- (set (match_operand:DF 2 "memory_operand" "=m")
- (match_operand:DF 3 "gpc_reg_operand" "f"))])]
+ (use (match_operand:P 1 "symbol_ref_operand" "s"))
+ (use (match_operand:P 2 "gpc_reg_operand" "r"))
+ (set (match_operand:DF 3 "memory_operand" "=m")
+ (match_operand:DF 4 "gpc_reg_operand" "f"))])]
""
"bl %z1"
[(set_attr "type" "branch")
@@ -14514,15 +14527,43 @@
; FIXME: This would probably be somewhat simpler if the Cygnus sibcall
; stuff was in GCC. Oh, and "any_parallel_operand" is a bit flexible...
+(define_insn "*restore_gpregs_<mode>"
+ [(match_parallel 0 "any_parallel_operand"
+ [(clobber (match_operand:P 1 "register_operand" "=l"))
+ (use (match_operand:P 2 "symbol_ref_operand" "s"))
+ (use (match_operand:P 3 "gpc_reg_operand" "r"))
+ (set (match_operand:P 4 "gpc_reg_operand" "=r")
+ (match_operand:P 5 "memory_operand" "m"))])]
+ ""
+ "bl %z2"
+ [(set_attr "type" "branch")
+ (set_attr "length" "4")])
+
+(define_insn "*return_and_restore_gpregs_<mode>"
+ [(match_parallel 0 "any_parallel_operand"
+ [(return)
+ (clobber (match_operand:P 1 "register_operand" "=l"))
+ (use (match_operand:P 2 "symbol_ref_operand" "s"))
+ (use (match_operand:P 3 "gpc_reg_operand" "r"))
+ (set (match_operand:P 4 "gpc_reg_operand" "=r")
+ (match_operand:P 5 "memory_operand" "m"))])]
+ ""
+ "b %z2"
+ [(set_attr "type" "branch")
+ (set_attr "length" "4")])
+
(define_insn "*return_and_restore_fpregs_<mode>"
[(match_parallel 0 "any_parallel_operand"
[(return)
- (use (reg:P 65))
- (use (match_operand:P 1 "call_operand" "s"))
- (set (match_operand:DF 2 "gpc_reg_operand" "=f")
- (match_operand:DF 3 "memory_operand" "m"))])]
+ (clobber (match_operand:P 1 "register_operand" "=l"))
+ (use (match_operand:P 2 "symbol_ref_operand" "s"))
+ (use (match_operand:P 3 "gpc_reg_operand" "r"))
+ (set (match_operand:DF 4 "gpc_reg_operand" "=f")
+ (match_operand:DF 5 "memory_operand" "m"))])]
""
- "b %z1")
+ "b %z2"
+ [(set_attr "type" "branch")
+ (set_attr "length" "4")])
; This is used in compiling the unwind routines.
(define_expand "eh_return"