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

2005-08-17 Thread H. Peter Anvin
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

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

2005-08-17 Thread Alan Cox
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

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

2005-08-17 Thread Alan Cox
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

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

2005-08-17 Thread H. Peter Anvin
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

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

2005-08-16 Thread H. Peter Anvin
Zachary Amsden wrote: This one in particular is non-optimal looking from C because the compiler misses the potential for rotation. But, composing into temporaries and then issuing two writes to memory instead of multiple writes within the same word could actually get you a better cycle

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

2005-08-16 Thread Zachary Amsden
Andi Kleen wrote: On Wed, Aug 10, 2005 at 09:54:11PM -0700, [EMAIL PROTECTED] wrote: Use an early clobber on addr to avoid the extra rorl instruction at the end of _set_tssldt_desc. I would suggest to just use C for this. I do this on x86-64 and I don't think there is any reason to

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

2005-08-16 Thread Andi Kleen
On Wed, Aug 10, 2005 at 09:54:11PM -0700, [EMAIL PROTECTED] wrote: > Use an early clobber on addr to avoid the extra rorl instruction at the > end of _set_tssldt_desc. I would suggest to just use C for this. I do this on x86-64 and I don't think there is any reason to use this hard to maintain

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

2005-08-16 Thread Andi Kleen
On Wed, Aug 10, 2005 at 09:54:11PM -0700, [EMAIL PROTECTED] wrote: Use an early clobber on addr to avoid the extra rorl instruction at the end of _set_tssldt_desc. I would suggest to just use C for this. I do this on x86-64 and I don't think there is any reason to use this hard to maintain

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

2005-08-16 Thread Zachary Amsden
Andi Kleen wrote: On Wed, Aug 10, 2005 at 09:54:11PM -0700, [EMAIL PROTECTED] wrote: Use an early clobber on addr to avoid the extra rorl instruction at the end of _set_tssldt_desc. I would suggest to just use C for this. I do this on x86-64 and I don't think there is any reason to

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

2005-08-16 Thread H. Peter Anvin
Zachary Amsden wrote: This one in particular is non-optimal looking from C because the compiler misses the potential for rotation. But, composing into temporaries and then issuing two writes to memory instead of multiple writes within the same word could actually get you a better cycle