On 06/22/14 14:58, Segher Boessenkool wrote:
Many targets do not have both rotate and rotatert. Of the 47 targets
in the tree, 17 have both, 9 have only rotate, 2 have only rotatert, and
19 have neither (this is based on "grep -wil" so it can be slightly off).
rs6000 has only rotate, and mips has only rotatert. For such targets
simplifying rotate to rotatert and vice versa is not simplifying things
at all. rs6000 has already way too many rotate patterns (some days it
seems like two thousand, but it is somewhat less in reality still); I
would prefer not to double that again.
So, this patch makes genrecog define HAVE_rotate and HAVE_rotatert if
those RTL codes are mentioned anywhere in the machine description, and
then does the transformation in simplify-rtx.c only if both these flags
are set.
Bootstrapped and tested on powerpc64-linux. Okay to apply?
Segher
2014-06-22 Segher Boessenkool <seg...@kernel.crashing.org>
gcc/
* genconfig.c (have_rotate_flag, have_rotatert_flag): New
variables.
(walk_insn_part) <ROTATE, ROTATERT>: New cases.
(main): Conditionally write HAVE_rotate c.q. HAVE_rotatert.
* simplify-rtx.c (simplify_binary_operation_1) <ROTATE, ROTATERT>:
Only do the transformation if both HAVE_rotate and HAVE_rotatert.
OK. It would be useful if you could add one or more tests to the
testsuite to confirm proper behaviour when only one of ROTATE/ROTATERT
is defined.
jeff