Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize bitmask immediates #403

Merged
merged 1 commit into from Aug 12, 2022
Merged

Optimize bitmask immediates #403

merged 1 commit into from Aug 12, 2022

Conversation

kddnewton
Copy link

No description provided.

Copy link

@XrXr XrXr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! It's public domain code, but we might want to mention https://dougallj.wordpress.com/2021/10/30/bit-twiddling-optimising-aarch64-logical-immediate-encoding-and-decoding/ in the code though.

Also we should maybe test this more with a lookup table and such? Even though dougallj's version has have more eyes on it somethings might've gotten lost in translation.

@kddnewton
Copy link
Author

Ehh he pretty explicitly says no need to mention. I suppose I can put a comment in though.

We could add a lookup table, but I feel pretty confident with the existing test suite. I'll poke around a bit more though just to be super safe. I'll see if I can run it through https://gist.github.com/dinfuehr/51a01ac58c0b23e4de9aac313ed6a06a.

@XrXr
Copy link

XrXr commented Aug 12, 2022

Also the full version has some comments which we could copy over: https://gist.github.com/dougallj/97d8621d4542ba31e004acc8075fac14

Another testing idea for #[cfg(feature = "disasm")]: roll a random u64 and encode it if possible. Check the result against the disassembly.

@kddnewton
Copy link
Author

Okay I just tested every possible value.

test result: ok. 5354 passed; 0 failed; 0 ignored; 0 measured; 276 filtered out; finished in 0.27s

@kddnewton kddnewton merged commit 1f7b407 into yjit_backend_ir Aug 12, 2022
@kddnewton kddnewton deleted the opt-bitmask-imm branch August 12, 2022 18:02
noahgibbs pushed a commit that referenced this pull request Aug 25, 2022
noahgibbs pushed a commit that referenced this pull request Aug 25, 2022
noahgibbs pushed a commit that referenced this pull request Aug 25, 2022
noahgibbs pushed a commit that referenced this pull request Aug 25, 2022
k0kubun pushed a commit that referenced this pull request Aug 25, 2022
k0kubun pushed a commit that referenced this pull request Aug 25, 2022
k0kubun pushed a commit that referenced this pull request Aug 25, 2022
k0kubun pushed a commit that referenced this pull request Aug 25, 2022
k0kubun pushed a commit that referenced this pull request Aug 25, 2022
k0kubun pushed a commit that referenced this pull request Aug 26, 2022
noahgibbs pushed a commit that referenced this pull request Aug 26, 2022
k0kubun pushed a commit that referenced this pull request Aug 26, 2022
k0kubun pushed a commit that referenced this pull request Aug 29, 2022
k0kubun pushed a commit that referenced this pull request Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants