#ifndef CV_DOXYGEN
+#ifndef CV_CPU_OPTIMIZATION_HAL_NAMESPACE
#ifdef CV_CPU_DISPATCH_MODE
#define CV_CPU_OPTIMIZATION_HAL_NAMESPACE __CV_CAT(hal_, CV_CPU_DISPATCH_MODE)
#define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN namespace __CV_CAT(hal_, CV_CPU_DISPATCH_MODE) {
#define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN namespace hal_baseline {
#define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END }
#endif
+#endif // CV_CPU_OPTIMIZATION_HAL_NAMESPACE
CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN
CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END
# undef CV_MSA
#endif
-#if CV_SSE2 || CV_NEON || CV_VSX || CV_MSA || CV_WASM_SIMD
+#if (CV_SSE2 || CV_NEON || CV_VSX || CV_MSA || CV_WASM_SIMD) && !defined(CV_FORCE_SIMD128_CPP)
#define CV__SIMD_FORWARD 128
#include "opencv2/core/hal/intrin_forward.hpp"
#endif
-#if CV_SSE2
+#if CV_SSE2 && !defined(CV_FORCE_SIMD128_CPP)
#include "opencv2/core/hal/intrin_sse_em.hpp"
#include "opencv2/core/hal/intrin_sse.hpp"
-#elif CV_NEON
+#elif CV_NEON && !defined(CV_FORCE_SIMD128_CPP)
#include "opencv2/core/hal/intrin_neon.hpp"
-#elif CV_VSX
+#elif CV_VSX && !defined(CV_FORCE_SIMD128_CPP)
#include "opencv2/core/hal/intrin_vsx.hpp"
-#elif CV_MSA
+#elif CV_MSA && !defined(CV_FORCE_SIMD128_CPP)
#include "opencv2/core/hal/intrin_msa.hpp"
-#elif CV_WASM_SIMD
+#elif CV_WASM_SIMD && !defined(CV_FORCE_SIMD128_CPP)
#include "opencv2/core/hal/intrin_wasm.hpp"
#else
return c;
}
+ v_reg& operator=(const v_reg<_Tp, n> & r)
+ {
+ for( int i = 0; i < n; i++ )
+ s[i] = r.s[i];
+ return *this;
+ }
+
_Tp s[n];
//! @endcond
};
inline v_reg<typename V_TypeTraits<_Tp>::abs_type, n> v_popcount(const v_reg<_Tp, n>& a)
{
v_reg<typename V_TypeTraits<_Tp>::abs_type, n> b = v_reg<typename V_TypeTraits<_Tp>::abs_type, n>::zero();
- for( int i = 0; i < n*sizeof(_Tp); i++ )
+ for (int i = 0; i < n*(int)sizeof(_Tp); i++)
b.s[i/sizeof(_Tp)] += popCountTable[v_reinterpret_as_u8(a).s[i]];
return b;
}
#include "test_precomp.hpp"
#include "test_intrin128.simd.hpp"
+
+// see "test_intrin_emulator.cpp"
+// see "opencv2/core/private/cv_cpu_include_simd_declarations.hpp"
+#define CV_CPU_OPTIMIZATION_DECLARATIONS_ONLY
+#undef CV_CPU_OPTIMIZATION_NAMESPACE_BEGIN
+#undef CV_CPU_OPTIMIZATION_NAMESPACE_END
+#define CV_CPU_OPTIMIZATION_NAMESPACE_BEGIN namespace opt_EMULATOR_CPP {
+#define CV_CPU_OPTIMIZATION_NAMESPACE_END }
+#include "test_intrin128.simd.hpp"
+#undef CV_CPU_OPTIMIZATION_NAMESPACE_BEGIN
+#undef CV_CPU_OPTIMIZATION_NAMESPACE_END
+#undef CV_CPU_OPTIMIZATION_DECLARATIONS_ONLY
+
#include "test_intrin128.simd_declarations.hpp"
#undef CV_CPU_DISPATCH_MODES_ALL
namespace opencv_test { namespace hal {
+#define CV_CPU_CALL_CPP_EMULATOR_(fn, args) return (opt_EMULATOR_CPP::fn args)
+
#define CV_CPU_CALL_BASELINE_(fn, args) CV_CPU_CALL_BASELINE(fn, args)
#define DISPATCH_SIMD128(fn, cpu_opt) do { \
namespace intrin128 {
+DEFINE_SIMD_TESTS(128, CPP_EMULATOR)
+
DEFINE_SIMD_TESTS(128, BASELINE)
#if defined CV_CPU_DISPATCH_COMPILE_SSE2 || defined CV_CPU_BASELINE_COMPILE_SSE2
--- /dev/null
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+#include "test_precomp.hpp"
+
+// see "opencv2/core/hal/intrin.hpp"
+#define CV_CPU_OPTIMIZATION_HAL_NAMESPACE hal_EMULATOR_CPP
+#define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN namespace hal_EMULATOR_CPP {
+#define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END }
+
+// see "opencv2/core/private/cv_cpu_include_simd_declarations.hpp"
+//#define CV_CPU_OPTIMIZATION_DECLARATIONS_ONLY
+#define CV_FORCE_SIMD128_CPP
+#undef CV_CPU_OPTIMIZATION_NAMESPACE_BEGIN
+#undef CV_CPU_OPTIMIZATION_NAMESPACE_END
+#define CV_CPU_OPTIMIZATION_NAMESPACE_BEGIN namespace opt_EMULATOR_CPP {
+#define CV_CPU_OPTIMIZATION_NAMESPACE_END }
+#include "test_intrin128.simd.hpp"
+#undef CV_CPU_OPTIMIZATION_NAMESPACE_BEGIN
+#undef CV_CPU_OPTIMIZATION_NAMESPACE_END
+#undef CV_CPU_DISPATCH_MODE
+#undef CV_FORCE_SIMD128_CPP
+
+// tests implementation is in test_intrin_utils.hpp