Re: rotr32 / rotl32 (wordops.h) in 2.4.x ?

From: Roman Zippel (
Date: Sun Oct 15 2000 - 16:40:54 EST


On Sun, 15 Oct 2000, Andi Kleen wrote:

> You can just use the coded out variant (x<<n | (x>>(sizeof(x)*8-n)))
> gcc is clever enough to turn it into an rotate when the CPU supports it.

Hmm, I just tried it and two things one should take care of here. 1. x
must be unsigned of course and 2. only gcc 2.95 can this do with a
nonconstant n.

bye, Roman

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

This archive was generated by hypermail 2b29 : Sun Oct 15 2000 - 21:00:29 EST