Added the following mask tests: __any(), __all(), __none() for all supported targets.

This allows for more efficient code generation of KNC.
This commit is contained in:
Jean-Luc Duprat
2012-09-14 11:06:18 -07:00
parent 4ecdbe4bd9
commit f0b0618484
15 changed files with 355 additions and 13 deletions

View File

@@ -297,6 +297,18 @@ static FORCEINLINE uint32_t __movmsk(__vec32_i1 mask) {
return ((m1<<16)|m2);
}
static FORCEINLINE uint32_t __any(__vec32_i1 mask) {
return (mask.m!=0);
}
static FORCEINLINE uint32_t __all(__vec32_i1 mask) {
return (mask.m==0xFFFFFFFF);
}
static FORCEINLINE uint32_t __none(__vec32_i1 mask) {
return (mask.m==0x0);
}
static FORCEINLINE __vec32_i1 __equal(__vec32_i1 a, __vec32_i1 b) {
__vec32_i1 ret;
ret.m16.m1 = _mm512_knot(_mm512_kandn(a.m16.m1, b.m16.m1));