diff options
author | J"orn Rennecke <joern.rennecke@st.com> | 2005-07-07 11:48:15 +0000 |
---|---|---|
committer | Joern Rennecke <amylaar@gcc.gnu.org> | 2005-07-07 12:48:15 +0100 |
commit | 8ddf681af74e5404974fb47b0b9874de49a3b07d (patch) | |
tree | e7a18c9a6876b4eaa648b82269a93800d9c41279 /gcc/jump.c | |
parent | 6d057022743cd9dd0e46c494f0d9449cb7e5aad0 (diff) | |
download | gcc-8ddf681af74e5404974fb47b0b9874de49a3b07d.zip gcc-8ddf681af74e5404974fb47b0b9874de49a3b07d.tar.gz gcc-8ddf681af74e5404974fb47b0b9874de49a3b07d.tar.bz2 |
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
Diffstat (limited to 'gcc/jump.c')
-rw-r--r-- | gcc/jump.c | 17 |
1 files changed, 4 insertions, 13 deletions
@@ -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)) |