How to conditionally keep `equal floats using AVX intrinsics?
I have
__m256 valA = .....;
__m256 valB = .....;
__m256 aIsB = _mm256_cmp_ps( valA, valB, _CMP_EQ_OS );
After getting such a mask I intended to use
__m256 zeros = _mm256_set1_ps(0.0f)
__m256 same = _mm256_blend_ps(valA, zeros, aIsB);//<--aIsB must actually be imm8
however _mm256_blend_ps
requires mask to be a runtime compile constant.
Otherwise I would somehow need to cast __m256
into imm8
Should I use some other function?
Documentation: