@ -60,255 +60,72 @@
// access from within opencv code more accessible
namespace cv {
# ifndef CV_DOXYGEN
# 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_END }
# else
# define CV_CPU_OPTIMIZATION_HAL_NAMESPACE hal_baseline
# define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN namespace hal_baseline {
# define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END }
# endif
CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN
CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END
using namespace CV_CPU_OPTIMIZATION_HAL_NAMESPACE ;
CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN
# endif
//! @addtogroup core_hal_intrin
//! @{
//! @cond IGNORED
template < typename _Tp > struct V_TypeTraits
{
typedef _Tp int_type ;
typedef _Tp uint_type ;
typedef _Tp abs_type ;
typedef _Tp sum_type ;
enum { delta = 0 , shift = 0 } ;
static int_type reinterpret_int ( _Tp x ) { return x ; }
static uint_type reinterpet_uint ( _Tp x ) { return x ; }
static _Tp reinterpret_from_int ( int_type x ) { return ( _Tp ) x ; }
} ;
template < > struct V_TypeTraits < uchar >
{
typedef uchar value_type ;
typedef schar int_type ;
typedef uchar uint_type ;
typedef uchar abs_type ;
typedef int sum_type ;
typedef ushort w_type ;
typedef unsigned q_type ;
enum { delta = 128 , shift = 8 } ;
static int_type reinterpret_int ( value_type x ) { return ( int_type ) x ; }
static uint_type reinterpret_uint ( value_type x ) { return ( uint_type ) x ; }
static value_type reinterpret_from_int ( int_type x ) { return ( value_type ) x ; }
} ;
template < > struct V_TypeTraits < schar >
{
typedef schar value_type ;
typedef schar int_type ;
typedef uchar uint_type ;
typedef uchar abs_type ;
typedef int sum_type ;
typedef short w_type ;
typedef int q_type ;
enum { delta = 128 , shift = 8 } ;
static int_type reinterpret_int ( value_type x ) { return ( int_type ) x ; }
static uint_type reinterpret_uint ( value_type x ) { return ( uint_type ) x ; }
static value_type reinterpret_from_int ( int_type x ) { return ( value_type ) x ; }
} ;
template < > struct V_TypeTraits < ushort >
{
typedef ushort value_type ;
typedef short int_type ;
typedef ushort uint_type ;
typedef ushort abs_type ;
typedef int sum_type ;
typedef unsigned w_type ;
typedef uchar nu_type ;
enum { delta = 32768 , shift = 16 } ;
static int_type reinterpret_int ( value_type x ) { return ( int_type ) x ; }
static uint_type reinterpret_uint ( value_type x ) { return ( uint_type ) x ; }
static value_type reinterpret_from_int ( int_type x ) { return ( value_type ) x ; }
} ;
template < > struct V_TypeTraits < short >
{
typedef short value_type ;
typedef short int_type ;
typedef ushort uint_type ;
typedef ushort abs_type ;
typedef int sum_type ;
typedef int w_type ;
typedef uchar nu_type ;
typedef schar n_type ;
enum { delta = 128 , shift = 8 } ;
static int_type reinterpret_int ( value_type x ) { return ( int_type ) x ; }
static uint_type reinterpret_uint ( value_type x ) { return ( uint_type ) x ; }
static value_type reinterpret_from_int ( int_type x ) { return ( value_type ) x ; }
} ;
template < > struct V_TypeTraits < unsigned >
{
typedef unsigned value_type ;
typedef int int_type ;
typedef unsigned uint_type ;
typedef unsigned abs_type ;
typedef unsigned sum_type ;
typedef uint64 w_type ;
typedef ushort nu_type ;
static int_type reinterpret_int ( value_type x ) { return ( int_type ) x ; }
static uint_type reinterpret_uint ( value_type x ) { return ( uint_type ) x ; }
static value_type reinterpret_from_int ( int_type x ) { return ( value_type ) x ; }
} ;
template < > struct V_TypeTraits < int >
{
typedef int value_type ;
typedef int int_type ;
typedef unsigned uint_type ;
typedef unsigned abs_type ;
typedef int sum_type ;
typedef int64 w_type ;
typedef short n_type ;
typedef ushort nu_type ;
static int_type reinterpret_int ( value_type x ) { return ( int_type ) x ; }
static uint_type reinterpret_uint ( value_type x ) { return ( uint_type ) x ; }
static value_type reinterpret_from_int ( int_type x ) { return ( value_type ) x ; }
} ;
template < > struct V_TypeTraits < uint64 >
{
typedef uint64 value_type ;
typedef int64 int_type ;
typedef uint64 uint_type ;
typedef uint64 abs_type ;
typedef uint64 sum_type ;
typedef unsigned nu_type ;
static int_type reinterpret_int ( value_type x ) { return ( int_type ) x ; }
static uint_type reinterpret_uint ( value_type x ) { return ( uint_type ) x ; }
static value_type reinterpret_from_int ( int_type x ) { return ( value_type ) x ; }
} ;
template < > struct V_TypeTraits < int64 >
{
typedef int64 value_type ;
typedef int64 int_type ;
typedef uint64 uint_type ;
typedef uint64 abs_type ;
typedef int64 sum_type ;
typedef int nu_type ;
static int_type reinterpret_int ( value_type x ) { return ( int_type ) x ; }
static uint_type reinterpret_uint ( value_type x ) { return ( uint_type ) x ; }
static value_type reinterpret_from_int ( int_type x ) { return ( value_type ) x ; }
} ;
template < > struct V_TypeTraits < float >
{
typedef float value_type ;
typedef int int_type ;
typedef unsigned uint_type ;
typedef float abs_type ;
typedef float sum_type ;
typedef double w_type ;
static int_type reinterpret_int ( value_type x )
{
Cv32suf u ;
u . f = x ;
return u . i ;
}
static uint_type reinterpet_uint ( value_type x )
{
Cv32suf u ;
u . f = x ;
return u . u ;
}
static value_type reinterpret_from_int ( int_type x )
{
Cv32suf u ;
u . i = x ;
return u . f ;
}
} ;
template < > struct V_TypeTraits < double >
{
typedef double value_type ;
typedef int64 int_type ;
typedef uint64 uint_type ;
typedef double abs_type ;
typedef double sum_type ;
static int_type reinterpret_int ( value_type x )
{
Cv64suf u ;
u . f = x ;
return u . i ;
}
static uint_type reinterpet_uint ( value_type x )
{
Cv64suf u ;
u . f = x ;
return u . u ;
# define CV_INTRIN_DEF_TYPE_TRAITS(type, int_type_, uint_type_, abs_type_, w_type_, q_type_, sum_type_, nlanes128_) \
template < > struct V_TypeTraits < type > \
{ \
typedef type value_type ; \
typedef int_type_ int_type ; \
typedef abs_type_ abs_type ; \
typedef uint_type_ uint_type ; \
typedef w_type_ w_type ; \
typedef q_type_ q_type ; \
typedef sum_type_ sum_type ; \
enum { nlanes128 = nlanes128_ } ; \
\
static inline int_type reinterpret_int ( type x ) \
{ \
union { type l ; int_type i ; } v ; \
v . l = x ; \
return v . i ; \
} \
\
static inline type reinterpret_from_int ( int_type x ) \
{ \
union { type l ; int_type i ; } v ; \
v . i = x ; \
return v . l ; \
} \
}
static value_type reinterpret_from_int ( int_type x )
{
Cv64suf u ;
u . i = x ;
return u . f ;
}
} ;
template < typename T > struct V_SIMD128Traits
{
enum { nlanes = 16 / sizeof ( T ) } ;
} ;
CV_INTRIN_DEF_TYPE_TRAITS ( uchar , schar , uchar , uchar , ushort , unsigned , unsigned , 16 ) ;
CV_INTRIN_DEF_TYPE_TRAITS ( schar , schar , uchar , uchar , short , int , int , 16 ) ;
CV_INTRIN_DEF_TYPE_TRAITS ( ushort , short , ushort , ushort , unsigned , uint64 , unsigned , 8 ) ;
CV_INTRIN_DEF_TYPE_TRAITS ( short , short , ushort , ushort , int , int64 , int , 8 ) ;
CV_INTRIN_DEF_TYPE_TRAITS ( unsigned , int , unsigned , unsigned , uint64 , void , unsigned , 4 ) ;
CV_INTRIN_DEF_TYPE_TRAITS ( int , int , unsigned , unsigned , int64 , void , int , 4 ) ;
CV_INTRIN_DEF_TYPE_TRAITS ( float , int , unsigned , float , double , void , float , 4 ) ;
CV_INTRIN_DEF_TYPE_TRAITS ( uint64 , int64 , uint64 , uint64 , void , void , uint64 , 2 ) ;
CV_INTRIN_DEF_TYPE_TRAITS ( int64 , int64 , uint64 , uint64 , void , void , int64 , 2 ) ;
CV_INTRIN_DEF_TYPE_TRAITS ( double , int64 , uint64 , double , void , void , double , 2 ) ;
//! @endcond
# ifndef CV_DOXYGEN
//! @}
# 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_END }
# else
# define CV_CPU_OPTIMIZATION_HAL_NAMESPACE hal_baseline
# define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN namespace hal_baseline {
# define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END }
# endif
# ifndef CV_DOXYGEN
CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN
CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END
using namespace CV_CPU_OPTIMIZATION_HAL_NAMESPACE ;
# endif
}
# ifdef CV_DOXYGEN
# undef CV_AVX2
# undef CV_SSE2
# undef CV_NEON
# undef CV_VSX
# undef CV_FP16
# endif
# if CV_SSE2
@ -325,27 +142,25 @@ CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END
# else
# define CV_SIMD128_CPP 1
# include "opencv2/core/hal/intrin_cpp.hpp"
# endif
//! @addtogroup core_hal_intrin
//! @{
// AVX2 can be used together with SSE2, so
// we define those two sets of intrinsics at once.
// Most of the intrinsics do not conflict (the proper overloaded variant is
// resolved by the argument types, e.g. v_float32x4 ~ SSE2, v_float32x8 ~ AVX2),
// but some of AVX2 intrinsics get v256_ prefix instead of v_, e.g. v256_load() vs v_load().
// Correspondingly, the wide intrinsics (which are mapped to the "widest"
// available instruction set) will get vx_ prefix
// (and will be mapped to v256_ counterparts) (e.g. vx_load() => v245_load())
# if CV_AVX2
# ifndef CV_SIMD128
//! Set to 1 if current compiler supports vector extensions (NEON or SSE is enabled)
# define CV_SIMD128 0
# endif
# include "opencv2/core/hal/intrin_avx.hpp"
# ifndef CV_SIMD128_64F
//! Set to 1 if current intrinsics implementation supports 64-bit float vectors
# define CV_SIMD128_64F 0
# endif
//! @}
//==================================================================================================
//! @cond IGNORED
namespace cv {
@ -354,88 +169,175 @@ namespace cv {
CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN
# endif
template < typename R > struct V_RegTrait128 ;
# ifndef CV_SIMD128
# define CV_SIMD128 0
# endif
template < > struct V_RegTrait128 < uchar > {
typedef v_uint8x16 reg ;
typedef v_uint16x8 w_reg ;
typedef v_uint32x4 q_reg ;
typedef v_uint8x16 u_reg ;
static v_uint8x16 zero ( ) { return v_setzero_u8 ( ) ; }
static v_uint8x16 all ( uchar val ) { return v_setall_u8 ( val ) ; }
} ;
# ifndef CV_SIMD128_64F
# define CV_SIMD128_64F 0
# endif
template < > struct V_RegTrait128 < schar > {
typedef v_int8x16 reg ;
typedef v_int16x8 w_reg ;
typedef v_int32x4 q_reg ;
typedef v_uint8x16 u_reg ;
static v_int8x16 zero ( ) { return v_setzero_s8 ( ) ; }
static v_int8x16 all ( schar val ) { return v_setall_s8 ( val ) ; }
} ;
# ifndef CV_SIMD256
# define CV_SIMD256 0
# endif
template < > struct V_RegTrait128 < ushort > {
typedef v_uint16x8 reg ;
typedef v_uint32x4 w_reg ;
typedef v_int16x8 int_reg ;
typedef v_uint16x8 u_reg ;
static v_uint16x8 zero ( ) { return v_setzero_u16 ( ) ; }
static v_uint16x8 all ( ushort val ) { return v_setall_u16 ( val ) ; }
} ;
# ifndef CV_SIMD256_64F
# define CV_SIMD256_64F 0
# endif
template < > struct V_RegTrait128 < short > {
typedef v_int16x8 reg ;
typedef v_int32x4 w_reg ;
typedef v_uint16x8 u_reg ;
static v_int16x8 zero ( ) { return v_setzero_s16 ( ) ; }
static v_int16x8 all ( short val ) { return v_setall_s16 ( val ) ; }
} ;
# ifndef CV_SIMD512
# define CV_SIMD512 0
# endif
template < > struct V_RegTrait128 < unsigned > {
typedef v_uint32x4 reg ;
typedef v_uint64x2 w_reg ;
typedef v_int32x4 int_reg ;
typedef v_uint32x4 u_reg ;
static v_uint32x4 zero ( ) { return v_setzero_u32 ( ) ; }
static v_uint32x4 all ( unsigned val ) { return v_setall_u32 ( val ) ; }
} ;
# ifndef CV_SIMD512_64F
# define CV_SIMD512_64F 0
# endif
template < > struct V_RegTrait128 < int > {
typedef v_int32x4 reg ;
typedef v_int64x2 w_reg ;
typedef v_uint32x4 u_reg ;
static v_int32x4 zero ( ) { return v_setzero_s32 ( ) ; }
static v_int32x4 all ( int val ) { return v_setall_s32 ( val ) ; }
} ;
# if CV_SIMD512
# define CV_SIMD 1
# define CV_SIMD_64F CV_SIMD512_64F
# define CV_SIMD_WIDTH 64
# elif CV_SIMD256
# define CV_SIMD 1
# define CV_SIMD_64F CV_SIMD256_64F
# define CV_SIMD_WIDTH 32
# else
# define CV_SIMD CV_SIMD128
# define CV_SIMD_64F CV_SIMD128_64F
# define CV_SIMD_WIDTH 16
# endif
template < > struct V_RegTrait128 < uint64 > {
typedef v_uint64x2 reg ;
static v_uint64x2 zero ( ) { return v_setzero_u64 ( ) ; }
static v_uint64x2 all ( uint64 val ) { return v_setall_u64 ( val ) ; }
} ;
//==================================================================================================
template < > struct V_RegTrait128 < int64 > {
typedef v_int64x2 reg ;
static v_int64x2 zero ( ) { return v_setzero_s64 ( ) ; }
static v_int64x2 all ( int64 val ) { return v_setall_s64 ( val ) ; }
# define CV_INTRIN_DEFINE_WIDE_INTRIN(typ, vtyp, short_typ, prefix, loadsfx) \
inline vtyp vx_setall_ # # short_typ ( typ v ) { return prefix # # _setall_ # # short_typ ( v ) ; } \
inline vtyp vx_setzero_ # # short_typ ( ) { return prefix # # _setzero_ # # short_typ ( ) ; } \
inline vtyp vx_ # # loadsfx ( const typ * ptr ) { return prefix # # _ # # loadsfx ( ptr ) ; } \
inline vtyp vx_ # # loadsfx # # _aligned ( const typ * ptr ) { return prefix # # _ # # loadsfx # # _aligned ( ptr ) ; } \
inline void vx_store ( typ * ptr , const vtyp & v ) { return v_store ( ptr , v ) ; } \
inline void vx_store_aligned ( typ * ptr , const vtyp & v ) { return v_store_aligned ( ptr , v ) ; }
# define CV_INTRIN_DEFINE_WIDE_LOAD_EXPAND(typ, wtyp, prefix) \
inline wtyp vx_load_expand ( const typ * ptr ) { return prefix # # _load_expand ( ptr ) ; }
# define CV_INTRIN_DEFINE_WIDE_LOAD_EXPAND_Q(typ, qtyp, prefix) \
inline qtyp vx_load_expand_q ( const typ * ptr ) { return prefix # # _load_expand_q ( ptr ) ; }
# define CV_INTRIN_DEFINE_WIDE_INTRIN_WITH_EXPAND(typ, vtyp, short_typ, wtyp, qtyp, prefix, loadsfx) \
CV_INTRIN_DEFINE_WIDE_INTRIN ( typ , vtyp , short_typ , prefix , loadsfx ) \
CV_INTRIN_DEFINE_WIDE_LOAD_EXPAND ( typ , wtyp , prefix ) \
CV_INTRIN_DEFINE_WIDE_LOAD_EXPAND_Q ( typ , qtyp , prefix )
# define CV_INTRIN_DEFINE_WIDE_INTRIN_ALL_TYPES(prefix) \
CV_INTRIN_DEFINE_WIDE_INTRIN_WITH_EXPAND ( uchar , v_uint8 , u8 , v_uint16 , v_uint32 , prefix , load ) \
CV_INTRIN_DEFINE_WIDE_INTRIN_WITH_EXPAND ( schar , v_int8 , s8 , v_int16 , v_int32 , prefix , load ) \
CV_INTRIN_DEFINE_WIDE_INTRIN ( ushort , v_uint16 , u16 , prefix , load ) \
CV_INTRIN_DEFINE_WIDE_LOAD_EXPAND ( ushort , v_uint32 , prefix ) \
CV_INTRIN_DEFINE_WIDE_INTRIN ( short , v_int16 , s16 , prefix , load ) \
CV_INTRIN_DEFINE_WIDE_LOAD_EXPAND ( short , v_int32 , prefix ) \
CV_INTRIN_DEFINE_WIDE_INTRIN ( int , v_int32 , s32 , prefix , load ) \
CV_INTRIN_DEFINE_WIDE_LOAD_EXPAND ( int , v_int64 , prefix ) \
CV_INTRIN_DEFINE_WIDE_INTRIN ( unsigned , v_uint32 , u32 , prefix , load ) \
CV_INTRIN_DEFINE_WIDE_LOAD_EXPAND ( unsigned , v_uint64 , prefix ) \
CV_INTRIN_DEFINE_WIDE_INTRIN ( float , v_float32 , f32 , prefix , load ) \
CV_INTRIN_DEFINE_WIDE_INTRIN ( int64 , v_int64 , s64 , prefix , load ) \
CV_INTRIN_DEFINE_WIDE_INTRIN ( uint64 , v_uint64 , u64 , prefix , load )
template < typename _Tp > struct V_RegTraits
{
} ;
template < > struct V_RegTrait128 < float > {
typedef v_float32x4 reg ;
typedef v_int32x4 int_reg ;
typedef v_float32x4 u_reg ;
static v_float32x4 zero ( ) { return v_setzero_f32 ( ) ; }
static v_float32x4 all ( float val ) { return v_setall_f32 ( val ) ; }
} ;
# define CV_DEF_REG_TRAITS(prefix, _reg, lane_type, suffix, _u_reg, _w_reg, _q_reg, _int_reg, _round_reg) \
template < > struct V_RegTraits < _reg > \
{ \
typedef _reg reg ; \
typedef _u_reg u_reg ; \
typedef _w_reg w_reg ; \
typedef _q_reg q_reg ; \
typedef _int_reg int_reg ; \
typedef _round_reg round_reg ; \
}
# if CV_SIMD128 || CV_SIMD128_CPP
CV_DEF_REG_TRAITS ( v , v_uint8x16 , uchar , u8 , v_uint8x16 , v_uint16x8 , v_uint32x4 , v_int8x16 , void ) ;
CV_DEF_REG_TRAITS ( v , v_int8x16 , schar , s8 , v_uint8x16 , v_int16x8 , v_int32x4 , v_int8x16 , void ) ;
CV_DEF_REG_TRAITS ( v , v_uint16x8 , ushort , u16 , v_uint16x8 , v_uint32x4 , v_uint64x2 , v_int16x8 , void ) ;
CV_DEF_REG_TRAITS ( v , v_int16x8 , short , s16 , v_uint16x8 , v_int32x4 , v_int64x2 , v_int16x8 , void ) ;
CV_DEF_REG_TRAITS ( v , v_uint32x4 , unsigned , u32 , v_uint32x4 , v_uint64x2 , void , v_int32x4 , void ) ;
CV_DEF_REG_TRAITS ( v , v_int32x4 , int , s32 , v_uint32x4 , v_int64x2 , void , v_int32x4 , void ) ;
# if CV_SIMD128_64F
template < > struct V_RegTrait128 < double > {
typedef v_float64x2 reg ;
typedef v_int32x4 int_reg ;
typedef v_float64x2 u_reg ;
static v_float64x2 zero ( ) { return v_setzero_f64 ( ) ; }
static v_float64x2 all ( double val ) { return v_setall_f64 ( val ) ; }
} ;
CV_DEF_REG_TRAITS ( v , v_float32x4 , float , f32 , v_float32x4 , v_float64x2 , void , v_int32x4 , v_int32x4 ) ;
# else
CV_DEF_REG_TRAITS ( v , v_float32x4 , float , f32 , v_float32x4 , void , void , v_int32x4 , v_int32x4 ) ;
# endif
CV_DEF_REG_TRAITS ( v , v_uint64x2 , uint64 , u64 , v_uint64x2 , void , void , v_int64x2 , void ) ;
CV_DEF_REG_TRAITS ( v , v_int64x2 , int64 , s64 , v_uint64x2 , void , void , v_int64x2 , void ) ;
# if CV_SIMD128_64F
CV_DEF_REG_TRAITS ( v , v_float64x2 , double , f64 , v_float64x2 , void , void , v_int64x2 , v_int32x4 ) ;
# endif
# if CV_FP16
CV_DEF_REG_TRAITS ( v , v_float16x8 , short , f16 , v_float32x4 , void , void , v_int16x8 , v_int16x8 ) ;
# endif
# endif
# if CV_SIMD256
CV_DEF_REG_TRAITS ( v256 , v_uint8x32 , uchar , u8 , v_uint8x32 , v_uint16x16 , v_uint32x8 , v_int8x32 , void ) ;
CV_DEF_REG_TRAITS ( v256 , v_int8x32 , schar , s8 , v_uint8x32 , v_int16x16 , v_int32x8 , v_int8x32 , void ) ;
CV_DEF_REG_TRAITS ( v256 , v_uint16x16 , ushort , u16 , v_uint16x16 , v_uint32x8 , v_uint64x4 , v_int16x16 , void ) ;
CV_DEF_REG_TRAITS ( v256 , v_int16x16 , short , s16 , v_uint16x16 , v_int32x8 , v_int64x4 , v_int16x16 , void ) ;
CV_DEF_REG_TRAITS ( v256 , v_uint32x8 , unsigned , u32 , v_uint32x8 , v_uint64x4 , void , v_int32x8 , void ) ;
CV_DEF_REG_TRAITS ( v256 , v_int32x8 , int , s32 , v_uint32x8 , v_int64x4 , void , v_int32x8 , void ) ;
CV_DEF_REG_TRAITS ( v256 , v_float32x8 , float , f32 , v_float32x8 , v_float64x4 , void , v_int32x8 , v_int32x8 ) ;
CV_DEF_REG_TRAITS ( v256 , v_uint64x4 , uint64 , u64 , v_uint64x4 , void , void , v_int64x4 , void ) ;
CV_DEF_REG_TRAITS ( v256 , v_int64x4 , int64 , s64 , v_uint64x4 , void , void , v_int64x4 , void ) ;
CV_DEF_REG_TRAITS ( v256 , v_float64x4 , double , f64 , v_float64x4 , void , void , v_int64x4 , v_int32x8 ) ;
# if CV_FP16
CV_DEF_REG_TRAITS ( v256 , v_float16x16 , short , f16 , v_float32x8 , void , void , v_int16x16 , void ) ;
# endif
# endif
# if CV_SIMD256
typedef v_uint8x32 v_uint8 ;
typedef v_int8x32 v_int8 ;
typedef v_uint16x16 v_uint16 ;
typedef v_int16x16 v_int16 ;
typedef v_uint32x8 v_uint32 ;
typedef v_int32x8 v_int32 ;
typedef v_uint64x4 v_uint64 ;
typedef v_int64x4 v_int64 ;
typedef v_float32x8 v_float32 ;
# if CV_SIMD256_64F
typedef v_float64x4 v_float64 ;
# endif
# if CV_FP16
typedef v_float16x16 v_float16 ;
CV_INTRIN_DEFINE_WIDE_INTRIN ( short , v_float16 , f16 , v256 , load_f16 )
# endif
CV_INTRIN_DEFINE_WIDE_INTRIN_ALL_TYPES ( v256 )
CV_INTRIN_DEFINE_WIDE_INTRIN ( double , v_float64 , f64 , v256 , load )
inline void vx_cleanup ( ) { v256_cleanup ( ) ; }
# elif CV_SIMD128
typedef v_uint8x16 v_uint8 ;
typedef v_int8x16 v_int8 ;
typedef v_uint16x8 v_uint16 ;
typedef v_int16x8 v_int16 ;
typedef v_uint32x4 v_uint32 ;
typedef v_int32x4 v_int32 ;
typedef v_uint64x2 v_uint64 ;
typedef v_int64x2 v_int64 ;
typedef v_float32x4 v_float32 ;
# if CV_SIMD128_64F
typedef v_float64x2 v_float64 ;
# endif
# if CV_FP16
typedef v_float16x8 v_float16 ;
CV_INTRIN_DEFINE_WIDE_INTRIN ( short , v_float16 , f16 , v , load_f16 )
# endif
CV_INTRIN_DEFINE_WIDE_INTRIN_ALL_TYPES ( v )
# if CV_SIMD128_64F
CV_INTRIN_DEFINE_WIDE_INTRIN ( double , v_float64 , f64 , v , load )
# endif
inline void vx_cleanup ( ) { v_cleanup ( ) ; }
# endif
inline unsigned int trailingZeros32 ( unsigned int value ) {