Subject: Re: [RFC] enhanced version of net_random()

From: Andi Kleen <[email-masked]>
Date: Sun, 22 Aug 2004 17:04:14 +0200

On Fri, 20 Aug 2004 12:48:23 -0700
"David S. Miller" <[email-masked]> wrote:

> > I wouldn't suggest converting it to 'C' because the rotation
> > takes many CPU instructions when one tries to do the test, shift,
> > and OR in 'C',
> 
> You only need 2 'shifts' and an 'or' to do a rotate in C.
> No tests are needed.

gcc is clever enough to detect the common C patterns for rotate
and generate a real ROL when the CPU supports it.

-Andi