This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Only transform rotate to rotatert and v.v. if target has both


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  <segher@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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]