-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Implement a few minor optimizations around 128-bit integers #9136
Merged
Conversation
This file contains 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
This commit implements a few minor changes for `i128` in both the egraph optimizations and lowerings for x64. The optimization pass will now transform `iconcat` into a `uextend` or `sextend` where appropriate. The x64 backend then pattern-matches this to produce slightly more optimal machine code. Additionally the x64 backend now handles memory/immediate operands a bit better when the argument to a 128-bit operation is an `iconcat`.
elliottt
approved these changes
Aug 16, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
alexcrichton
added a commit
to alexcrichton/wasmtime
that referenced
this pull request
Aug 19, 2024
This commit is similar to bytecodealliance#8976 where it's fixing some typos in the encoding of the `adc` and `sbb` instructions used in Cranelift. These appear to have copy/paste typos where the non-register-based opcodes weren't updated from the `add` and `sub` opcodes. This problem was exposed from a fuzz test case after bytecodealliance#9136 landed. The fuzz test case is minimized and included here as a new runtest and new emit tests are additionally added.
github-merge-queue bot
pushed a commit
that referenced
this pull request
Aug 19, 2024
This commit is similar to #8976 where it's fixing some typos in the encoding of the `adc` and `sbb` instructions used in Cranelift. These appear to have copy/paste typos where the non-register-based opcodes weren't updated from the `add` and `sub` opcodes. This problem was exposed from a fuzz test case after #9136 landed. The fuzz test case is minimized and included here as a new runtest and new emit tests are additionally added.
alexcrichton
added a commit
to alexcrichton/wasmtime
that referenced
this pull request
Sep 5, 2024
This commit adds a special case to the lowering of 128-bit multiplication on the aarch64 backend along the same lines as was done in bytecodealliance#9136 for the x64 backend. Notably zero and sign-extended values which are multiplied to produce a 128-bit result can skip some of the arithmetic of the fully general 128-bit lowering.
github-merge-queue bot
pushed a commit
that referenced
this pull request
Sep 6, 2024
This commit adds a special case to the lowering of 128-bit multiplication on the aarch64 backend along the same lines as was done in #9136 for the x64 backend. Notably zero and sign-extended values which are multiplied to produce a 128-bit result can skip some of the arithmetic of the fully general 128-bit lowering.
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.
This commit implements a few minor changes for
i128
in both the egraph optimizations and lowerings for x64. The optimization pass will now transformiconcat
into auextend
orsextend
where appropriate. The x64 backend then pattern-matches this to produce slightly more optimal machine code. Additionally the x64 backend now handles memory/immediate operands a bit better when the argument to a 128-bit operation is aniconcat
.