summaryrefslogtreecommitdiff
path: root/gcc/config/bfin/bfin.md
diff options
context:
space:
mode:
authorbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2009-09-03 15:37:28 +0000
committerbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2009-09-03 15:37:28 +0000
commit4bb5cea52065a96612035c4cadcab0d3beb23870 (patch)
tree2a3d9e1c43f8bd260ab33779e73b86699cbfd3cc /gcc/config/bfin/bfin.md
parent6f72abb655e35fddd338774188add14fffc322bc (diff)
downloadgcc-4bb5cea52065a96612035c4cadcab0d3beb23870.tar.gz
gcc/
* config/bfin/linux.h (TARGET_SUPPORTS_SYNC_CALLS): Define to 1. * config/bfin/uclinux.h (TARGET_SUPPORTS_SYNC_CALLS): Define to 1. * config/bfin/bfin.h (TARGET_SUPPORTS_SYNC_CALLS): Provide default of 0. * config/bfin/sync.md: New file. * config/bfin/bfin.md: Include it. (UNSPEC_ATOMIC): New. (UNSPEC_ONES): Provide a unique number. From Jie Zhang <jie.zhang@analog.com>: * config/bfin/bfin.c (ret_regs): New. (must_save_fp_p): Don't return true because of frame_pointer_needed. (must_save_rets_p): New. (n_regs_saved_by_prologue): Use must_save_rets_p instead of current_function_is_leaf. (do_link): Likewise. (do_unlink): Likewise. (expand_interrupt_handler_prologue): Use ret_regs array. (expand_interrupt_handler_epilogue): Use ret_regs array and pass return register to gen_return_internal. (bfin_expand_epilogue): Pass return register to gen_return_internal. (bfin_expand_call): Explicitly clobber RETS. * config/bfin/bfin.h (FUNCTION_RETURN_REGISTERS): Define. * config/bfin/bfin.md (call_symbol_fdpic, call_value_symbol_fdpic, call_insn_fdpic, call_value_insn_fdpic, call_symbol, call_value_symbol, call_insn, call_value_insn): Explicitly clobber RETS. (return_internal): Take a reg rtx rather than the register number. gcc/testsuite/ * lib/target-supports.exp (check_effective_target_sync_int_long): Supported on Blackfin Linux targets. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151381 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/bfin/bfin.md')
-rw-r--r--gcc/config/bfin/bfin.md41
1 files changed, 26 insertions, 15 deletions
diff --git a/gcc/config/bfin/bfin.md b/gcc/config/bfin/bfin.md
index a3638700a53..01e40125cf6 100644
--- a/gcc/config/bfin/bfin.md
+++ b/gcc/config/bfin/bfin.md
@@ -138,7 +138,8 @@
;; Distinguish a 32-bit version of an insn from a 16-bit version.
(UNSPEC_32BIT 11)
(UNSPEC_NOP 12)
- (UNSPEC_ONES 12)])
+ (UNSPEC_ONES 13)
+ (UNSPEC_ATOMIC 14)])
(define_constants
[(UNSPEC_VOLATILE_CSYNC 1)
@@ -2005,7 +2006,8 @@
[(call (mem:SI (match_operand:SI 0 "symbol_ref_operand" "Q"))
(match_operand 1 "general_operand" "g"))
(use (match_operand:SI 2 "register_operand" "Z"))
- (use (match_operand 3 "" ""))]
+ (use (match_operand 3 "" ""))
+ (clobber (reg:SI REG_RETS))]
"! SIBLING_CALL_P (insn)
&& GET_CODE (operands[0]) == SYMBOL_REF
&& !bfin_longcall_p (operands[0], INTVAL (operands[3]))"
@@ -2031,7 +2033,8 @@
(call (mem:SI (match_operand:SI 1 "symbol_ref_operand" "Q"))
(match_operand 2 "general_operand" "g")))
(use (match_operand:SI 3 "register_operand" "Z"))
- (use (match_operand 4 "" ""))]
+ (use (match_operand 4 "" ""))
+ (clobber (reg:SI REG_RETS))]
"! SIBLING_CALL_P (insn)
&& GET_CODE (operands[1]) == SYMBOL_REF
&& !bfin_longcall_p (operands[1], INTVAL (operands[4]))"
@@ -2057,7 +2060,8 @@
[(call (mem:SI (match_operand:SI 0 "register_no_elim_operand" "Y"))
(match_operand 1 "general_operand" "g"))
(use (match_operand:SI 2 "register_operand" "Z"))
- (use (match_operand 3 "" ""))]
+ (use (match_operand 3 "" ""))
+ (clobber (reg:SI REG_RETS))]
"! SIBLING_CALL_P (insn)"
"call (%0);"
[(set_attr "type" "call")
@@ -2079,7 +2083,8 @@
(call (mem:SI (match_operand:SI 1 "register_no_elim_operand" "Y"))
(match_operand 2 "general_operand" "g")))
(use (match_operand:SI 3 "register_operand" "Z"))
- (use (match_operand 4 "" ""))]
+ (use (match_operand 4 "" ""))
+ (clobber (reg:SI REG_RETS))]
"! SIBLING_CALL_P (insn)"
"call (%1);"
[(set_attr "type" "call")
@@ -2100,7 +2105,8 @@
(define_insn "*call_symbol"
[(call (mem:SI (match_operand:SI 0 "symbol_ref_operand" "Q"))
(match_operand 1 "general_operand" "g"))
- (use (match_operand 2 "" ""))]
+ (use (match_operand 2 "" ""))
+ (clobber (reg:SI REG_RETS))]
"! SIBLING_CALL_P (insn)
&& (!TARGET_ID_SHARED_LIBRARY || TARGET_LEAF_ID_SHARED_LIBRARY)
&& GET_CODE (operands[0]) == SYMBOL_REF
@@ -2126,7 +2132,8 @@
[(set (match_operand 0 "register_operand" "=d")
(call (mem:SI (match_operand:SI 1 "symbol_ref_operand" "Q"))
(match_operand 2 "general_operand" "g")))
- (use (match_operand 3 "" ""))]
+ (use (match_operand 3 "" ""))
+ (clobber (reg:SI REG_RETS))]
"! SIBLING_CALL_P (insn)
&& (!TARGET_ID_SHARED_LIBRARY || TARGET_LEAF_ID_SHARED_LIBRARY)
&& GET_CODE (operands[1]) == SYMBOL_REF
@@ -2152,7 +2159,8 @@
(define_insn "*call_insn"
[(call (mem:SI (match_operand:SI 0 "register_no_elim_operand" "a"))
(match_operand 1 "general_operand" "g"))
- (use (match_operand 2 "" ""))]
+ (use (match_operand 2 "" ""))
+ (clobber (reg:SI REG_RETS))]
"! SIBLING_CALL_P (insn)"
"call (%0);"
[(set_attr "type" "call")
@@ -2172,7 +2180,8 @@
[(set (match_operand 0 "register_operand" "=d")
(call (mem:SI (match_operand:SI 1 "register_no_elim_operand" "a"))
(match_operand 2 "general_operand" "g")))
- (use (match_operand 3 "" ""))]
+ (use (match_operand 3 "" ""))
+ (clobber (reg:SI REG_RETS))]
"! SIBLING_CALL_P (insn)"
"call (%1);"
[(set_attr "type" "call")
@@ -2641,18 +2650,18 @@
(define_insn "return_internal"
[(return)
- (unspec [(match_operand 0 "immediate_operand" "i")] UNSPEC_RETURN)]
+ (use (match_operand 0 "register_operand" ""))]
"reload_completed"
{
- switch (INTVAL (operands[0]))
+ switch (REGNO (operands[0]))
{
- case EXCPT_HANDLER:
+ case REG_RETX:
return "rtx;";
- case NMI_HANDLER:
+ case REG_RETN:
return "rtn;";
- case INTERRUPT_HANDLER:
+ case REG_RETI:
return "rti;";
- case SUBROUTINE:
+ case REG_RETS:
return "rts;";
}
gcc_unreachable ();
@@ -4106,3 +4115,5 @@
"DISALGNEXCPT || %0 = [%1];"
[(set_attr "type" "mcld")
(set_attr "length" "8")])
+
+(include "sync.md")