I'm posting here to make sure what I'm doing is ok.
I've been going through questions asking about bitwise rotation, and adding comments with a link to a community-wiki question with a community-wiki answer.
I kind of re-purposed that question, rather than the newer question where I posted a more detailed answer, partly because both the question and answer were community-wiki, so I felt justified in changing them. My goal here is to increase the chance that people will copy-paste rotate code into their apps that compiles to a single instruction, rather than a branch or cmov like gcc makes for the code from Wikipedia. If I was doing this for rep, I'd be linking directly to my answer, not the community-wiki answer.
The next-best option would have been to post a question and answer it myself, right? Rather than change the code in the high-voted and accepted non-wiki answer on another question.
Trying to mark all the how-do-I-bitwise-rotate questions as duplicates of one best-practices answer seems unlikely to work. It's unlikely that 4 more people will come along and mark it, too.
Questions I've touched so far:
Best practices for circular shift (rotate) operations in C++. (the community-wiki Q&A) Editted question title. Replaced contents of the accepted answer with a short version that doesn't ramble on too much, and a link to my longer answer.
Near constant time rotate that does not violate the standards. Where I originally left my long answer (which is unfortunately not the accepted answer on that Q).
How to perform rotate shift in C. (edited link into the accepted answer, but didn't touch its code. Also left my own answer, which I should prob. delete. I did that before finding the community-wiki question which some other questions already had links to.)
- Bitwise rotate left function (edited link into the accepted answer, didn't touch code).
- Rotate left in C/C++ left a comment
- How does the x86 ROR instruction works? left a comment
- Problem with Bitwise Barrel Shift Rotate left and right in C# (yes, I did notice this was C#, not C/C++).
- Rotate right by n only using bitwise operators in C left a comment in case someone ends up at this weird hands-tied-behind-your-back question which wanted rotates without casting to unsigned.
- Why don't we have bitwise rotate operators in C/C++? left a comment
- Bitwise Rotate Right left a comment
- bitwise rotate operation for arduino left a comment