-
Notifications
You must be signed in to change notification settings - Fork 1.6k
x64: Fix lowering rules for shld
#12321
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
x64: Fix lowering rules for shld
#12321
Conversation
These failed to account for the edge case of 0/width(type) shifts where the `shld` instruction is no longer applicable. Guards are added to ensure that the shift amounts are both greater than zero. This in theory shouldn't have much practical impact since shift-by-zero and shift-by-type-width are both optimized away in the mid-end. That means that this is only possible to expose with opt-level=0 which may help explain why this went undiscovered for ~1 year. Closes bytecodealliance#12318
|
@cfallin mind double-checking the Winch-specific commit I added? Looks like Winch's encoding of shift-by-32 was using the immediate form of the instruction but that's not compatible with AArch64's encoding so it ended up encoding an illegal instruction. |
cfallin
left a comment
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.
Latest commit to Winch looks fine too!
* x64: Fix lowering rules for `shld` These failed to account for the edge case of 0/width(type) shifts where the `shld` instruction is no longer applicable. Guards are added to ensure that the shift amounts are both greater than zero. This in theory shouldn't have much practical impact since shift-by-zero and shift-by-type-width are both optimized away in the mid-end. That means that this is only possible to expose with opt-level=0 which may help explain why this went undiscovered for ~1 year. Closes bytecodealliance#12318 * Fix Winch's encoding of shift-by-32
* x64: Fix lowering rules for `shld` These failed to account for the edge case of 0/width(type) shifts where the `shld` instruction is no longer applicable. Guards are added to ensure that the shift amounts are both greater than zero. This in theory shouldn't have much practical impact since shift-by-zero and shift-by-type-width are both optimized away in the mid-end. That means that this is only possible to expose with opt-level=0 which may help explain why this went undiscovered for ~1 year. Closes #12318 * Fix Winch's encoding of shift-by-32
* x64: Fix lowering rules for `shld` These failed to account for the edge case of 0/width(type) shifts where the `shld` instruction is no longer applicable. Guards are added to ensure that the shift amounts are both greater than zero. This in theory shouldn't have much practical impact since shift-by-zero and shift-by-type-width are both optimized away in the mid-end. That means that this is only possible to expose with opt-level=0 which may help explain why this went undiscovered for ~1 year. Closes bytecodealliance#12318 * Fix Winch's encoding of shift-by-32
* Fix ISLE optimization for vector inputs (#12179) Add some more `fits_in_64` constraints to types to handle the fact that `iconst_u` can't construct a 128-bit output. Closes #12170 * x64: Fix lowering rules for `shld` (#12321) * x64: Fix lowering rules for `shld` These failed to account for the edge case of 0/width(type) shifts where the `shld` instruction is no longer applicable. Guards are added to ensure that the shift amounts are both greater than zero. This in theory shouldn't have much practical impact since shift-by-zero and shift-by-type-width are both optimized away in the mid-end. That means that this is only possible to expose with opt-level=0 which may help explain why this went undiscovered for ~1 year. Closes #12318 * Fix Winch's encoding of shift-by-32 * Fix ISLE icmp optimization rules for vector inputs (#12335) Closes #12328 * Add release notes --------- Co-authored-by: Zijie Zhao <zzjas98@gmail.com>
These failed to account for the edge case of 0/width(type) shifts where the
shldinstruction is no longer applicable. Guards are added to ensure that the shift amounts are both greater than zero.This in theory shouldn't have much practical impact since shift-by-zero and shift-by-type-width are both optimized away in the mid-end. That means that this is only possible to expose with opt-level=0 which may help explain why this went undiscovered for ~1 year.
Closes #12318