This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Recognize another way to express rotation


Marc Espie <espie@schutzenberger.liafa.jussieu.fr> writes:

> Xor can be used to encore rotations.  In fact, it may seem more
> natural for a hash function, e.g.,
> 
> 	i = (i << 2) ^ (i >> 30) ^ *n++;
> instead of
> 	i = ((i << 2) | (i >> 30)) ^ *n++;

Likewise you can use '+' rather than xor or ior.

-- 
Geoffrey Keating <geoffk@cygnus.com>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]