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: [PATCH] Fix bswap regression: expand 8bit rotations of 16bit values into bswaphi patterns


On 11/07/14 13:11, Thomas Preud'homme wrote:
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.
Then I don't feel like such a bloody idiot after reading Jakub's reply :-)

Jeff


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