aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/mips/mips.md
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/mips/mips.md')
-rw-r--r--gcc/config/mips/mips.md39
1 files changed, 21 insertions, 18 deletions
diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md
index 19049af2ee3..f94283712df 100644
--- a/gcc/config/mips/mips.md
+++ b/gcc/config/mips/mips.md
@@ -29,10 +29,11 @@
;; UNSPEC values used in mips.md
;; Number USE
;; 0 movsi_ul
-;; 1 movsi_us, get_fnaddr
+;; 1 movsi_usw, get_fnaddr
;; 2 reload_in*, reload_out* : sets delay on HILO register
;; 3 eh_set_return
;; 20 builtin_setjmp_setup
+;; 111 movdi_usd
;;
;; UNSPEC_VOLATILE values
;; 0 blockage
@@ -135,6 +136,18 @@
(const_string "yes")
(const_string "no")))
+;; Can the instruction be put into a delay slot?
+(define_attr "can_delay" "no,yes"
+ (if_then_else (and (eq_attr "dslot" "no")
+ ; ADJUST_INSN_LENGTH divides length by 2 on mips16,
+ ; so cope with it here.
+ (ior (and (eq (symbol_ref "mips16") (const_int 0))
+ (eq_attr "length" "4"))
+ (and (ne (symbol_ref "mips16") (const_int 0))
+ (eq_attr "length" "2"))))
+ (const_string "yes")
+ (const_string "no")))
+
;; Attribute defining whether or not we can use the branch-likely instructions
(define_attr "branch_likely" "no,yes"
@@ -162,30 +175,19 @@
(define_delay (and (eq_attr "type" "branch")
(eq (symbol_ref "mips16") (const_int 0)))
- [(and (eq_attr "dslot" "no") (eq_attr "length" "4"))
+ [(eq_attr "can_delay" "yes")
(nil)
(and (eq_attr "branch_likely" "yes")
(and (eq_attr "dslot" "no")
(eq_attr "length" "4")))])
(define_delay (eq_attr "type" "jump")
- [(and (eq_attr "dslot" "no")
- ;; ADJUST_INSN_LENGTH divides length by 2 on mips16, so cope
- ;; with it here. It doesn't matter for branches above,
- ;; because mips16 branches don't have delay slots anyway.
- (ior (and (eq (symbol_ref "mips16") (const_int 0))
- (eq_attr "length" "4"))
- (and (ne (symbol_ref "mips16") (const_int 0))
- (eq_attr "length" "2"))))
+ [(eq_attr "can_delay" "yes")
(nil)
(nil)])
(define_delay (and (eq_attr "type" "call") (eq_attr "abicalls" "no"))
- [(and (eq_attr "dslot" "no")
- (ior (and (eq (symbol_ref "mips16") (const_int 0))
- (eq_attr "length" "4"))
- (and (ne (symbol_ref "mips16") (const_int 0))
- (eq_attr "length" "2"))))
+ [(eq_attr "can_delay" "yes")
(nil)
(nil)])
@@ -4864,7 +4866,7 @@ move\\t%0,%z4\\n\\
(define_insn "movdi_usd"
[(set (match_operand:BLK 0 "memory_operand" "=R,o")
- (unspec:BLK [(match_operand:DI 1 "reg_or_0_operand" "dJ,dJ")] 1))]
+ (unspec:BLK [(match_operand:DI 1 "reg_or_0_operand" "dJ,dJ")] 111))]
""
"*
{
@@ -4880,7 +4882,7 @@ move\\t%0,%z4\\n\\
if ((INTVAL (offset) & 7) == 0
&& (mem_addr == stack_pointer_rtx || mem_addr == frame_pointer_rtx))
- return \"sd\\t%1,%0\";
+ return \"sd\\t%z1,%0\";
return \"usd\\t%z1,%0\";
}"
@@ -5767,7 +5769,8 @@ move\\t%0,%z4\\n\\
""
""
[(set_attr "type" "nop")
- (set_attr "mode" "none")])
+ (set_attr "mode" "none")
+ (set_attr "can_delay" "no")])
;; This insn handles moving CCmode values. It's really just a
;; slightly simplified copy of movsi_internal2, with additional cases