[PATCH 5/14] i386 / Use early clobber to eliminate rotate in desc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alan Cox wrote:
> On Maw, 2005-08-16 at 17:06 -0700, H. Peter Anvin wrote:
> 
>>At least i386 and x86-64 gcc should recognize
>>
>>	((foo << x) + (foo >> (32-x)))
>>
>>... as a 32-bit rotate
> 
> 
> Only for  1 <= x <= 31. For the x = 0 case the code posted is undefined
> and at least in some cases gcc will do "interesting" things as a result
> such as treating >> 32 as >> 0.
> 

True, although I thought gcc considered the above an idiom and would 
generate a rotate instruction.  Perhaps it should be | rather than +.

	-hpa

[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux