Commit 3b5e8a16 by Michael Hayes Committed by Michael Hayes

c4x.c (c4x_rptb_insert): Emit rpts_top pattern if appropriate.

	* config/c4x/c4x.c (c4x_rptb_insert): Emit rpts_top pattern
	if appropriate.
	* config/c4x/c4x.md (rpts_top): New pattern and splitter.

From-SVN: r30027
parent 1a616dfc
Sat Oct 16 12:34:44 1999 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* config/c4x/c4x.c (c4x_rptb_insert): Emit rpts_top pattern
if appropriate.
* config/c4x/c4x.md (rpts_top): New pattern and splitter.
Sat Oct 16 12:26:30 1999 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* config/c4x/c4x.c (src_operand): Check SYMBOL_REF and LABEL_REF
......
......@@ -2176,7 +2176,10 @@ c4x_rptb_insert (insn)
fatal_insn ("c4x_rptb_insert: Cannot find start label", start_label);
/* We'll have to update the basic blocks. */
emit_insn_before (gen_rptb_top (start_label, end_label), insn);
if (TARGET_RPTS && c4x_rptb_rpts_p (PREV_INSN (insn), 0))
emit_insn_before (gen_rpts_top (start_label, end_label), insn);
else
emit_insn_before (gen_rptb_top (start_label, end_label), insn);
}
......
......@@ -4908,10 +4908,20 @@
"
[(set_attr "type" "repeat_top")])
(define_insn "rpts_top"
[(unspec [(use (label_ref (match_operand 0 "" "")))
(use (label_ref (match_operand 1 "" "")))] 2)]
""
"*
return ! final_sequence && c4x_rptb_rpts_p (insn, operands[0])
? \"rpts\\trc\" : \"rptb%#\\t%l1-1\";
"
[(set_attr "type" "repeat")])
; This pattern needs to be emitted at the start of the loop to
; say that RS and RE are loaded.
(define_insn "rptb_init"
[(unspec[(match_operand:QI 0 "register_operand" "va")] 22)
[(unspec [(match_operand:QI 0 "register_operand" "va")] 22)
(clobber (reg:QI 25))
(clobber (reg:QI 26))]
""
......@@ -4965,6 +4975,32 @@
"
[(set_attr "type" "repeat,db,jmpc,jmpc,jmpc")])
(define_split
[(set (pc)
(if_then_else (ge (match_operand:QI 0 "addr_reg_operand" "")
(const_int 0))
(label_ref (match_operand 1 "" ""))
(pc)))
(set (match_dup 0)
(plus:QI (match_dup 0)
(const_int -1)))
(use (match_operand:QI 2 "const_int_operand" ""))
(use (match_operand:QI 3 "const_int_operand" ""))
(use (match_operand:QI 4 "const_int_operand" ""))
(use (reg:QI 25))
(use (reg:QI 26))
(clobber (reg:CC_NOOV 21))]
"reload_completed"
[(parallel [(set (pc)
(if_then_else (ge (match_dup 0)
(const_int 0))
(label_ref (match_dup 1))
(pc)))
(set (match_dup 0)
(plus:QI (match_dup 0)
(const_int -1)))])]
"")
; operand 0 is the loop count pseudo register
; operand 1 is the number of loop iterations or 0 if it is unknown
; operand 2 is the maximum number of loop iterations
......
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