3 ms·
gcc will recognize the usual rotate idiom: unsigned int rotv(unsigned int x, int c) { return (x << c) | (x >> (32 - c)); } On x86 it emits a r
by pm215 8y ago
gcc will recognize the usual rotate idiom:
unsigned int rotv(unsigned int x, int c) {
return (x << c) | (x >> (32 - c));
}
On x86 it emits a rol instruction, for instance.