diff options
author | Richard Henderson <rth@cygnus.com> | 1998-05-08 19:03:07 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 1998-05-08 19:03:07 -0700 |
commit | f283421d4a4c4f1a81b861d552ed2851991886be (patch) | |
tree | 367306fb261bfcbd826cba6c30e8a72eef7f3f20 /gcc/loop.c | |
parent | 760801691294e8684d7aeae69b5bc317393c0d63 (diff) | |
download | gcc-f283421d4a4c4f1a81b861d552ed2851991886be.zip gcc-f283421d4a4c4f1a81b861d552ed2851991886be.tar.gz gcc-f283421d4a4c4f1a81b861d552ed2851991886be.tar.bz2 |
loop.c (get_condition): Don't combine when either compare is MODE_CC.
* loop.c (get_condition): Don't combine when either compare is MODE_CC.
* alpha.c (alpha_emit_conditional_branch): New function. Taken from
the body of beq; additionally set the mode of the branch to CCmode for
FP compares and not fast_math.
(alpha_emit_conditional_move): Always use a compare insn for FP
when not fast_math, as well as setting CCmode on the cmov.
* alpha.md (beq, bne, blt, et al): Call alpha_emit_conditional_branch.
From-SVN: r19645
Diffstat (limited to 'gcc/loop.c')
-rw-r--r-- | gcc/loop.c | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -6978,6 +6978,7 @@ get_condition (jump, earliest) rtx op0, op1; int reverse_code = 0; int did_reverse_condition = 0; + enum machine_mode mode; /* If this is not a standard conditional jump, we can't parse it. */ if (GET_CODE (jump) != JUMP_INSN @@ -6985,6 +6986,7 @@ get_condition (jump, earliest) return 0; code = GET_CODE (XEXP (SET_SRC (PATTERN (jump)), 0)); + mode = GET_MODE (XEXP (SET_SRC (PATTERN (jump)), 0)); op0 = XEXP (XEXP (SET_SRC (PATTERN (jump)), 0), 0); op1 = XEXP (XEXP (SET_SRC (PATTERN (jump)), 0), 1); @@ -7051,6 +7053,13 @@ get_condition (jump, earliest) { enum machine_mode inner_mode = GET_MODE (SET_SRC (set)); + /* ??? We may not combine comparisons done in a CCmode with + comparisons not done in a CCmode. This is to aid targets + like Alpha that have an IEEE compliant EQ instruction, and + a non-IEEE compliant BEQ instruction. The use of CCmode is + actually artificial, simply to prevent the combination, but + should not affect other platforms. */ + if ((GET_CODE (SET_SRC (set)) == COMPARE || (((code == NE || (code == LT @@ -7066,7 +7075,9 @@ get_condition (jump, earliest) && FLOAT_STORE_FLAG_VALUE < 0) #endif )) - && GET_RTX_CLASS (GET_CODE (SET_SRC (set))) == '<'))) + && GET_RTX_CLASS (GET_CODE (SET_SRC (set))) == '<')) + && ((GET_MODE_CLASS (mode) == MODE_CC) + != (GET_MODE_CLASS (inner_mode) == MODE_CC))) x = SET_SRC (set); else if (((code == EQ || (code == GE @@ -7082,7 +7093,9 @@ get_condition (jump, earliest) && FLOAT_STORE_FLAG_VALUE < 0) #endif )) - && GET_RTX_CLASS (GET_CODE (SET_SRC (set))) == '<') + && GET_RTX_CLASS (GET_CODE (SET_SRC (set))) == '<' + && ((GET_MODE_CLASS (mode) == MODE_CC) + != (GET_MODE_CLASS (inner_mode) == MODE_CC))) { /* We might have reversed a LT to get a GE here. But this wasn't actually the comparison of data, so we don't flag that we |