6
#ifdef OPENCV_HAL_INTRIN_HPP
9
#if CV_SIMD128 || CV_SIMD128_CPP
11
template<
typename
_T>
struct
Type2Vec128_Traits;
12
#define CV_INTRIN_DEF_TYPE2VEC128_TRAITS(type_, vec_type_) \
13
template<> struct Type2Vec128_Traits<type_> \
15
typedef vec_type_ vec_type; \
18CV_INTRIN_DEF_TYPE2VEC128_TRAITS(uchar,
v_uint8x16);
19CV_INTRIN_DEF_TYPE2VEC128_TRAITS(schar,
v_int8x16);
20CV_INTRIN_DEF_TYPE2VEC128_TRAITS(ushort,
v_uint16x8);
21CV_INTRIN_DEF_TYPE2VEC128_TRAITS(
short,
v_int16x8);
22CV_INTRIN_DEF_TYPE2VEC128_TRAITS(
unsigned,
v_uint32x4);
23CV_INTRIN_DEF_TYPE2VEC128_TRAITS(
int,
v_int32x4);
24CV_INTRIN_DEF_TYPE2VEC128_TRAITS(
float,
v_float32x4);
25CV_INTRIN_DEF_TYPE2VEC128_TRAITS(uint64,
v_uint64x2);
26CV_INTRIN_DEF_TYPE2VEC128_TRAITS(int64,
v_int64x2);
28CV_INTRIN_DEF_TYPE2VEC128_TRAITS(
double,
v_float64x2);
31
template<
typename
_T>
static
inline
32
typename
Type2Vec128_Traits<_T>::vec_type v_setall(
const
_T& a);
34
template<>
inline
Type2Vec128_Traits< uchar>::vec_type v_setall< uchar>(
const
uchar& a) {
return
v_setall_u8(a); }
35
template<>
inline
Type2Vec128_Traits< schar>::vec_type v_setall< schar>(
const
schar& a) {
return
v_setall_s8(a); }
36
template<>
inline
Type2Vec128_Traits<ushort>::vec_type v_setall<ushort>(
const
ushort& a) {
return
v_setall_u16(a); }
37
template<>
inline
Type2Vec128_Traits< short>::vec_type v_setall< short>(
const
short& a) {
return
v_setall_s16(a); }
38
template<>
inline
Type2Vec128_Traits< uint>::vec_type v_setall< uint>(
const
uint& a) {
return
v_setall_u32(a); }
39
template<>
inline
Type2Vec128_Traits< int>::vec_type v_setall< int>(
const
int& a) {
return
v_setall_s32(a); }
40
template<>
inline
Type2Vec128_Traits<uint64>::vec_type v_setall<uint64>(
const
uint64& a) {
return
v_setall_u64(a); }
41
template<>
inline
Type2Vec128_Traits< int64>::vec_type v_setall< int64>(
const
int64& a) {
return
v_setall_s64(a); }
42
template<>
inline
Type2Vec128_Traits< float>::vec_type v_setall< float>(
const
float& a) {
return
v_setall_f32(a); }
44
template<>
inline
Type2Vec128_Traits<double>::vec_type v_setall<double>(
const
double& a) {
return
v_setall_f64(a); }
52
template<
typename
_T>
struct
Type2Vec256_Traits;
53
#define CV_INTRIN_DEF_TYPE2VEC256_TRAITS(type_, vec_type_) \
54
template<> struct Type2Vec256_Traits<type_> \
56
typedef vec_type_ vec_type; \
59CV_INTRIN_DEF_TYPE2VEC256_TRAITS(uchar, v_uint8x32);
60CV_INTRIN_DEF_TYPE2VEC256_TRAITS(schar, v_int8x32);
61CV_INTRIN_DEF_TYPE2VEC256_TRAITS(ushort, v_uint16x16);
62CV_INTRIN_DEF_TYPE2VEC256_TRAITS(
short, v_int16x16);
63CV_INTRIN_DEF_TYPE2VEC256_TRAITS(
unsigned, v_uint32x8);
64CV_INTRIN_DEF_TYPE2VEC256_TRAITS(
int, v_int32x8);
65CV_INTRIN_DEF_TYPE2VEC256_TRAITS(
float, v_float32x8);
66CV_INTRIN_DEF_TYPE2VEC256_TRAITS(uint64, v_uint64x4);
67CV_INTRIN_DEF_TYPE2VEC256_TRAITS(int64, v_int64x4);
69CV_INTRIN_DEF_TYPE2VEC256_TRAITS(
double, v_float64x4);
72
template<
typename
_T>
static
inline
73
typename
Type2Vec256_Traits<_T>::vec_type v256_setall(
const
_T& a);
75
template<>
inline
Type2Vec256_Traits< uchar>::vec_type v256_setall< uchar>(
const
uchar& a) {
return
v256_setall_u8(a); }
76
template<>
inline
Type2Vec256_Traits< schar>::vec_type v256_setall< schar>(
const
schar& a) {
return
v256_setall_s8(a); }
77
template<>
inline
Type2Vec256_Traits<ushort>::vec_type v256_setall<ushort>(
const
ushort& a) {
return
v256_setall_u16(a); }
78
template<>
inline
Type2Vec256_Traits< short>::vec_type v256_setall< short>(
const
short& a) {
return
v256_setall_s16(a); }
79
template<>
inline
Type2Vec256_Traits< uint>::vec_type v256_setall< uint>(
const
uint& a) {
return
v256_setall_u32(a); }
80
template<>
inline
Type2Vec256_Traits< int>::vec_type v256_setall< int>(
const
int& a) {
return
v256_setall_s32(a); }
81
template<>
inline
Type2Vec256_Traits<uint64>::vec_type v256_setall<uint64>(
const
uint64& a) {
return
v256_setall_u64(a); }
82
template<>
inline
Type2Vec256_Traits< int64>::vec_type v256_setall< int64>(
const
int64& a) {
return
v256_setall_s64(a); }
83
template<>
inline
Type2Vec256_Traits< float>::vec_type v256_setall< float>(
const
float& a) {
return
v256_setall_f32(a); }
85
template<>
inline
Type2Vec256_Traits<double>::vec_type v256_setall<double>(
const
double& a) {
return
v256_setall_f64(a); }
93
template<
typename
_T>
struct
Type2Vec512_Traits;
94
#define CV_INTRIN_DEF_TYPE2VEC512_TRAITS(type_, vec_type_) \
95
template<> struct Type2Vec512_Traits<type_> \
97
typedef vec_type_ vec_type; \
100CV_INTRIN_DEF_TYPE2VEC512_TRAITS(uchar, v_uint8x64);
101CV_INTRIN_DEF_TYPE2VEC512_TRAITS(schar, v_int8x64);
102CV_INTRIN_DEF_TYPE2VEC512_TRAITS(ushort, v_uint16x32);
103CV_INTRIN_DEF_TYPE2VEC512_TRAITS(
short, v_int16x32);
104CV_INTRIN_DEF_TYPE2VEC512_TRAITS(
unsigned, v_uint32x16);
105CV_INTRIN_DEF_TYPE2VEC512_TRAITS(
int, v_int32x16);
106CV_INTRIN_DEF_TYPE2VEC512_TRAITS(
float, v_float32x16);
107CV_INTRIN_DEF_TYPE2VEC512_TRAITS(uint64, v_uint64x8);
108CV_INTRIN_DEF_TYPE2VEC512_TRAITS(int64, v_int64x8);
110CV_INTRIN_DEF_TYPE2VEC512_TRAITS(
double, v_float64x8);
113
template<
typename
_T>
static
inline
114
typename
Type2Vec512_Traits<_T>::vec_type v512_setall(
const
_T& a);
116
template<>
inline
Type2Vec512_Traits< uchar>::vec_type v512_setall< uchar>(
const
uchar& a) {
return
v512_setall_u8(a); }
117
template<>
inline
Type2Vec512_Traits< schar>::vec_type v512_setall< schar>(
const
schar& a) {
return
v512_setall_s8(a); }
118
template<>
inline
Type2Vec512_Traits<ushort>::vec_type v512_setall<ushort>(
const
ushort& a) {
return
v512_setall_u16(a); }
119
template<>
inline
Type2Vec512_Traits< short>::vec_type v512_setall< short>(
const
short& a) {
return
v512_setall_s16(a); }
120
template<>
inline
Type2Vec512_Traits< uint>::vec_type v512_setall< uint>(
const
uint& a) {
return
v512_setall_u32(a); }
121
template<>
inline
Type2Vec512_Traits< int>::vec_type v512_setall< int>(
const
int& a) {
return
v512_setall_s32(a); }
122
template<>
inline
Type2Vec512_Traits<uint64>::vec_type v512_setall<uint64>(
const
uint64& a) {
return
v512_setall_u64(a); }
123
template<>
inline
Type2Vec512_Traits< int64>::vec_type v512_setall< int64>(
const
int64& a) {
return
v512_setall_s64(a); }
124
template<>
inline
Type2Vec512_Traits< float>::vec_type v512_setall< float>(
const
float& a) {
return
v512_setall_f32(a); }
126
template<>
inline
Type2Vec512_Traits<double>::vec_type v512_setall<double>(
const
double& a) {
return
v512_setall_f64(a); }
132
#if CV_SIMD_WIDTH == 16
133
template<
typename
_T>
static
inline
134
typename
Type2Vec128_Traits<_T>::vec_type vx_setall(
const
_T& a) {
return
v_setall(a); }
135
#elif CV_SIMD_WIDTH == 32
136
template<
typename
_T>
static
inline
137
typename
Type2Vec256_Traits<_T>::vec_type vx_setall(
const
_T& a) {
return
v256_setall(a); }
138
#elif CV_SIMD_WIDTH == 64
139
template<
typename
_T>
static
inline
140
typename
Type2Vec512_Traits<_T>::vec_type vx_setall(
const
_T& a) {
return
v512_setall(a); }
142
#error "Build configuration error, unsupported CV_SIMD_WIDTH"
v_reg< schar, 16 > v_int8x16
Sixteen 8-bit signed integer values
Definition:
intrin_cpp.hpp:490
v_reg< uchar, 16 > v_uint8x16
Sixteen 8-bit unsigned integer values
Definition:
intrin_cpp.hpp:488
v_reg< int64, 2 > v_int64x2
Two 64-bit signed integer values
Definition:
intrin_cpp.hpp:506
v_reg< ushort, 8 > v_uint16x8
Eight 16-bit unsigned integer values
Definition:
intrin_cpp.hpp:492
v_reg< int, 4 > v_int32x4
Four 32-bit signed integer values
Definition:
intrin_cpp.hpp:498
v_reg< unsigned, 4 > v_uint32x4
Four 32-bit unsigned integer values
Definition:
intrin_cpp.hpp:496
v_reg< uint64, 2 > v_uint64x2
Two 64-bit unsigned integer values
Definition:
intrin_cpp.hpp:504
v_reg< float, 4 > v_float32x4
Four 32-bit floating point values (single precision)
Definition:
intrin_cpp.hpp:500
v_reg< short, 8 > v_int16x8
Eight 16-bit signed integer values
Definition:
intrin_cpp.hpp:494
v_reg< double, 2 > v_float64x2
Two 64-bit floating point values (double precision)
Definition:
intrin_cpp.hpp:502