-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
pulley: Add some macro-instructions related to bounds-checks #9943
pulley: Add some macro-instructions related to bounds-checks #9943
Conversation
This commit starts down the path of optimizing wasm loads/stores in Pulley with macro-instructions. It's expected that these instructions are so common that it's worth putting them in the 1-byte namespace of opcodes. Locally this gets a 10% speedup on the sightglass bz2 benchmark.
This additionally shrinks spidermonkey.cwasm from 28M to 21M |
Subscribe to Label Actioncc @fitzgen
This issue or pull request has been labeled: "cranelift", "pulley"
Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
;; wasm[0]::function[0]::load8: | ||
;; push_frame | ||
;; xload32le_offset8 x6, x0, 52 | ||
;; br_if_xulteq32 x6, x2, 0x14 // target = 0x19 |
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.
We don't want this one to use the new xbc
macro-op?
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.
No we probably do but I wanted to add this here for complete-ness to show that it's not currently using the new op. One-byte loads/stores are generated a bit differently with bounds checks and use a >=
condition instead of >
+ arithmetic to test whether something is out of bounds. That made it so it doesn't fall into the patterns I added and would need a specific opcode just for the one-byte access. I figured it's probably fine to leave that off for now and add in the future if necessary
This commit starts down the path of optimizing wasm loads/stores in Pulley with macro-instructions. It's expected that these instructions are so common that it's worth putting them in the 1-byte namespace of opcodes.
Locally this gets a 10% speedup on the sightglass bz2 benchmark.