diff options
author | Michael Hayes <m.hayes@elec.canterbury.ac.nz> | 1999-01-03 20:43:14 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1999-01-03 13:43:14 -0700 |
commit | 362cc3d434b402148d579551c6f3ff4d4798a296 (patch) | |
tree | f3bee78195ed2ea424f2fed1ca5659020bca3406 /gcc/unroll.c | |
parent | 1cd0a8edcaa31b8e1b76fc17ae41f3aa268fd5af (diff) | |
download | gcc-362cc3d434b402148d579551c6f3ff4d4798a296.zip gcc-362cc3d434b402148d579551c6f3ff4d4798a296.tar.gz gcc-362cc3d434b402148d579551c6f3ff4d4798a296.tar.bz2 |
optabs.c (emit_cmp_insn): Abort if asked to emit non-canonical RTL for a target with HAVE_cc0 defined.
* optabs.c (emit_cmp_insn): Abort if asked to emit non-canonical RTL
for a target with HAVE_cc0 defined.
(emit_cmp_and_jump_insns): New function.
* expr.h (emit_cmp_and_jump_insns): Prototype it.
* loop.c (check_dbra_loop): Use it to replace calls
to emit_cmp_insn and emit_jump_insn and to canonicalise
the comparison if necessary.
* unroll.c (unroll_loop): Likewise.
From-SVN: r24471
Diffstat (limited to 'gcc/unroll.c')
-rw-r--r-- | gcc/unroll.c | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/gcc/unroll.c b/gcc/unroll.c index 8723c35..8586e1d 100644 --- a/gcc/unroll.c +++ b/gcc/unroll.c @@ -919,12 +919,9 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before, if (loop_info->comparison_code != NE) { - emit_cmp_insn (initial_value, final_value, neg_inc ? LE : GE, - NULL_RTX, mode, 0, 0); - if (neg_inc) - emit_jump_insn (gen_ble (labels[1])); - else - emit_jump_insn (gen_bge (labels[1])); + emit_cmp_and_jump_insns (initial_value, final_value, + neg_inc ? LE : GE, + NULL_RTX, mode, 0, 0, labels[1]); JUMP_LABEL (get_last_insn ()) = labels[1]; LABEL_NUSES (labels[1])++; } @@ -965,15 +962,9 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before, cmp_code = LE; } - emit_cmp_insn (diff, GEN_INT (abs_inc * cmp_const), - cmp_code, NULL_RTX, mode, 0, 0); - - if (i == 0) - emit_jump_insn (gen_beq (labels[i])); - else if (neg_inc) - emit_jump_insn (gen_bge (labels[i])); - else - emit_jump_insn (gen_ble (labels[i])); + emit_cmp_and_jump_insns (diff, GEN_INT (abs_inc * cmp_const), + cmp_code, NULL_RTX, mode, 0, 0, + labels[i]); JUMP_LABEL (get_last_insn ()) = labels[i]; LABEL_NUSES (labels[i])++; } @@ -1003,13 +994,8 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before, cmp_code = GE; } - emit_cmp_insn (diff, GEN_INT (cmp_const), cmp_code, NULL_RTX, - mode, 0, 0); - - if (neg_inc) - emit_jump_insn (gen_ble (labels[0])); - else - emit_jump_insn (gen_bge (labels[0])); + emit_cmp_and_jump_insns (diff, GEN_INT (cmp_const), cmp_code, + NULL_RTX, mode, 0, 0, labels[0]); JUMP_LABEL (get_last_insn ()) = labels[0]; LABEL_NUSES (labels[0])++; } |