I noticed the following code in the rotate function:
static uint64 Rotate(uint64 val, int shift)
{
// Avoid shifting by 64: doing so yields an undefined result.
return shift == 0 ? val : ((val >> shift) | (val << (64 - shift)));
}
Wouldn't it be faster to do an additional bitwise-and instead of introducing
branching? For example:
return ( (val >> shift) | ( val << ((64 - shift) & 63) ) );
Original issue reported on code.google.com by alfonsla...@gmail.com on 13 Feb 2013 at 12:36
Original issue reported on code.google.com by
alfonsla...@gmail.com
on 13 Feb 2013 at 12:36