Does Julia has bitwise circular shift?

Actually, it appears to be just as fast as an ordinary bitshift. It seems that the compiler is smart enough to optimize it into a single bitrotate operation (from Circular shift - Wikipedia):

Unfortunately, many programming languages, including C, do not have operators or standard functions for circular shifting, even though virtually all processors have bitwise operation instructions for it […] some constructs in standard ANSI C code may be optimized by a compiler to the “rotate” assembly language instruction

3 Likes