This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE: [PATCH] Fix bswap regression: expand 8bit rotations of 16bit values into bswaphi patterns
- From: "Thomas Preud'homme" <thomas dot preudhomme at arm dot com>
- To: "'Jakub Jelinek'" <jakub at redhat dot com>, "Jeff Law" <law at redhat dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>, "Richard Biener" <richard dot guenther at gmail dot com>
- Date: Fri, 7 Nov 2014 20:11:59 -0000
- Subject: RE: [PATCH] Fix bswap regression: expand 8bit rotations of 16bit values into bswaphi patterns
- Authentication-results: sourceware.org; auth=none
- References: <000101cffaa3$9be23460$d3a69d20$ at arm dot com> <545D2384 dot 6050103 at redhat dot com> <20141107200123 dot GS5026 at tucnak dot redhat dot com>
> From: Jakub Jelinek [mailto:jakub@redhat.com]
> Sent: Friday, November 07, 2014 8:01 PM
> > Why restrict this to 8 bit rotate of a 16 bit value? Shouldn't it apply to
> > a 16 bit rotate of a 32 bit value, or 32 bit rotate of 64 bit value?
>
> That isn't a byteswap, but halfword swap or wordswap.
> 32 bit byteswap reverses 0x01020304 byte ordering into 0x04030201,
> while rotate
> 16 is 0x03040102.
If this patch gets approved as is I'll add a comment to explain this as this is
the third time someone ask me this.
Best regards,
Thomas