Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testz() not working properly on AVX512 #43

Open
geehang opened this issue Jun 7, 2022 · 0 comments
Open

testz() not working properly on AVX512 #43

geehang opened this issue Jun 7, 2022 · 0 comments
Labels

Comments

@geehang
Copy link

geehang commented Jun 7, 2022

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

@geehang geehang changed the title testz() not working properly in AVX512 testz() not working properly on AVX512 Jun 7, 2022
@kouchy kouchy added the bug label Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants