MIPP
MIPP copied to clipboard
testz() not working properly on AVX512
The result of testz(m_not) is incorrect. It should be 1 instead of 0. The result is correct on AVX2.
Code:
std::cout << mipp::InstructionFullType << std::endl;
using T = int16_t;
constexpr auto N = mipp::N<T>();
cout << "N = " << N << endl;
Msk<N> m = true;
cout << "m = " << m << "\n";
cout << "testz(m) = " << mipp::testz(m) << "\n";
Msk<N> m_not = ~m; // & true;
cout << "m_not = " << m_not << "\n";
cout << "testz(m_not) = " << mipp::testz(m_not) << "\n";
Result:
AVX512 N = 32 m = [ 1, 1, 1, 1, 1, 1, 1, 1 | 1, 1, 1, 1, 1, 1, 1, 1 | 1, 1, 1, 1, 1, 1, 1, 1 | 1, 1, 1, 1, 1, 1, 1, 1] testz(m) = 0 m_not = [ 0, 0, 0, 0, 0, 0, 0, 0 | 0, 0, 0, 0, 0, 0, 0, 0 | 0, 0, 0, 0, 0, 0, 0, 0 | 0, 0, 0, 0, 0, 0, 0, 0] testz(m_not) = 0