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:
Andrew Brown
2019-10-18 15:35:27 -07:00
parent 873465e7a9
commit 186effc420
8 changed files with 89 additions and 0 deletions

View File

@@ -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(