cranelift: Align Scalar and SIMD shift semantics#4520
cranelift: Align Scalar and SIMD shift semantics#4520jameysharp merged 5 commits intobytecodealliance:mainfrom
Conversation
Subscribe to Label ActionDetailsThis issue or pull request has been labeled: "cranelift", "cranelift:area:aarch64", "cranelift:area:x64", "cranelift:wasm", "isle"Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
jameysharp
left a comment
There was a problem hiding this comment.
I appreciate the way you split up these commits! I wish I could ask CI to test after each commit, but it looks plausible to me that the tests would all pass at every step.
I'm not comfortable reviewing the aarch64 and x64 changes with any confidence. They look reasonable to me but I think others should review them to be sure.
I think your changes to the runtests look great, with a nice range of tests to cover this behavior. And the cranelift-wasm changes seem obviously correct.
Last thing I'm wondering is whether this will affect any other users of Cranelift, like @bjorn3.
Group some SIMD operations by instruction.
Also, new tests with the mod behaviour
akirilov-arm
left a comment
There was a problem hiding this comment.
Someone else should have a look at the x64 bits.
cfallin
left a comment
There was a problem hiding this comment.
Looks great to me! Just a few nits below. The final payoff in simpler code in the Wasm translator is great to see.
👋 Hey,
In #4424 @uweigand reported that we have different semantics for scalar and SIMD shifts, which is unusual in our instruction set.
This PR corrects the AArch64 and x86 backends to mask the shift amount before performing SIMD shifts. The s390x backend should already follow this behavior.
It also reorganizes the
ishl/ushl/sshltests into separate files. Since we had a bunch of duplicate tests in hard to find files that were somewhat unrelated.I tried to keep changes contained in separate commits so that it's easier to review.
Fixes #4424
CC: @cfallin @abrown @uweigand @akirilov-arm