Skip to content

testz() not working properly on AVX512 #43

Description

@geehang

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions