From 95de17ba7adf66048dcc1ea97f4eddb4a6bccda8 Mon Sep 17 00:00:00 2001 From: Olivier HARTMANN Date: Tue, 20 Mar 2018 11:22:24 +0100 Subject: [PATCH] Add cmpeq/cmpneq support for AVX --- src/mipp_impl_AVX.hxx | 10 ++++++++++ .../sub_tests/operation/comparison/cmpeq/CmpeqTest.hpp | 4 ---- .../operation/comparison/cmpneq/CmpneqTest.hpp | 4 ---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/mipp_impl_AVX.hxx b/src/mipp_impl_AVX.hxx index fdb2869..e8b87f9 100644 --- a/src/mipp_impl_AVX.hxx +++ b/src/mipp_impl_AVX.hxx @@ -1834,6 +1834,16 @@ inline msk cmpeq(const reg v1, const reg v2) { return _mm256_cmpeq_epi8(_mm256_castps_si256(v1), _mm256_castps_si256(v2)); } +#else + template <> + inline msk cmpeq(const reg v1, const reg v2) { + return cmpeq(v1, v2); + } + + template <> + inline msk cmpeq(const reg v1, const reg v2) { + return cmpeq(v1, v2); + } #endif // --------------------------------------------------------------------------------------------------------- cmpneq diff --git a/tests/src/sub_tests/operation/comparison/cmpeq/CmpeqTest.hpp b/tests/src/sub_tests/operation/comparison/cmpeq/CmpeqTest.hpp index 4d9c95d..09209a5 100644 --- a/tests/src/sub_tests/operation/comparison/cmpeq/CmpeqTest.hpp +++ b/tests/src/sub_tests/operation/comparison/cmpeq/CmpeqTest.hpp @@ -19,12 +19,10 @@ 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); @@ -32,14 +30,12 @@ class CmpeqTest : public CppUnit::TestFixture 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); diff --git a/tests/src/sub_tests/operation/comparison/cmpneq/CmpneqTest.hpp b/tests/src/sub_tests/operation/comparison/cmpneq/CmpneqTest.hpp index 8b0e764..6fb424f 100644 --- a/tests/src/sub_tests/operation/comparison/cmpneq/CmpneqTest.hpp +++ b/tests/src/sub_tests/operation/comparison/cmpneq/CmpneqTest.hpp @@ -19,12 +19,10 @@ 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); @@ -32,14 +30,12 @@ class CmpneqTest : public CppUnit::TestFixture 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);