Skip to content

Commit

Permalink
Add cmpeq/cmpneq support for AVX
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier HARTMANN committed Mar 20, 2018
1 parent bf5b03a commit 95de17b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
10 changes: 10 additions & 0 deletions src/mipp_impl_AVX.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -1834,6 +1834,16 @@
inline msk cmpeq<int8_t>(const reg v1, const reg v2) {
return _mm256_cmpeq_epi8(_mm256_castps_si256(v1), _mm256_castps_si256(v2));
}
#else
template <>
inline msk cmpeq<int64_t>(const reg v1, const reg v2) {
return cmpeq<double>(v1, v2);
}

template <>
inline msk cmpeq<int32_t>(const reg v1, const reg v2) {
return cmpeq<float>(v1, v2);
}
#endif

// --------------------------------------------------------------------------------------------------------- cmpneq
Expand Down
4 changes: 0 additions & 4 deletions tests/src/sub_tests/operation/comparison/cmpeq/CmpeqTest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,23 @@ class CmpeqTest : public CppUnit::TestFixture
CPPUNIT_TEST(test_Reg_cmpeq_int16);
#endif

#if !defined(MIPP_AVX) || (defined(MIPP_AVX) && MIPP_INSTR_VERSION >= 2)
#ifndef MIPP_NO
CPPUNIT_TEST(test_reg_cmpeq_int32);
#endif
CPPUNIT_TEST(test_Reg_cmpeq_int32);
#endif

#ifndef MIPP_NO
CPPUNIT_TEST(test_reg_cmpeq_float);
#endif
CPPUNIT_TEST(test_Reg_cmpeq_float);

#if defined(MIPP_64BIT)
#if !defined(MIPP_AVX) || (defined(MIPP_AVX) && MIPP_INSTR_VERSION >= 2)
#if !defined(MIPP_SSE) || (defined(MIPP_SSE) && MIPP_INSTR_VERSION >= 41)
#ifndef MIPP_NO
CPPUNIT_TEST(test_reg_cmpeq_int64);
#endif
CPPUNIT_TEST(test_Reg_cmpeq_int64);
#endif
#endif

#ifndef MIPP_NO
CPPUNIT_TEST(test_reg_cmpeq_double);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,23 @@ class CmpneqTest : public CppUnit::TestFixture
CPPUNIT_TEST(test_Reg_cmpneq_int16);
#endif

#if !defined(MIPP_AVX) || (defined(MIPP_AVX) && MIPP_INSTR_VERSION >= 2)
#ifndef MIPP_NO
CPPUNIT_TEST(test_reg_cmpneq_int32);
#endif
CPPUNIT_TEST(test_Reg_cmpneq_int32);
#endif

#ifndef MIPP_NO
CPPUNIT_TEST(test_reg_cmpneq_float);
#endif
CPPUNIT_TEST(test_Reg_cmpneq_float);

#if defined(MIPP_64BIT)
#if !defined(MIPP_AVX) || (defined(MIPP_AVX) && MIPP_INSTR_VERSION >= 2)
#if !defined(MIPP_SSE) || (defined(MIPP_SSE) && MIPP_INSTR_VERSION >= 41)
#ifndef MIPP_NO
CPPUNIT_TEST(test_reg_cmpneq_int64);
#endif
CPPUNIT_TEST(test_Reg_cmpneq_int64);
#endif
#endif

#ifndef MIPP_NO
CPPUNIT_TEST(test_reg_cmpneq_double);
Expand Down

0 comments on commit 95de17b

Please sign in to comment.