Add SIMD bitselect instruction and x86 legalization
This new instructions matches the `bitselect` behavior described in the WASM SIMD spec (https://github.com/WebAssembly/simd/blob/master/proposals/simd/SIMD.md#bitwise-select)
This commit is contained in:
@@ -1199,6 +1199,22 @@ pub(crate) fn define(
|
||||
.operands_out(vec![a]),
|
||||
);
|
||||
|
||||
let c = &operand_doc("c", Any, "Controlling value to test");
|
||||
ig.push(
|
||||
Inst::new(
|
||||
"bitselect",
|
||||
r#"
|
||||
Conditional select of bits.
|
||||
|
||||
For each bit in `c`, this instruction selects the corresponding bit from `x` if the bit
|
||||
in `c` is 1 and the corresponding bit from `y` if the bit in `c` is 0. See also:
|
||||
`select`, `vselect`.
|
||||
"#,
|
||||
)
|
||||
.operands_in(vec![c, x, y])
|
||||
.operands_out(vec![a]),
|
||||
);
|
||||
|
||||
let x = &operand("x", Any);
|
||||
|
||||
ig.push(
|
||||
|
||||
Reference in New Issue
Block a user