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

2015-01-23 Thread Richard Biener
On Thu, 22 Jan 2015, Richard Henderson wrote: > On 01/21/2015 11:52 PM, Richard Biener wrote: > > On January 21, 2015 10:23:56 PM CET, Richard Henderson > > 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 >

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. Alternate

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

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 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 that d

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

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-21 Thread H.J. Lu
On Mon, Jan 5, 2015 at 1:09 PM, Richard Biener wrote: > On January 5, 2015 3:54:40 PM CET, 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 >>>

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

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 do

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 > > .L4

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 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,

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 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 >fallback >>

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 have

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, us

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 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 >ins

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

2014-12-29 Thread Thomas Preud'homme
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). See PR63259 (comments 6 and onwards) for more details. Ch