From 8ddf681af74e5404974fb47b0b9874de49a3b07d Mon Sep 17 00:00:00 2001 From: "J\"orn Rennecke" Date: Thu, 7 Jul 2005 11:48:15 +0000 Subject: hooks.c (hook_bool_rtx_int_false): New function. * hooks.c (hook_bool_rtx_int_false): New function. * hooks.h (hook_bool_rtx_int_false): Declare. * target-def.h (TARGET_COMMUTATIVE_P): Define. (TARGET_INITIALIZER): Add TARGET_COMMUTATIVE_P. * target.h (struct gcc_target): Add commutative_p member. * targhooks.c (hook_bool_rtx_commutative_p): New function. * targhooks.h (hook_bool_rtx_commutative_p): Declare. * pa.c (TARGET_COMMUTATIVE_P): Redefine. (pa_commutative_p): New function. * jump.c (target.h): Include. (rtx_renumbered_equal_p): Use targetm.commutative_p. * doc/tm.texi: Document TARGET_COMMUTATIVE_P. From-SVN: r101706 --- gcc/jump.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'gcc/jump.c') diff --git a/gcc/jump.c b/gcc/jump.c index de5686d..e3e2cda 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -57,6 +57,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA #include "predict.h" #include "timevar.h" #include "tree-pass.h" +#include "target.h" /* Optimize jump y; x: ... y: jumpif... x? Don't know if it is worth bothering with. */ @@ -1794,15 +1795,7 @@ invert_jump (rtx jump, rtx nlabel, int delete_unused) /* Like rtx_equal_p except that it considers two REGs as equal if they renumber to the same value and considers two commutative operations to be the same if the order of the operands has been - reversed. - - ??? Addition is not commutative on the PA due to the weird implicit - space register selection rules for memory addresses. Therefore, we - don't consider a + b == b + a. - - We could/should make this test a little tighter. Possibly only - disabling it on the PA via some backend macro or only disabling this - case when the PLUS is inside a MEM. */ + reversed. */ int rtx_renumbered_equal_p (rtx x, rtx y) @@ -1915,10 +1908,8 @@ rtx_renumbered_equal_p (rtx x, rtx 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. - - ??? Don't consider PLUS a commutative operator; see comments above. */ - if (COMMUTATIVE_P (x) && code != PLUS) + order. Also handle the simple binary and unary cases without a loop. */ + if (targetm.commutative_p (x, UNKNOWN)) return ((rtx_renumbered_equal_p (XEXP (x, 0), XEXP (y, 0)) && rtx_renumbered_equal_p (XEXP (x, 1), XEXP (y, 1))) || (rtx_renumbered_equal_p (XEXP (x, 0), XEXP (y, 1)) -- cgit v1.1