bytecodealliance / bytecodealliance/wasmtime

Change `bitselect`'s condition mask to always be integral

Open
#5,962 1 comment 0 reactions 0 assignees View on GitHub
cranelift:area:clif
Dominant language
Rust
Stars
18.6k
Forks
1.8k
Avg merge
1d 19h
Merged PRs (30d)
121

Description

This came up during https://github.com/bytecodealliance/wasmtime/pull/5918 and the removal of the old `vselect` instruction. Currently the `bitselect` instruction uses the same type for all of its inputs and its output, but that means that for a floating-point selection the condition mask is also a floating-point value which is typically not the case. For example an `icmp` would produce an integer vector which could be used to `bitselect` the results of the comparisons.

Using an integral mask would make the NaN-canonicalization for vectors slightly simpler and additionally make it easier to re-add the optimizations removed in https://github.com/bytecodealliance/wasmtime/pull/5918 where `bitselect`-of-`fcmp` for float vectors could be optimized into `f{min,max}` where possible.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.