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:
@@ -467,5 +467,24 @@ pub(crate) fn define(
|
||||
.operands_out(vec![a]),
|
||||
);
|
||||
|
||||
let x = &operand("x", TxN);
|
||||
let y = &operand("y", TxN);
|
||||
let f = &operand("f", iflags);
|
||||
ig.push(
|
||||
Inst::new(
|
||||
"x86_ptest",
|
||||
r#"
|
||||
Logical Compare -- PTEST will set the ZF flag if all bits in the result are 0 of the
|
||||
bitwise AND of the first source operand (first operand) and the second source operand
|
||||
(second operand). PTEST sets the CF flag if all bits in the result are 0 of the bitwise
|
||||
AND of the second source operand (second operand) and the logical NOT of the destination
|
||||
operand (first operand).
|
||||
"#,
|
||||
&formats.binary,
|
||||
)
|
||||
.operands_in(vec![x, y])
|
||||
.operands_out(vec![f]),
|
||||
);
|
||||
|
||||
ig.build()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user