From: Richard Kenner Date: Wed, 9 Mar 1994 20:31:06 +0000 (-0500) Subject: (rtx_equal_for_thread_p): Commutative operations are identical if the X-Git-Tag: misc/cutover-egcs-0~7212 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=413c72c2897f295e25c0bb95ba5998f5d6d29b57;p=thirdparty%2Fgcc.git (rtx_equal_for_thread_p): Commutative operations are identical if the operands match in the opposite order. From-SVN: r6731 --- diff --git a/gcc/jump.c b/gcc/jump.c index f2d4a44de7a3..1129b6d12779 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -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) {