]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
(rtx_equal_for_thread_p): Commutative operations are identical if the
authorRichard Kenner <kenner@gcc.gnu.org>
Wed, 9 Mar 1994 20:31:06 +0000 (15:31 -0500)
committerRichard Kenner <kenner@gcc.gnu.org>
Wed, 9 Mar 1994 20:31:06 +0000 (15:31 -0500)
operands match in the opposite order.

From-SVN: r6731

gcc/jump.c

index f2d4a44de7a3d67cfca4e3a0b516dab9961676c8..1129b6d1277922fb517ac4bcc87794d66f72c53e 100644 (file)
@@ -4207,6 +4207,19 @@ rtx_equal_for_thread_p (x, y, yinsn)
   if (GET_MODE (x) != GET_MODE (y))
     return 0;
 
+  /* For commutative operations, the RTX match if the operand match in any
+     order.  Also handle the simple binary and unary cases without a loop.  */
+  if (code == EQ || code == NE || GET_RTX_CLASS (code) == 'c')
+    return ((rtx_equal_for_thread_p (XEXP (x, 0), XEXP (y, 0))
+            && rtx_equal_for_thread_p (XEXP (x, 1), XEXP (y, 1)))
+           || (rtx_equal_for_thread_p (XEXP (x, 0), XEXP (y, 1))
+               && rtx_equal_for_thread_p (XEXP (x, 1), XEXP (y, 0))));
+  else if (GET_RTX_CLASS (code) == '<' || GET_RTX_CLASS (code) == '2')
+    return (rtx_equal_for_thread_p (XEXP (x, 0), XEXP (y, 0))
+           && rtx_equal_for_thread_p (XEXP (x, 1), XEXP (y, 1)));
+  else if (GET_RTX_CLASS (code) == '1')
+    return rtx_equal_for_thread_p (XEXP (x, 0), XEXP (y, 0));
+
   /* Handle special-cases first.  */
   switch (code)
     {