This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Mode change for bswap pattern expansion
- From: pinskia at gmail dot com
- To: Paulo Matos <pmatos at broadcom dot com>
- Cc: Richard Sandiford <rsandifo at linux dot vnet dot ibm dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Mon, 27 Jan 2014 10:24:35 -0800
- Subject: Re: Mode change for bswap pattern expansion
- Authentication-results: sourceware.org; auth=none
- References: <19EB96622A777C4AB91610E763265F463F12AC at SJEXCHMB14 dot corp dot ad dot broadcom dot com> <877g9ltnoj dot fsf at sandifor-thinkpad dot stglab dot manchester dot uk dot ibm dot com> <19EB96622A777C4AB91610E763265F463F15EE at SJEXCHMB14 dot corp dot ad dot broadcom dot com> <87vbx5s735 dot fsf at sandifor-thinkpad dot stglab dot manchester dot uk dot ibm dot com> <19EB96622A777C4AB91610E763265F463F1731 at SJEXCHMB14 dot corp dot ad dot broadcom dot com>
On Jan 27, 2014, at 8:59 AM, Paulo Matos <pmatos@broadcom.com> wrote:
>> -----Original Message-----
>> From: Richard Sandiford [mailto:rsandifo@linux.vnet.ibm.com]
>> Sent: 27 January 2014 16:50
>> To: Paulo Matos
>> Cc: gcc@gcc.gnu.org
>> Subject: Re: Mode change for bswap pattern expansion
>>
>> Sorry, I meant we use an unspec for the first ("V2HI") rotate.
>> I.e. rather than:
>>
>> (set (subreg:V2HI (match_dup 2) 0)
>> (rotate:V2HI (subreg:V2HI (match_dup 1) 0)
>> (const_int 8)))
>> (set (match_dup 0)
>> (rotate:SI (match_dup 2)
>> (const_int 16)))
>>
>> we have:
>>
>> (set (match_dup 2) (unspec:SI [(match_dup 1)] UNSPEC_FOO))
>> (set (match_dup 0)
>> (rotate:SI (match_dup 2)
>> (const_int 16)))
>>
>> In your case the define_insn for the UNSPEC_FOO pattern would have the
>> same attributes as a V2HI rotate, so it should get scheduled in the same way.
>
> In that case it would work. My only concern would then be if it prevents further optimizations. On the other hand I am not sure if GCC would try to optimize a rotate with vector V2HI mode...
> Might give both solutions a try and see what results I get.
Maybe do a split after reload instead?
Thanks,
Andrew
>
> Thanks,
>
> Paulo Matos
>
>> Thanks,
>> Richard
>