Mail Archives: djgpp/1997/09/09/16:47:02
On 9 Sep 97 at 10:37, Hargreaves, Shawn wrote:
> I'm in awe of whoever wrote the code to perform that particular type
> of optimisation: it's easy enough to do by hand for a specific case,
> but making the compiler do it for any arbitrary expression can't
> have been easy :-)
There's also:
unsigned rotate_left_by_5(unsigned y)
{
return (y<<5)|(y>>(32-5));
}
this will go to (-O2 -fomit-frame-pointer):
_rotate_left:
movl 4(%esp),%eax
roll $5,%eax
ret
Personaly, I find that one more impressive.
Bill
--
Leave others their otherness.
- Raw text -