diff options
author | Michael Hayes <m.hayes@elec.canterbury.ac.nz> | 1999-10-15 23:37:53 +0000 |
---|---|---|
committer | Michael Hayes <m.hayes@gcc.gnu.org> | 1999-10-15 23:37:53 +0000 |
commit | 3b5e8a16ba3595b38727c8e6242db740b66dae63 (patch) | |
tree | 49f793c35a48df2e6a74e3e9a8087efbf18d5611 /gcc | |
parent | 1a616dfc0ce5c5a9b92f297a2083a8be18682d21 (diff) | |
download | gcc-3b5e8a16ba3595b38727c8e6242db740b66dae63.zip gcc-3b5e8a16ba3595b38727c8e6242db740b66dae63.tar.gz gcc-3b5e8a16ba3595b38727c8e6242db740b66dae63.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/c4x/c4x.c | 5 | ||||
-rw-r--r-- | gcc/config/c4x/c4x.md | 38 |
3 files changed, 47 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1783d3b..d80b7fc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +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 diff --git a/gcc/config/c4x/c4x.c b/gcc/config/c4x/c4x.c index 34b57f0..b927413 100644 --- a/gcc/config/c4x/c4x.c +++ b/gcc/config/c4x/c4x.c @@ -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); } diff --git a/gcc/config/c4x/c4x.md b/gcc/config/c4x/c4x.md index d8979b6..e1a39fa 100644 --- a/gcc/config/c4x/c4x.md +++ b/gcc/config/c4x/c4x.md @@ -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 |