mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-11-20 10:56:40 +03:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user