alexcrichton opened PR #6874 from alexcrichton:remove-fmin-max-pseudo
to bytecodealliance:main
:
This commit removes these two instructions and replaces them instead with their equivalents using
fcmp
plusselect
orbitselect
depending on the type (bitselect
for vectors,select
for scalars). The motivation for this commit is that incorrect optimizations for these instructions were removed in #6859 and likely stemmed from the surprising definitions of these instructions. These originally were intended to correspond to operations in the SIMD proposal for WebAssembly but nowadays the functionality of these instructions is replaced with:
- Lowering from wasm to clif uses the
fcmp
plusselect
combo instruction.- Backends that support optimizing this pattern use ISLE patterns to match the instruction and emit the specialization for the pseudo semantics.
This means that while the instructions are removed here it should be the case that no functionality is lost and the output of Wasmtime/Cranelift should still be the same as it was before. Existing tests using the pseudo instructions were preserved except the riscv64 ones (where the lowering was deleted) and the dynamic AArch64 ones. Both s390x and x64 continue to have specialized patterns for this compare-plus-select.
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
alexcrichton requested elliottt for a review on PR #6874.
alexcrichton requested wasmtime-compiler-reviewers for a review on PR #6874.
fitzgen submitted PR review:
Nice!
fitzgen has enabled auto merge for PR #6874.
fitzgen merged PR #6874.
Last updated: Dec 23 2024 at 12:05 UTC