summaryrefslogtreecommitdiff
path: root/gcc/loop.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2001-02-24 02:18:38 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2001-02-24 02:18:38 +0000
commit87fd82145b4abbf3b94e1fd4c0e397328f827946 (patch)
tree2186cff4853d0aa47c65773c4f8c9d82f441fa18 /gcc/loop.c
parentd8745e9e73a561f714a0c0b8f636dcfc69eb0a70 (diff)
downloadgcc-87fd82145b4abbf3b94e1fd4c0e397328f827946.tar.gz
* loop.c (canonicalize_condition): Move to reversed_comparison_code.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@40019 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/loop.c')
-rw-r--r--gcc/loop.c36
1 files changed, 13 insertions, 23 deletions
diff --git a/gcc/loop.c b/gcc/loop.c
index eee79a31ae5..252e27eb087 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -8305,7 +8305,6 @@ canonicalize_condition (insn, cond, reverse, earliest, want_reg)
rtx tem;
rtx op0, op1;
int reverse_code = 0;
- int did_reverse_condition = 0;
enum machine_mode mode;
code = GET_CODE (cond);
@@ -8314,10 +8313,9 @@ canonicalize_condition (insn, cond, reverse, earliest, want_reg)
op1 = XEXP (cond, 1);
if (reverse)
- {
- code = reverse_condition (code);
- did_reverse_condition ^= 1;
- }
+ code = reversed_comparison_code (cond, insn);
+ if (code == UNKNOWN)
+ return 0;
if (earliest)
*earliest = insn;
@@ -8368,13 +8366,19 @@ canonicalize_condition (insn, cond, reverse, earliest, want_reg)
if ((prev = prev_nonnote_insn (prev)) == 0
|| GET_CODE (prev) != INSN
- || FIND_REG_INC_NOTE (prev, 0)
- || (set = single_set (prev)) == 0)
+ || FIND_REG_INC_NOTE (prev, 0))
+ break;
+
+ set = set_of (op0, prev);
+
+ if (set
+ && (GET_CODE (set) != SET
+ || !rtx_equal_p (SET_DEST (set), op0)))
break;
/* If this is setting OP0, get what it sets it to if it looks
relevant. */
- if (rtx_equal_p (SET_DEST (set), op0))
+ if (set)
{
enum machine_mode inner_mode = GET_MODE (SET_DEST (set));
@@ -8434,10 +8438,6 @@ canonicalize_condition (insn, cond, reverse, earliest, want_reg)
|| mode == VOIDmode || inner_mode == VOIDmode))
{
- /* 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
- have had to reverse the condition. */
- did_reverse_condition ^= 1;
reverse_code = 1;
x = SET_SRC (set);
}
@@ -8455,10 +8455,9 @@ canonicalize_condition (insn, cond, reverse, earliest, want_reg)
code = GET_CODE (x);
if (reverse_code)
{
- code = reverse_condition (code);
+ code = reversed_comparison_code (x, prev);
if (code == UNKNOWN)
return 0;
- did_reverse_condition ^= 1;
reverse_code = 0;
}
@@ -8521,15 +8520,6 @@ canonicalize_condition (insn, cond, reverse, earliest, want_reg)
}
}
- /* If this was floating-point and we reversed anything other than an
- EQ or NE or (UN)ORDERED, return zero. */
- if (TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT
- && did_reverse_condition
- && code != NE && code != EQ && code != UNORDERED && code != ORDERED
- && ! flag_fast_math
- && GET_MODE_CLASS (GET_MODE (op0)) == MODE_FLOAT)
- return 0;
-
#ifdef HAVE_cc0
/* Never return CC0; return zero instead. */
if (op0 == cc0_rtx)