> +/* Given an unsigned 16-bit argument X, return the value corresponding > + to rotating the bits N steps to the left. N must be between 1 to > + 15 inclusive. */ > +static inline uint16_t > +rotl16 (uint16_t x, int n) > +{ > + return ((x << n) | (x >> (16 - n))) & 0xFFFFFFFF; > +}
& 0xFFFF; > +/* Given an unsigned 16-bit argument X, return the value corresponding > + to rotating the bits N steps to the right. N must be in 1 to 15 > + inclusive. */ > +static inline uint16_t > +rotr16 (uint16_t x, int n) > +{ > + return ((x >> n) | (x << (16 - n))) & 0xFFFFFFFF; > +} Likewise. I'd also double-check at least on i686-pc-linux-gnu that GCC does generate ro{l,r}{w,l} instructions. Paolo