Native Rotation Intrinsic Optimization#37
Open
NCGThompson wants to merge 2 commits into
Open
Conversation
Contributor
Author
|
On an only somewhat related note. It's worth considering totally getting rid of the llvm intrinsics for |
Contributor
Author
|
My last commit made it slower in some circumstances but faster in others. However, I think it its overall a bit better than the 64-bit rotation version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I removed some redundancies in
rol3. On generic x86_64, the rotate left short benchmark got a 44% time reduction to 4.25ns and rotate left long got 34% improvement to 4.6ns. On the same computer withtarget-cpu=skylake, both benchmark times got approximately halved to 3.45ns. Hopefully native rol3 is called more than 2 * 10^13 times in the future so my time spent was worth while.I marked it draft because two things need to happen:
ror3needs to be optimized as well. I set to just negateband callrol3. This is still an improvement over the status quo, but on generic x86_64, rotate right gets considerably worse benchmark scores than rotate rotate left. My only hypothesis is that the negation tips it over the edge of an inlining threshold. I'll give it its own mirror ofrol3.