Hacker News new | ask | show | jobs
by ncmncm 1587 days ago
> gcc doesn’t have a rotation intrinsic, so I couldn’t try it there

Gcc and Clang both recognize the pattern of shifts and OR that reproduce a rotation, and substitute the actual instruction, no intrinsic needed.

I bet MSVC does too.

1 comments

They recognize how to do a rotation of an unsigned integer value, but they do not recognize how to do the rotation of that value concatenated with the carry bit, which is needed here.