avx512: add basic functions to simd_utils

Extends the m512 type to use avx512 and also changes required
for limex.
This commit is contained in:
Matthew Barr
2016-07-20 11:31:34 +10:00
parent fedd48489f
commit 8a56d16d57
11 changed files with 258 additions and 53 deletions

View File

@@ -62,4 +62,17 @@ u32 packedExtract256(m256 s, const m256 permute, const m256 compare) {
}
#endif // AVX2
#if defined(HAVE_AVX512)
static really_inline
u32 packedExtract512(m512 s, const m512 permute, const m512 compare) {
// vpshufb doesn't cross lanes, so this is a bit of a cheat
m512 shuffled = pshufb_m512(s, permute);
m512 compared = and512(shuffled, compare);
u64a rv = ~eq512mask(compared, shuffled);
// stitch the lane-wise results back together
rv = rv >> 32 | rv;
return (u32)(((rv >> 16) | rv) & 0xffffU);
}
#endif // AVX512
#endif // LIMEX_SHUFFLE_H