Re: [PATCH] Don't check for optab for 16bit bswap

2015-01-22 Thread Richard Henderson
On 01/21/2015 11:52 PM, Richard Biener wrote: On January 21, 2015 10:23:56 PM CET, Richard Henderson r...@redhat.com wrote: On 12/29/2014 06:04 AM, Thomas Preud'homme wrote: Since 16bit byteswap can be done via an 8 bit rotation (and it is the canonical form), the check for an optab only

RE: [PATCH] Don't check for optab for 16bit bswap

2015-01-22 Thread Thomas Preud'homme
From: Richard Henderson [mailto:r...@redhat.com] Sent: Friday, January 23, 2015 2:43 AM On 01/21/2015 11:52 PM, Richard Biener wrote: I was asking for the generic expander to consider bswapHI. Rotates are certainly more likely to get combined with sth else. Maybe. Alternately, don't

Re: [PATCH] Don't check for optab for 16bit bswap

2015-01-21 Thread H.J. Lu
On Mon, Jan 5, 2015 at 1:09 PM, Richard Biener rguent...@suse.de wrote: On January 5, 2015 3:54:40 PM CET, Thomas Preud'homme thomas.preudho...@arm.com wrote: From: Oleg Endo [mailto:oleg.e...@t-online.de] Sent: Tuesday, December 30, 2014 4:25 PM I've just tried disabling the 'rotlhi3'

RE: [PATCH] Don't check for optab for 16bit bswap

2015-01-21 Thread Thomas Preud'homme
-Original Message- From: Richard Henderson [mailto:r...@redhat.com] Sent: Thursday, January 22, 2015 5:24 AM To: Thomas Preud'homme; gcc-patches@gcc.gnu.org; 'Richard Biener' Subject: Re: [PATCH] Don't check for optab for 16bit bswap On 12/29/2014 06:04 AM, Thomas Preud'homme

Re: [PATCH] Don't check for optab for 16bit bswap

2015-01-21 Thread Richard Biener
On January 21, 2015 10:23:56 PM CET, Richard Henderson r...@redhat.com wrote: On 12/29/2014 06:04 AM, Thomas Preud'homme wrote: Since 16bit byteswap can be done via an 8 bit rotation (and it is the canonical form), the check for an optab only serves to prevent the bswap optimization for targets

Re: [PATCH] Don't check for optab for 16bit bswap

2015-01-21 Thread Richard Henderson
On 12/29/2014 06:04 AM, Thomas Preud'homme wrote: Since 16bit byteswap can be done via an 8 bit rotation (and it is the canonical form), the check for an optab only serves to prevent the bswap optimization for targets that don't have a 16bit byteswap (but do have a rotation instruction).

RE: [PATCH] Don't check for optab for 16bit bswap

2015-01-05 Thread Thomas Preud'homme
From: Oleg Endo [mailto:oleg.e...@t-online.de] Sent: Tuesday, December 30, 2014 4:25 PM I've just tried disabling the 'rotlhi3' pattern and __builtin_bswap16 expands into shift + and + or (as expected). Thus, I don't think the patch will make something worse (than it already .L42:

RE: [PATCH] Don't check for optab for 16bit bswap

2015-01-05 Thread Oleg Endo
On Mon, 2015-01-05 at 14:54 +, Thomas Preud'homme wrote: From: Oleg Endo [mailto:oleg.e...@t-online.de] Sent: Tuesday, December 30, 2014 4:25 PM I've just tried disabling the 'rotlhi3' pattern and __builtin_bswap16 expands into shift + and + or (as expected). Thus, I don't think

RE: [PATCH] Don't check for optab for 16bit bswap

2015-01-05 Thread Richard Biener
On January 5, 2015 3:54:40 PM CET, Thomas Preud'homme thomas.preudho...@arm.com wrote: From: Oleg Endo [mailto:oleg.e...@t-online.de] Sent: Tuesday, December 30, 2014 4:25 PM I've just tried disabling the 'rotlhi3' pattern and __builtin_bswap16 expands into shift + and + or (as expected).

RE: [PATCH] Don't check for optab for 16bit bswap

2014-12-30 Thread Richard Biener
On December 29, 2014 7:44:13 PM CET, Oleg Endo oleg.e...@t-online.de wrote: On Mon, 2014-12-29 at 17:53 +, Thomas Preud'homme wrote: From: Richard Biener [mailto:rguent...@suse.de] Sent: Monday, December 29, 2014 5:09 PM OK, but what about targets without a rotation optab? Is the

RE: [PATCH] Don't check for optab for 16bit bswap

2014-12-30 Thread Oleg Endo
On Tue, 2014-12-30 at 16:22 +0100, Richard Biener wrote: On December 29, 2014 7:44:13 PM CET, Oleg Endo oleg.e...@t-online.de wrote: On Mon, 2014-12-29 at 17:53 +, Thomas Preud'homme wrote: From: Richard Biener [mailto:rguent...@suse.de] Sent: Monday, December 29, 2014 5:09 PM

Re: [PATCH] Don't check for optab for 16bit bswap

2014-12-29 Thread Richard Biener
On December 29, 2014 3:04:36 PM CET, Thomas Preud'homme thomas.preudho...@arm.com wrote: Since 16bit byteswap can be done via an 8 bit rotation (and it is the canonical form), the check for an optab only serves to prevent the bswap optimization for targets that don't have a 16bit byteswap (but do

RE: [PATCH] Don't check for optab for 16bit bswap

2014-12-29 Thread Thomas Preud'homme
From: Richard Biener [mailto:rguent...@suse.de] Sent: Monday, December 29, 2014 5:09 PM OK, but what about targets without a rotation optab? Is the fallback expansion reasonable in all cases? To be honest I haven't checked. I thought being a treecode means it can always be expanded, using

RE: [PATCH] Don't check for optab for 16bit bswap

2014-12-29 Thread Oleg Endo
On Mon, 2014-12-29 at 17:53 +, Thomas Preud'homme wrote: From: Richard Biener [mailto:rguent...@suse.de] Sent: Monday, December 29, 2014 5:09 PM OK, but what about targets without a rotation optab? Is the fallback expansion reasonable in all cases? To be honest I haven't