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: Partial fix for PR opt/55177


On 05/23/2013 10:05 AM, Eric Botcazou wrote:
The PR is about missed simplifications for __builtin_swap.  IIUC Andrew has
patches for them at the Tree level, but I think having basic simplifications
at the RTL level for BSWAP is also worthwhile, hence the attached patch.

Tested on x86_64-suse-linux.  Comments?


2013-05-23  Eric Botcazou  <ebotcazou@adacore.com>

	PR opt/55177
	* simplify-rtx.c (simplify_unary_operation_1) <NOT>: Deal with BSWAP.
	(simplify_byte_swapping_operation): New.
	(simplify_binary_operation_1): Call it for AND, IOR and XOR.
	(simplify_relational_operation_1): Deal with BSWAP.


2013-05-23  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc.dg/builtin-bswap-6.c: New test.
	* gcc.dg/builtin-bswap-7.c: Likewise.
	* gcc.dg/builtin-bswap-8.c: Likewise.
	* gcc.dg/builtin-bswap-9.c: Likewise.
Seems reasonable. And no matter how hard we try, just about everything we want to catch at the tree level will by some path be exposable at the RTL level as well.

I'd like to see the gimple equivalents moving forward as well, but realize you may not be in a position to move Andrew's code forward.

Jeff



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