Add x86 SIMD vany_true and x86_ptest
In order to implement SIMD's any_true (https://github.com/WebAssembly/simd/blob/master/proposals/simd/SIMD.md#any-lane-true), we must legalize some instruction (I chose `vany_true`) to a sequence of `PTEST` and `SETNZ`. To emit `PTEST` I added the new CLIF instruction `x86_ptest` and used CLIF's `trueif ne` for `SETNZ`.
This commit is contained in:
@@ -1623,6 +1623,22 @@ pub(crate) fn define(
|
||||
.operands_out(vec![a]),
|
||||
);
|
||||
|
||||
let s = &operand("s", b1);
|
||||
|
||||
ig.push(
|
||||
Inst::new(
|
||||
"vany_true",
|
||||
r#"
|
||||
Reduce a vector to a scalar boolean.
|
||||
|
||||
Return a scalar boolean true if any lane in ``a`` is non-zero, false otherwise.
|
||||
"#,
|
||||
&formats.unary,
|
||||
)
|
||||
.operands_in(vec![a])
|
||||
.operands_out(vec![s]),
|
||||
);
|
||||
|
||||
let x = &operand("x", &TxN.lane_of());
|
||||
|
||||
ig.push(
|
||||
|
||||
Reference in New Issue
Block a user