45 #ifndef OPENCV_HAL_INTRIN_HPP
46 #define OPENCV_HAL_INTRIN_HPP
51 #include "opencv2/core/cvdef.h"
53 #if defined(__GNUC__) && __GNUC__ == 12
54 #pragma GCC diagnostic push
55 #pragma GCC diagnostic ignored "-Wuninitialized"
56 #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
59 #define OPENCV_HAL_ADD(a, b) ((a) + (b))
60 #define OPENCV_HAL_AND(a, b) ((a) & (b))
61 #define OPENCV_HAL_NOP(a) (a)
62 #define OPENCV_HAL_1ST(a, b) (a)
65 inline unsigned int trailingZeros32(
unsigned int value) {
67 #if (_MSC_VER < 1700) || defined(_M_ARM) || defined(_M_ARM64)
68 unsigned long index = 0;
70 return (
unsigned int)
index;
71 #elif defined(__clang__)
75 return _tzcnt_u32(
value);
77 #elif defined(__GNUC__) || defined(__GNUG__)
78 return __builtin_ctz(
value);
79 #elif defined(__ICC) || defined(__INTEL_COMPILER)
80 return _bit_scan_forward(
value);
81 #elif defined(__clang__)
82 return llvm.cttz.i32(
value,
true);
84 static const int MultiplyDeBruijnBitPosition[32] = {
85 0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8,
86 31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9 };
87 return MultiplyDeBruijnBitPosition[((uint32_t)((
value & -
value) * 0x077CB531U)) >> 27];
113 #define CV_INTRIN_DEF_TYPE_TRAITS(type, int_type_, uint_type_, abs_type_, w_type_, q_type_, sum_type_) \
114 template<> struct V_TypeTraits<type> \
116 typedef type value_type; \
117 typedef int_type_ int_type; \
118 typedef abs_type_ abs_type; \
119 typedef uint_type_ uint_type; \
120 typedef w_type_ w_type; \
121 typedef q_type_ q_type; \
122 typedef sum_type_ sum_type; \
124 static inline int_type reinterpret_int(type x) \
126 union { type l; int_type i; } v; \
131 static inline type reinterpret_from_int(int_type x) \
133 union { type l; int_type i; } v; \
139 #define CV_INTRIN_DEF_TYPE_TRAITS_NO_Q_TYPE(type, int_type_, uint_type_, abs_type_, w_type_, sum_type_) \
140 template<> struct V_TypeTraits<type> \
142 typedef type value_type; \
143 typedef int_type_ int_type; \
144 typedef abs_type_ abs_type; \
145 typedef uint_type_ uint_type; \
146 typedef w_type_ w_type; \
147 typedef sum_type_ sum_type; \
149 static inline int_type reinterpret_int(type x) \
151 union { type l; int_type i; } v; \
156 static inline type reinterpret_from_int(int_type x) \
158 union { type l; int_type i; } v; \
177 #ifndef CV_CPU_OPTIMIZATION_HAL_NAMESPACE
178 #ifdef CV_FORCE_SIMD128_CPP
179 #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE hal_EMULATOR_CPP
180 #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN namespace hal_EMULATOR_CPP {
181 #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END }
182 #elif defined(CV_CPU_DISPATCH_MODE)
183 #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE __CV_CAT(hal_, CV_CPU_DISPATCH_MODE)
184 #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN namespace __CV_CAT(hal_, CV_CPU_DISPATCH_MODE) {
185 #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END }
187 #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE hal_baseline
188 #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN namespace hal_baseline {
189 #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END }
193 CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN
194 CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END
195 using namespace CV_CPU_OPTIMIZATION_HAL_NAMESPACE;
209 #if (CV_SSE2 || CV_NEON || CV_VSX || CV_MSA || CV_WASM_SIMD || CV_RVV071 || CV_LSX) && !defined(CV_FORCE_SIMD128_CPP)
210 #define CV__SIMD_FORWARD 128
211 #include "opencv2/core/hal/intrin_forward.hpp"
214 #if CV_SSE2 && !defined(CV_FORCE_SIMD128_CPP)
216 #include "opencv2/core/hal/intrin_sse_em.hpp"
217 #include "opencv2/core/hal/intrin_sse.hpp"
219 #elif CV_NEON && !defined(CV_FORCE_SIMD128_CPP)
221 #include "opencv2/core/hal/intrin_neon.hpp"
223 #elif CV_RVV071 && !defined(CV_FORCE_SIMD128_CPP)
224 #define CV_SIMD128_CPP 0
225 #include "opencv2/core/hal/intrin_rvv071.hpp"
227 #elif CV_VSX && !defined(CV_FORCE_SIMD128_CPP)
229 #include "opencv2/core/hal/intrin_vsx.hpp"
231 #elif CV_MSA && !defined(CV_FORCE_SIMD128_CPP)
233 #include "opencv2/core/hal/intrin_msa.hpp"
235 #elif CV_WASM_SIMD && !defined(CV_FORCE_SIMD128_CPP)
236 #include "opencv2/core/hal/intrin_wasm.hpp"
238 #elif CV_RVV && !defined(CV_FORCE_SIMD128_CPP)
239 #if defined(CV_RVV_SCALABLE)
240 #include "opencv2/core/hal/intrin_rvv_scalable.hpp"
242 #include "opencv2/core/hal/intrin_rvv.hpp"
245 #elif CV_LSX && !defined(CV_FORCE_SIMD128_CPP)
247 #include "opencv2/core/hal/intrin_lsx.hpp"
251 #include "opencv2/core/hal/intrin_cpp.hpp"
265 #define CV__SIMD_FORWARD 256
266 #include "opencv2/core/hal/intrin_forward.hpp"
267 #include "opencv2/core/hal/intrin_avx.hpp"
277 #define CV__SIMD_FORWARD 512
278 #include "opencv2/core/hal/intrin_forward.hpp"
279 #include "opencv2/core/hal/intrin_avx512.hpp"
285 #define CV__SIMD_FORWARD 256
286 #include "opencv2/core/hal/intrin_forward.hpp"
287 #include "opencv2/core/hal/intrin_lasx.hpp"
296 CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN
303 #ifndef CV_SIMD128_CPP
304 #define CV_SIMD128_CPP 0
307 #ifndef CV_SIMD128_64F
308 #define CV_SIMD128_64F 0
315 #ifndef CV_SIMD256_64F
316 #define CV_SIMD256_64F 0
323 #ifndef CV_SIMD512_64F
324 #define CV_SIMD512_64F 0
327 #ifndef CV_SIMD128_FP16
328 #define CV_SIMD128_FP16 0
331 #ifndef CV_SIMD256_FP16
332 #define CV_SIMD256_FP16 0
335 #ifndef CV_SIMD512_FP16
336 #define CV_SIMD512_FP16 0
339 #ifndef CV_SIMD_SCALABLE
340 #define CV_SIMD_SCALABLE 0
343 #ifndef CV_SIMD_SCALABLE_64F
344 #define CV_SIMD_SCALABLE_64F 0
349 template<
typename _Tp>
struct V_RegTraits
353 #define CV_DEF_REG_TRAITS(prefix, _reg, lane_type, suffix, _u_reg, _w_reg, _q_reg, _int_reg, _round_reg) \
354 template<> struct V_RegTraits<_reg> \
357 typedef _u_reg u_reg; \
358 typedef _w_reg w_reg; \
359 typedef _q_reg q_reg; \
360 typedef _int_reg int_reg; \
361 typedef _round_reg round_reg; \
364 #if CV_SIMD128 || CV_SIMD128_CPP
371 #if CV_SIMD128_64F || CV_SIMD128_CPP
384 CV_DEF_REG_TRAITS(v256, v_uint8x32,
uchar, u8, v_uint8x32, v_uint16x16, v_uint32x8, v_int8x32,
void);
385 CV_DEF_REG_TRAITS(v256, v_int8x32,
schar, s8, v_uint8x32, v_int16x16, v_int32x8, v_int8x32,
void);
386 CV_DEF_REG_TRAITS(v256, v_uint16x16,
ushort, u16, v_uint16x16, v_uint32x8, v_uint64x4, v_int16x16,
void);
387 CV_DEF_REG_TRAITS(v256, v_int16x16,
short, s16, v_uint16x16, v_int32x8, v_int64x4, v_int16x16,
void);
388 CV_DEF_REG_TRAITS(v256, v_uint32x8,
unsigned, u32, v_uint32x8, v_uint64x4,
void, v_int32x8,
void);
389 CV_DEF_REG_TRAITS(v256, v_int32x8,
int, s32, v_uint32x8, v_int64x4,
void, v_int32x8,
void);
390 CV_DEF_REG_TRAITS(v256, v_float32x8,
float, f32, v_float32x8, v_float64x4,
void, v_int32x8, v_int32x8);
391 CV_DEF_REG_TRAITS(v256, v_uint64x4,
uint64, u64, v_uint64x4,
void,
void, v_int64x4,
void);
392 CV_DEF_REG_TRAITS(v256, v_int64x4,
int64, s64, v_uint64x4,
void,
void, v_int64x4,
void);
393 CV_DEF_REG_TRAITS(v256, v_float64x4,
double, f64, v_float64x4,
void,
void, v_int64x4, v_int32x8);
397 CV_DEF_REG_TRAITS(v512, v_uint8x64,
uchar, u8, v_uint8x64, v_uint16x32, v_uint32x16, v_int8x64,
void);
398 CV_DEF_REG_TRAITS(v512, v_int8x64,
schar, s8, v_uint8x64, v_int16x32, v_int32x16, v_int8x64,
void);
399 CV_DEF_REG_TRAITS(v512, v_uint16x32,
ushort, u16, v_uint16x32, v_uint32x16, v_uint64x8, v_int16x32,
void);
400 CV_DEF_REG_TRAITS(v512, v_int16x32,
short, s16, v_uint16x32, v_int32x16, v_int64x8, v_int16x32,
void);
401 CV_DEF_REG_TRAITS(v512, v_uint32x16,
unsigned, u32, v_uint32x16, v_uint64x8,
void, v_int32x16,
void);
402 CV_DEF_REG_TRAITS(v512, v_int32x16,
int, s32, v_uint32x16, v_int64x8,
void, v_int32x16,
void);
403 CV_DEF_REG_TRAITS(v512, v_float32x16,
float, f32, v_float32x16, v_float64x8,
void, v_int32x16, v_int32x16);
404 CV_DEF_REG_TRAITS(v512, v_uint64x8,
uint64, u64, v_uint64x8,
void,
void, v_int64x8,
void);
405 CV_DEF_REG_TRAITS(v512, v_int64x8,
int64, s64, v_uint64x8,
void,
void, v_int64x8,
void);
406 CV_DEF_REG_TRAITS(v512, v_float64x8,
double, f64, v_float64x8,
void,
void, v_int64x8, v_int32x16);
409 CV_DEF_REG_TRAITS(v, v_uint8,
uchar, u8, v_uint8, v_uint16, v_uint32, v_int8,
void);
410 CV_DEF_REG_TRAITS(v, v_int8,
schar, s8, v_uint8, v_int16, v_int32, v_int8,
void);
411 CV_DEF_REG_TRAITS(v, v_uint16,
ushort, u16, v_uint16, v_uint32, v_uint64, v_int16,
void);
412 CV_DEF_REG_TRAITS(v, v_int16,
short, s16, v_uint16, v_int32, v_int64, v_int16,
void);
413 CV_DEF_REG_TRAITS(v, v_uint32,
unsigned, u32, v_uint32, v_uint64,
void, v_int32,
void);
414 CV_DEF_REG_TRAITS(v, v_int32,
int, s32, v_uint32, v_int64,
void, v_int32,
void);
415 CV_DEF_REG_TRAITS(v, v_float32,
float, f32, v_float32, v_float64,
void, v_int32, v_int32);
416 CV_DEF_REG_TRAITS(v, v_uint64,
uint64, u64, v_uint64,
void,
void, v_int64,
void);
417 CV_DEF_REG_TRAITS(v, v_int64,
int64, s64, v_uint64,
void,
void, v_int64,
void);
418 CV_DEF_REG_TRAITS(v, v_float64,
double, f64, v_float64,
void,
void, v_int64, v_int32);
422 #if CV_SIMD512 && (!defined(CV__SIMD_FORCE_WIDTH) || CV__SIMD_FORCE_WIDTH == 512)
423 #define CV__SIMD_NAMESPACE simd512
424 namespace CV__SIMD_NAMESPACE {
426 #define CV_SIMD_64F CV_SIMD512_64F
427 #define CV_SIMD_FP16 CV_SIMD512_FP16
428 #define CV_SIMD_WIDTH 64
432 typedef v_uint8x64 v_uint8;
434 typedef v_int8x64 v_int8;
436 typedef v_uint16x32 v_uint16;
438 typedef v_int16x32 v_int16;
440 typedef v_uint32x16 v_uint32;
442 typedef v_int32x16 v_int32;
444 typedef v_uint64x8 v_uint64;
446 typedef v_int64x8 v_int64;
448 typedef v_float32x16 v_float32;
451 typedef v_float64x8 v_float64;
455 #define VXPREFIX(func) v512##func
457 using namespace CV__SIMD_NAMESPACE;
458 #elif CV_SIMD256 && (!defined(CV__SIMD_FORCE_WIDTH) || CV__SIMD_FORCE_WIDTH == 256)
459 #define CV__SIMD_NAMESPACE simd256
460 namespace CV__SIMD_NAMESPACE {
462 #define CV_SIMD_64F CV_SIMD256_64F
463 #define CV_SIMD_FP16 CV_SIMD256_FP16
464 #define CV_SIMD_WIDTH 32
468 typedef v_uint8x32 v_uint8;
470 typedef v_int8x32 v_int8;
472 typedef v_uint16x16 v_uint16;
474 typedef v_int16x16 v_int16;
476 typedef v_uint32x8 v_uint32;
478 typedef v_int32x8 v_int32;
480 typedef v_uint64x4 v_uint64;
482 typedef v_int64x4 v_int64;
484 typedef v_float32x8 v_float32;
487 typedef v_float64x4 v_float64;
491 #define VXPREFIX(func) v256##func
493 using namespace CV__SIMD_NAMESPACE;
494 #elif (CV_SIMD128 || CV_SIMD128_CPP) && (!defined(CV__SIMD_FORCE_WIDTH) || CV__SIMD_FORCE_WIDTH == 128)
495 #if defined CV_SIMD128_CPP
496 #define CV__SIMD_NAMESPACE simd128_cpp
498 #define CV__SIMD_NAMESPACE simd128
500 namespace CV__SIMD_NAMESPACE {
501 #define CV_SIMD CV_SIMD128
502 #define CV_SIMD_64F CV_SIMD128_64F
503 #define CV_SIMD_WIDTH 16
530 #define VXPREFIX(func) v##func
532 using namespace CV__SIMD_NAMESPACE;
534 #elif CV_SIMD_SCALABLE
535 #define CV__SIMD_NAMESPACE simd
536 namespace CV__SIMD_NAMESPACE {
538 #define CV_SIMD_WIDTH 128
540 #define VXPREFIX(func) v##func
542 using namespace CV__SIMD_NAMESPACE;
548 #define CV_SIMD_64F 0
551 namespace CV__SIMD_NAMESPACE {
557 inline v_uint8 vx_setall_u8(
uchar v) {
return VXPREFIX(_setall_u8)(v); }
558 inline v_int8 vx_setall_s8(
schar v) {
return VXPREFIX(_setall_s8)(v); }
559 inline v_uint16 vx_setall_u16(
ushort v) {
return VXPREFIX(_setall_u16)(v); }
560 inline v_int16 vx_setall_s16(
short v) {
return VXPREFIX(_setall_s16)(v); }
561 inline v_int32 vx_setall_s32(
int v) {
return VXPREFIX(_setall_s32)(v); }
562 inline v_uint32 vx_setall_u32(
unsigned v) {
return VXPREFIX(_setall_u32)(v); }
563 inline v_float32 vx_setall_f32(
float v) {
return VXPREFIX(_setall_f32)(v); }
564 inline v_int64 vx_setall_s64(
int64 v) {
return VXPREFIX(_setall_s64)(v); }
565 inline v_uint64 vx_setall_u64(
uint64 v) {
return VXPREFIX(_setall_u64)(v); }
566 #if CV_SIMD_64F || CV_SIMD_SCALABLE_64F
567 inline v_float64 vx_setall_f64(
double v) {
return VXPREFIX(_setall_f64)(v); }
574 inline v_uint8 vx_setzero_u8() {
return VXPREFIX(_setzero_u8)(); }
575 inline v_int8 vx_setzero_s8() {
return VXPREFIX(_setzero_s8)(); }
576 inline v_uint16 vx_setzero_u16() {
return VXPREFIX(_setzero_u16)(); }
577 inline v_int16 vx_setzero_s16() {
return VXPREFIX(_setzero_s16)(); }
578 inline v_int32 vx_setzero_s32() {
return VXPREFIX(_setzero_s32)(); }
579 inline v_uint32 vx_setzero_u32() {
return VXPREFIX(_setzero_u32)(); }
580 inline v_float32 vx_setzero_f32() {
return VXPREFIX(_setzero_f32)(); }
581 inline v_int64 vx_setzero_s64() {
return VXPREFIX(_setzero_s64)(); }
582 inline v_uint64 vx_setzero_u64() {
return VXPREFIX(_setzero_u64)(); }
583 #if CV_SIMD_64F || CV_SIMD_SCALABLE_64F
584 inline v_float64 vx_setzero_f64() {
return VXPREFIX(_setzero_f64)(); }
591 inline v_uint8 vx_load(
const uchar * ptr) {
return VXPREFIX(_load)(ptr); }
592 inline v_int8 vx_load(
const schar * ptr) {
return VXPREFIX(_load)(ptr); }
593 inline v_uint16 vx_load(
const ushort * ptr) {
return VXPREFIX(_load)(ptr); }
594 inline v_int16 vx_load(
const short * ptr) {
return VXPREFIX(_load)(ptr); }
595 inline v_int32 vx_load(
const int * ptr) {
return VXPREFIX(_load)(ptr); }
596 inline v_uint32 vx_load(
const unsigned * ptr) {
return VXPREFIX(_load)(ptr); }
597 inline v_float32 vx_load(
const float * ptr) {
return VXPREFIX(_load)(ptr); }
598 inline v_int64 vx_load(
const int64 * ptr) {
return VXPREFIX(_load)(ptr); }
599 inline v_uint64 vx_load(
const uint64 * ptr) {
return VXPREFIX(_load)(ptr); }
600 #if CV_SIMD_64F || CV_SIMD_SCALABLE_64F
601 inline v_float64 vx_load(
const double * ptr) {
return VXPREFIX(_load)(ptr); }
608 inline v_uint8 vx_load_aligned(
const uchar * ptr) {
return VXPREFIX(_load_aligned)(ptr); }
609 inline v_int8 vx_load_aligned(
const schar * ptr) {
return VXPREFIX(_load_aligned)(ptr); }
610 inline v_uint16 vx_load_aligned(
const ushort * ptr) {
return VXPREFIX(_load_aligned)(ptr); }
611 inline v_int16 vx_load_aligned(
const short * ptr) {
return VXPREFIX(_load_aligned)(ptr); }
612 inline v_int32 vx_load_aligned(
const int * ptr) {
return VXPREFIX(_load_aligned)(ptr); }
613 inline v_uint32 vx_load_aligned(
const unsigned * ptr) {
return VXPREFIX(_load_aligned)(ptr); }
614 inline v_float32 vx_load_aligned(
const float * ptr) {
return VXPREFIX(_load_aligned)(ptr); }
615 inline v_int64 vx_load_aligned(
const int64 * ptr) {
return VXPREFIX(_load_aligned)(ptr); }
616 inline v_uint64 vx_load_aligned(
const uint64 * ptr) {
return VXPREFIX(_load_aligned)(ptr); }
617 #if CV_SIMD_64F || CV_SIMD_SCALABLE_64F
618 inline v_float64 vx_load_aligned(
const double * ptr) {
return VXPREFIX(_load_aligned)(ptr); }
625 inline v_uint8 vx_load_low(
const uchar * ptr) {
return VXPREFIX(_load_low)(ptr); }
626 inline v_int8 vx_load_low(
const schar * ptr) {
return VXPREFIX(_load_low)(ptr); }
627 inline v_uint16 vx_load_low(
const ushort * ptr) {
return VXPREFIX(_load_low)(ptr); }
628 inline v_int16 vx_load_low(
const short * ptr) {
return VXPREFIX(_load_low)(ptr); }
629 inline v_int32 vx_load_low(
const int * ptr) {
return VXPREFIX(_load_low)(ptr); }
630 inline v_uint32 vx_load_low(
const unsigned * ptr) {
return VXPREFIX(_load_low)(ptr); }
631 inline v_float32 vx_load_low(
const float * ptr) {
return VXPREFIX(_load_low)(ptr); }
632 inline v_int64 vx_load_low(
const int64 * ptr) {
return VXPREFIX(_load_low)(ptr); }
633 inline v_uint64 vx_load_low(
const uint64 * ptr) {
return VXPREFIX(_load_low)(ptr); }
634 #if CV_SIMD_64F || CV_SIMD_SCALABLE_64F
635 inline v_float64 vx_load_low(
const double * ptr) {
return VXPREFIX(_load_low)(ptr); }
642 inline v_uint8 vx_load_halves(
const uchar * ptr0,
const uchar * ptr1) {
return VXPREFIX(_load_halves)(ptr0, ptr1); }
643 inline v_int8 vx_load_halves(
const schar * ptr0,
const schar * ptr1) {
return VXPREFIX(_load_halves)(ptr0, ptr1); }
644 inline v_uint16 vx_load_halves(
const ushort * ptr0,
const ushort * ptr1) {
return VXPREFIX(_load_halves)(ptr0, ptr1); }
645 inline v_int16 vx_load_halves(
const short * ptr0,
const short * ptr1) {
return VXPREFIX(_load_halves)(ptr0, ptr1); }
646 inline v_int32 vx_load_halves(
const int * ptr0,
const int * ptr1) {
return VXPREFIX(_load_halves)(ptr0, ptr1); }
647 inline v_uint32 vx_load_halves(
const unsigned * ptr0,
const unsigned * ptr1) {
return VXPREFIX(_load_halves)(ptr0, ptr1); }
648 inline v_float32 vx_load_halves(
const float * ptr0,
const float * ptr1) {
return VXPREFIX(_load_halves)(ptr0, ptr1); }
649 inline v_int64 vx_load_halves(
const int64 * ptr0,
const int64 * ptr1) {
return VXPREFIX(_load_halves)(ptr0, ptr1); }
650 inline v_uint64 vx_load_halves(
const uint64 * ptr0,
const uint64 * ptr1) {
return VXPREFIX(_load_halves)(ptr0, ptr1); }
651 #if CV_SIMD_64F || CV_SIMD_SCALABLE_64F
652 inline v_float64 vx_load_halves(
const double * ptr0,
const double * ptr1) {
return VXPREFIX(_load_halves)(ptr0, ptr1); }
659 inline v_uint8 vx_lut(
const uchar * ptr,
const int*
idx) {
return VXPREFIX(_lut)(ptr,
idx); }
660 inline v_int8 vx_lut(
const schar * ptr,
const int*
idx) {
return VXPREFIX(_lut)(ptr,
idx); }
661 inline v_uint16 vx_lut(
const ushort * ptr,
const int*
idx) {
return VXPREFIX(_lut)(ptr,
idx); }
662 inline v_int16 vx_lut(
const short* ptr,
const int*
idx) {
return VXPREFIX(_lut)(ptr,
idx); }
663 inline v_int32 vx_lut(
const int* ptr,
const int*
idx) {
return VXPREFIX(_lut)(ptr,
idx); }
664 inline v_uint32 vx_lut(
const unsigned* ptr,
const int*
idx) {
return VXPREFIX(_lut)(ptr,
idx); }
665 inline v_float32 vx_lut(
const float* ptr,
const int*
idx) {
return VXPREFIX(_lut)(ptr,
idx); }
666 inline v_int64 vx_lut(
const int64 * ptr,
const int*
idx) {
return VXPREFIX(_lut)(ptr,
idx); }
667 inline v_uint64 vx_lut(
const uint64 * ptr,
const int*
idx) {
return VXPREFIX(_lut)(ptr,
idx); }
668 #if CV_SIMD_64F || CV_SIMD_SCALABLE_64F
669 inline v_float64 vx_lut(
const double* ptr,
const int*
idx) {
return VXPREFIX(_lut)(ptr,
idx); }
676 inline v_uint8 vx_lut_pairs(
const uchar * ptr,
const int*
idx) {
return VXPREFIX(_lut_pairs)(ptr,
idx); }
677 inline v_int8 vx_lut_pairs(
const schar * ptr,
const int*
idx) {
return VXPREFIX(_lut_pairs)(ptr,
idx); }
678 inline v_uint16 vx_lut_pairs(
const ushort * ptr,
const int*
idx) {
return VXPREFIX(_lut_pairs)(ptr,
idx); }
679 inline v_int16 vx_lut_pairs(
const short* ptr,
const int*
idx) {
return VXPREFIX(_lut_pairs)(ptr,
idx); }
680 inline v_int32 vx_lut_pairs(
const int* ptr,
const int*
idx) {
return VXPREFIX(_lut_pairs)(ptr,
idx); }
681 inline v_uint32 vx_lut_pairs(
const unsigned* ptr,
const int*
idx) {
return VXPREFIX(_lut_pairs)(ptr,
idx); }
682 inline v_float32 vx_lut_pairs(
const float* ptr,
const int*
idx) {
return VXPREFIX(_lut_pairs)(ptr,
idx); }
683 inline v_int64 vx_lut_pairs(
const int64 * ptr,
const int*
idx) {
return VXPREFIX(_lut_pairs)(ptr,
idx); }
684 inline v_uint64 vx_lut_pairs(
const uint64 * ptr,
const int*
idx) {
return VXPREFIX(_lut_pairs)(ptr,
idx); }
685 #if CV_SIMD_64F || CV_SIMD_SCALABLE_64F
686 inline v_float64 vx_lut_pairs(
const double* ptr,
const int*
idx) {
return VXPREFIX(_lut_pairs)(ptr,
idx); }
693 inline v_uint8 vx_lut_quads(
const uchar* ptr,
const int*
idx) {
return VXPREFIX(_lut_quads)(ptr,
idx); }
694 inline v_int8 vx_lut_quads(
const schar* ptr,
const int*
idx) {
return VXPREFIX(_lut_quads)(ptr,
idx); }
695 inline v_uint16 vx_lut_quads(
const ushort* ptr,
const int*
idx) {
return VXPREFIX(_lut_quads)(ptr,
idx); }
696 inline v_int16 vx_lut_quads(
const short* ptr,
const int*
idx) {
return VXPREFIX(_lut_quads)(ptr,
idx); }
697 inline v_int32 vx_lut_quads(
const int* ptr,
const int*
idx) {
return VXPREFIX(_lut_quads)(ptr,
idx); }
698 inline v_uint32 vx_lut_quads(
const unsigned* ptr,
const int*
idx) {
return VXPREFIX(_lut_quads)(ptr,
idx); }
699 inline v_float32 vx_lut_quads(
const float* ptr,
const int*
idx) {
return VXPREFIX(_lut_quads)(ptr,
idx); }
705 inline v_uint16 vx_load_expand(
const uchar * ptr) {
return VXPREFIX(_load_expand)(ptr); }
706 inline v_int16 vx_load_expand(
const schar * ptr) {
return VXPREFIX(_load_expand)(ptr); }
707 inline v_uint32 vx_load_expand(
const ushort * ptr) {
return VXPREFIX(_load_expand)(ptr); }
708 inline v_int32 vx_load_expand(
const short* ptr) {
return VXPREFIX(_load_expand)(ptr); }
709 inline v_int64 vx_load_expand(
const int* ptr) {
return VXPREFIX(_load_expand)(ptr); }
710 inline v_uint64 vx_load_expand(
const unsigned* ptr) {
return VXPREFIX(_load_expand)(ptr); }
711 inline v_float32 vx_load_expand(
const hfloat * ptr) {
return VXPREFIX(_load_expand)(ptr); }
717 inline v_uint32 vx_load_expand_q(
const uchar * ptr) {
return VXPREFIX(_load_expand_q)(ptr); }
718 inline v_int32 vx_load_expand_q(
const schar * ptr) {
return VXPREFIX(_load_expand_q)(ptr); }
722 inline void vx_cleanup() { VXPREFIX(_cleanup)(); }
724 #if !CV_SIMD_SCALABLE && !(CV_NEON && !defined(CV_FORCE_SIMD128_CPP))
727 template<
typename T>
struct VTraits {
728 static inline int vlanes() {
return T::nlanes; }
729 enum { nlanes = T::nlanes, max_nlanes = T::nlanes };
730 using lane_type =
typename T::lane_type;
733 #define OPENCV_HAL_WRAP_BIN_OP_ADDSUB(_Tpvec) \
734 inline _Tpvec v_add(const _Tpvec& a, const _Tpvec& b) \
738 inline _Tpvec v_sub(const _Tpvec& a, const _Tpvec& b) \
742 template<typename... Args> \
743 inline _Tpvec v_add(const _Tpvec& f1, const _Tpvec& f2, const Args&... vf) { \
744 return v_add(f1 + f2, vf...); \
746 #define OPENCV_HAL_WRAP_SHIFT_OP(_Tpvec) \
747 inline _Tpvec v_shr(const _Tpvec& a, int n) \
751 inline _Tpvec v_shl(const _Tpvec& a, int n) \
756 OPENCV_HAL_WRAP_SHIFT_OP(v_uint16)
757 OPENCV_HAL_WRAP_SHIFT_OP(v_uint32)
758 OPENCV_HAL_WRAP_SHIFT_OP(v_uint64)
759 OPENCV_HAL_WRAP_SHIFT_OP(v_int16)
760 OPENCV_HAL_WRAP_SHIFT_OP(v_int32)
761 OPENCV_HAL_WRAP_SHIFT_OP(v_int64)
762 OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_uint8)
763 OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_uint16)
764 OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_uint32)
765 OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_uint64)
766 OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_int8)
767 OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_int16)
768 OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_int32)
769 OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_int64)
770 OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_float32)
772 OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_float64)
774 #if CV_SIMD_WIDTH != 16 && CV_SIMD128
795 #if CV_SIMD_WIDTH != 32 && CV_SIMD256
797 OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_uint8x32)
798 OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_uint16x16)
799 OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_uint32x8)
800 OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_uint64x4)
801 OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_int8x32)
802 OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_int16x16)
803 OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_int32x8)
804 OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_int64x4)
805 OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_float32x8)
806 OPENCV_HAL_WRAP_SHIFT_OP(v_uint16x16)
807 OPENCV_HAL_WRAP_SHIFT_OP(v_uint32x8)
808 OPENCV_HAL_WRAP_SHIFT_OP(v_uint64x4)
809 OPENCV_HAL_WRAP_SHIFT_OP(v_int16x16)
810 OPENCV_HAL_WRAP_SHIFT_OP(v_int32x8)
811 OPENCV_HAL_WRAP_SHIFT_OP(v_int64x4)
813 OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_float64x4)
817 #define OPENCV_HAL_WRAP_BIN_OP_LOGIC(_Tpvec) \
818 inline _Tpvec v_and(const _Tpvec& a, const _Tpvec& b) \
822 inline _Tpvec v_or(const _Tpvec& a, const _Tpvec& b) \
826 inline _Tpvec v_xor(const _Tpvec& a, const _Tpvec& b) \
831 #define OPENCV_HAL_WRAP_NOT_OP(_Tpvec) \
832 inline _Tpvec v_not(const _Tpvec& a) \
837 OPENCV_HAL_WRAP_BIN_OP_LOGIC(v_uint8)
838 OPENCV_HAL_WRAP_BIN_OP_LOGIC(v_uint16)
839 OPENCV_HAL_WRAP_BIN_OP_LOGIC(v_uint32)
840 OPENCV_HAL_WRAP_BIN_OP_LOGIC(v_uint64)
841 OPENCV_HAL_WRAP_BIN_OP_LOGIC(v_int8)
842 OPENCV_HAL_WRAP_BIN_OP_LOGIC(v_int16)
843 OPENCV_HAL_WRAP_BIN_OP_LOGIC(v_int32)
844 OPENCV_HAL_WRAP_BIN_OP_LOGIC(v_int64)
845 OPENCV_HAL_WRAP_BIN_OP_LOGIC(v_float32)
846 OPENCV_HAL_WRAP_NOT_OP(v_uint8)
847 OPENCV_HAL_WRAP_NOT_OP(v_uint16)
848 OPENCV_HAL_WRAP_NOT_OP(v_uint32)
849 OPENCV_HAL_WRAP_NOT_OP(v_uint64)
850 OPENCV_HAL_WRAP_NOT_OP(v_int8)
851 OPENCV_HAL_WRAP_NOT_OP(v_int16)
852 OPENCV_HAL_WRAP_NOT_OP(v_int32)
853 OPENCV_HAL_WRAP_NOT_OP(v_int64)
855 OPENCV_HAL_WRAP_BIN_OP_LOGIC(v_float64)
857 #if CV_SIMD_WIDTH != 16 && CV_SIMD128
879 #if CV_SIMD_WIDTH != 32 && CV_SIMD256
880 OPENCV_HAL_WRAP_BIN_OP_LOGIC(v_uint8x32)
881 OPENCV_HAL_WRAP_BIN_OP_LOGIC(v_uint16x16)
882 OPENCV_HAL_WRAP_BIN_OP_LOGIC(v_uint32x8)
883 OPENCV_HAL_WRAP_BIN_OP_LOGIC(v_uint64x4)
884 OPENCV_HAL_WRAP_BIN_OP_LOGIC(v_int8x32)
885 OPENCV_HAL_WRAP_BIN_OP_LOGIC(v_int16x16)
886 OPENCV_HAL_WRAP_BIN_OP_LOGIC(v_int32x8)
887 OPENCV_HAL_WRAP_BIN_OP_LOGIC(v_int64x4)
888 OPENCV_HAL_WRAP_BIN_OP_LOGIC(v_float32x8)
889 OPENCV_HAL_WRAP_NOT_OP(v_uint8x32)
890 OPENCV_HAL_WRAP_NOT_OP(v_uint16x16)
891 OPENCV_HAL_WRAP_NOT_OP(v_uint32x8)
892 OPENCV_HAL_WRAP_NOT_OP(v_uint64x4)
893 OPENCV_HAL_WRAP_NOT_OP(v_int8x32)
894 OPENCV_HAL_WRAP_NOT_OP(v_int16x16)
895 OPENCV_HAL_WRAP_NOT_OP(v_int32x8)
896 OPENCV_HAL_WRAP_NOT_OP(v_int64x4)
898 OPENCV_HAL_WRAP_BIN_OP_LOGIC(v_float64x4)
902 #define OPENCV_HAL_WRAP_BIN_OP_MUL(_Tpvec) \
903 inline _Tpvec v_mul(const _Tpvec& a, const _Tpvec& b) \
907 template<typename... Args> \
908 inline _Tpvec v_mul(const _Tpvec& f1, const _Tpvec& f2, const Args&... vf) { \
909 return v_mul(f1 * f2, vf...); \
911 OPENCV_HAL_WRAP_BIN_OP_MUL(v_uint8)
912 OPENCV_HAL_WRAP_BIN_OP_MUL(v_int8)
913 OPENCV_HAL_WRAP_BIN_OP_MUL(v_uint16)
914 OPENCV_HAL_WRAP_BIN_OP_MUL(v_uint32)
915 OPENCV_HAL_WRAP_BIN_OP_MUL(v_int16)
916 OPENCV_HAL_WRAP_BIN_OP_MUL(v_int32)
917 OPENCV_HAL_WRAP_BIN_OP_MUL(v_float32)
919 OPENCV_HAL_WRAP_BIN_OP_MUL(v_float64)
921 #if CV_SIMD_WIDTH != 16 && CV_SIMD128
933 #if CV_SIMD_WIDTH != 32 && CV_SIMD256
934 OPENCV_HAL_WRAP_BIN_OP_MUL(v_uint8x32)
935 OPENCV_HAL_WRAP_BIN_OP_MUL(v_uint16x16)
936 OPENCV_HAL_WRAP_BIN_OP_MUL(v_uint32x8)
937 OPENCV_HAL_WRAP_BIN_OP_MUL(v_int8x32)
938 OPENCV_HAL_WRAP_BIN_OP_MUL(v_int16x16)
939 OPENCV_HAL_WRAP_BIN_OP_MUL(v_int32x8)
940 OPENCV_HAL_WRAP_BIN_OP_MUL(v_float32x8)
942 OPENCV_HAL_WRAP_BIN_OP_MUL(v_float64x4)
946 #define OPENCV_HAL_WRAP_BIN_OP_DIV(_Tpvec) \
947 inline _Tpvec v_div(const _Tpvec& a, const _Tpvec& b) \
951 OPENCV_HAL_WRAP_BIN_OP_DIV(v_float32)
953 OPENCV_HAL_WRAP_BIN_OP_DIV(v_float64)
955 #if CV_SIMD_WIDTH != 16 && CV_SIMD128
961 #if CV_SIMD_WIDTH != 32 && CV_SIMD256
962 OPENCV_HAL_WRAP_BIN_OP_DIV(v_float32x8)
964 OPENCV_HAL_WRAP_BIN_OP_DIV(v_float64x4)
968 #define OPENCV_HAL_WRAP_CMP_OP(_Tpvec, intrin, op) \
969 inline _Tpvec v_##intrin(const _Tpvec& a, const _Tpvec& b) \
973 #define OPENCV_HAL_WRAP_EQ_OP(_Tpvec) \
974 inline _Tpvec v_eq(const _Tpvec& a, const _Tpvec& b) \
978 inline _Tpvec v_ne(const _Tpvec& a, const _Tpvec& b) \
983 #define OPENCV_HAL_WRAP_CMP(_Tpvec) \
984 OPENCV_HAL_WRAP_CMP_OP(_Tpvec, eq, ==) \
985 OPENCV_HAL_WRAP_CMP_OP(_Tpvec, ne, !=) \
986 OPENCV_HAL_WRAP_CMP_OP(_Tpvec, lt, <) \
987 OPENCV_HAL_WRAP_CMP_OP(_Tpvec, gt, >) \
988 OPENCV_HAL_WRAP_CMP_OP(_Tpvec, le, <=) \
989 OPENCV_HAL_WRAP_CMP_OP(_Tpvec, ge, >=)
991 OPENCV_HAL_WRAP_CMP(v_uint8)
992 OPENCV_HAL_WRAP_CMP(v_uint16)
993 OPENCV_HAL_WRAP_CMP(v_uint32)
994 OPENCV_HAL_WRAP_EQ_OP(v_uint64)
995 OPENCV_HAL_WRAP_CMP(v_int8)
996 OPENCV_HAL_WRAP_CMP(v_int16)
997 OPENCV_HAL_WRAP_CMP(v_int32)
998 OPENCV_HAL_WRAP_EQ_OP(v_int64)
999 OPENCV_HAL_WRAP_CMP(v_float32)
1001 OPENCV_HAL_WRAP_CMP(v_float64)
1003 #if CV_SIMD_WIDTH != 16 && CV_SIMD128
1017 #if CV_SIMD_WIDTH != 32 && CV_SIMD256
1018 OPENCV_HAL_WRAP_CMP(v_uint8x32)
1019 OPENCV_HAL_WRAP_CMP(v_uint16x16)
1020 OPENCV_HAL_WRAP_CMP(v_uint32x8)
1021 OPENCV_HAL_WRAP_EQ_OP(v_uint64x4)
1022 OPENCV_HAL_WRAP_CMP(v_int8x32)
1023 OPENCV_HAL_WRAP_CMP(v_int16x16)
1024 OPENCV_HAL_WRAP_CMP(v_int32x8)
1025 OPENCV_HAL_WRAP_EQ_OP(v_int64x4)
1026 OPENCV_HAL_WRAP_CMP(v_float32x8)
1028 OPENCV_HAL_WRAP_CMP(v_float64x4)
1033 #define OPENCV_HAL_WRAP_GRT0(_Tpvec) \
1034 inline typename VTraits<_Tpvec>::lane_type v_get0(const _Tpvec& v) \
1039 OPENCV_HAL_WRAP_GRT0(v_uint8)
1040 OPENCV_HAL_WRAP_GRT0(v_int8)
1041 OPENCV_HAL_WRAP_GRT0(v_uint16)
1042 OPENCV_HAL_WRAP_GRT0(v_int16)
1043 OPENCV_HAL_WRAP_GRT0(v_uint32)
1044 OPENCV_HAL_WRAP_GRT0(v_int32)
1045 OPENCV_HAL_WRAP_GRT0(v_uint64)
1046 OPENCV_HAL_WRAP_GRT0(v_int64)
1047 OPENCV_HAL_WRAP_GRT0(v_float32)
1049 OPENCV_HAL_WRAP_GRT0(v_float64)
1051 #if CV_SIMD_WIDTH != 16 && CV_SIMD128
1065 #if CV_SIMD_WIDTH != 32 && CV_SIMD256
1066 OPENCV_HAL_WRAP_GRT0(v_uint8x32)
1067 OPENCV_HAL_WRAP_GRT0(v_uint16x16)
1068 OPENCV_HAL_WRAP_GRT0(v_uint32x8)
1069 OPENCV_HAL_WRAP_GRT0(v_uint64x4)
1070 OPENCV_HAL_WRAP_GRT0(v_int8x32)
1071 OPENCV_HAL_WRAP_GRT0(v_int16x16)
1072 OPENCV_HAL_WRAP_GRT0(v_int32x8)
1073 OPENCV_HAL_WRAP_GRT0(v_int64x4)
1074 OPENCV_HAL_WRAP_GRT0(v_float32x8)
1076 OPENCV_HAL_WRAP_GRT0(v_float64x4)
1080 #define OPENCV_HAL_WRAP_EXTRACT(_Tpvec) \
1081 inline typename VTraits<_Tpvec>::lane_type v_extract_highest(const _Tpvec& v) \
1083 return v_extract_n<VTraits<_Tpvec>::nlanes-1>(v); \
1086 OPENCV_HAL_WRAP_EXTRACT(v_uint8)
1087 OPENCV_HAL_WRAP_EXTRACT(v_int8)
1088 OPENCV_HAL_WRAP_EXTRACT(v_uint16)
1089 OPENCV_HAL_WRAP_EXTRACT(v_int16)
1090 OPENCV_HAL_WRAP_EXTRACT(v_uint32)
1091 OPENCV_HAL_WRAP_EXTRACT(v_int32)
1092 OPENCV_HAL_WRAP_EXTRACT(v_uint64)
1093 OPENCV_HAL_WRAP_EXTRACT(v_int64)
1094 OPENCV_HAL_WRAP_EXTRACT(v_float32)
1096 OPENCV_HAL_WRAP_EXTRACT(v_float64)
1098 #if CV_SIMD_WIDTH != 16 && CV_SIMD128
1112 #if CV_SIMD_WIDTH != 32 && CV_SIMD256
1113 OPENCV_HAL_WRAP_EXTRACT(v_uint8x32)
1114 OPENCV_HAL_WRAP_EXTRACT(v_uint16x16)
1115 OPENCV_HAL_WRAP_EXTRACT(v_uint32x8)
1116 OPENCV_HAL_WRAP_EXTRACT(v_uint64x4)
1117 OPENCV_HAL_WRAP_EXTRACT(v_int8x32)
1118 OPENCV_HAL_WRAP_EXTRACT(v_int16x16)
1119 OPENCV_HAL_WRAP_EXTRACT(v_int32x8)
1120 OPENCV_HAL_WRAP_EXTRACT(v_int64x4)
1121 OPENCV_HAL_WRAP_EXTRACT(v_float32x8)
1123 OPENCV_HAL_WRAP_EXTRACT(v_float64x4)
1127 #define OPENCV_HAL_WRAP_BROADCAST(_Tpvec) \
1128 inline _Tpvec v_broadcast_highest(const _Tpvec& v) \
1130 return v_broadcast_element<VTraits<_Tpvec>::nlanes-1>(v); \
1133 OPENCV_HAL_WRAP_BROADCAST(v_uint32)
1134 OPENCV_HAL_WRAP_BROADCAST(v_int32)
1135 OPENCV_HAL_WRAP_BROADCAST(v_float32)
1136 #if CV_SIMD_WIDTH != 16 && CV_SIMD128
1141 #if CV_SIMD_WIDTH != 32 && CV_SIMD256
1142 OPENCV_HAL_WRAP_BROADCAST(v_uint32x8)
1143 OPENCV_HAL_WRAP_BROADCAST(v_int32x8)
1144 OPENCV_HAL_WRAP_BROADCAST(v_float32x8)
1149 #if (CV_NEON ) && !defined(CV_FORCE_SIMD128_CPP)
1151 #define OPENCV_HAL_WRAP_BIN_OP_ADDSUB(_Tpvec) \
1152 template<typename... Args> \
1153 inline _Tpvec v_add(const _Tpvec& f1, const _Tpvec& f2, const Args&... vf) { \
1154 return v_add(v_add(f1, f2), vf...); \
1157 OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_uint8)
1158 OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_uint16)
1159 OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_uint32)
1160 OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_uint64)
1161 OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_int8)
1162 OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_int16)
1163 OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_int32)
1164 OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_int64)
1165 OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_float32)
1167 OPENCV_HAL_WRAP_BIN_OP_ADDSUB(v_float64)
1170 #define OPENCV_HAL_WRAP_BIN_OP_MUL(_Tpvec) \
1171 template<typename... Args> \
1172 inline _Tpvec v_mul(const _Tpvec& f1, const _Tpvec& f2, const Args&... vf) { \
1173 return v_mul(v_mul(f1, f2), vf...); \
1175 OPENCV_HAL_WRAP_BIN_OP_MUL(v_uint8)
1176 OPENCV_HAL_WRAP_BIN_OP_MUL(v_int8)
1177 OPENCV_HAL_WRAP_BIN_OP_MUL(v_uint16)
1178 OPENCV_HAL_WRAP_BIN_OP_MUL(v_uint32)
1179 OPENCV_HAL_WRAP_BIN_OP_MUL(v_int16)
1180 OPENCV_HAL_WRAP_BIN_OP_MUL(v_int32)
1181 OPENCV_HAL_WRAP_BIN_OP_MUL(v_float32)
1183 OPENCV_HAL_WRAP_BIN_OP_MUL(v_float64)
1186 #define OPENCV_HAL_WRAP_EXTRACT(_Tpvec) \
1187 inline typename VTraits<_Tpvec>::lane_type v_extract_highest(const _Tpvec& v) \
1189 return v_extract_n<VTraits<_Tpvec>::nlanes-1>(v); \
1192 OPENCV_HAL_WRAP_EXTRACT(v_uint8)
1193 OPENCV_HAL_WRAP_EXTRACT(v_int8)
1194 OPENCV_HAL_WRAP_EXTRACT(v_uint16)
1195 OPENCV_HAL_WRAP_EXTRACT(v_int16)
1196 OPENCV_HAL_WRAP_EXTRACT(v_uint32)
1197 OPENCV_HAL_WRAP_EXTRACT(v_int32)
1198 OPENCV_HAL_WRAP_EXTRACT(v_uint64)
1199 OPENCV_HAL_WRAP_EXTRACT(v_int64)
1200 OPENCV_HAL_WRAP_EXTRACT(v_float32)
1202 OPENCV_HAL_WRAP_EXTRACT(v_float64)
1205 #define OPENCV_HAL_WRAP_BROADCAST(_Tpvec) \
1206 inline _Tpvec v_broadcast_highest(const _Tpvec& v) \
1208 return v_broadcast_element<VTraits<_Tpvec>::nlanes-1>(v); \
1211 OPENCV_HAL_WRAP_BROADCAST(v_uint32)
1212 OPENCV_HAL_WRAP_BROADCAST(v_int32)
1213 OPENCV_HAL_WRAP_BROADCAST(v_float32)
1220 template<
typename _Tp,
typename _Tvec>
static inline
1221 void vx_store(_Tp*
dst,
const _Tvec& v) {
return v_store(
dst, v); }
1223 template<
typename _Tp,
typename _Tvec>
static inline
1234 #ifndef CV_SIMD_FP16
1235 #define CV_SIMD_FP16 0
1242 #include "simd_utils.impl.hpp"
1245 CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END
1252 #if defined(__GNUC__) && __GNUC__ == 12
1253 #pragma GCC diagnostic pop
int CvScalar value
Definition: core_c.h:720
const int * idx
Definition: core_c.h:668
int index
Definition: core_c.h:634
signed char schar
Definition: interface.h:48
unsigned char uchar
Definition: interface.h:51
int64_t int64
Definition: interface.h:61
unsigned short ushort
Definition: interface.h:52
uint64_t uint64
Definition: interface.h:62
v_reg< schar, 16 > v_int8x16
Sixteen 8-bit signed integer values.
Definition: intrin_cpp.hpp:491
v_reg< uchar, 16 > v_uint8x16
Sixteen 8-bit unsigned integer values.
Definition: intrin_cpp.hpp:489
v_reg< int64, 2 > v_int64x2
Two 64-bit signed integer values.
Definition: intrin_cpp.hpp:507
void v_store(_Tp *ptr, const v_reg< _Tp, n > &a)
Store data to memory.
Definition: intrin_cpp.hpp:2190
v_reg< ushort, 8 > v_uint16x8
Eight 16-bit unsigned integer values.
Definition: intrin_cpp.hpp:493
v_reg< int, 4 > v_int32x4
Four 32-bit signed integer values.
Definition: intrin_cpp.hpp:499
v_reg< unsigned, 4 > v_uint32x4
Four 32-bit unsigned integer values.
Definition: intrin_cpp.hpp:497
v_reg< uint64, 2 > v_uint64x2
Two 64-bit unsigned integer values.
Definition: intrin_cpp.hpp:505
v_reg< float, 4 > v_float32x4
Four 32-bit floating point values (single precision)
Definition: intrin_cpp.hpp:501
void v_store_aligned(_Tp *ptr, const v_reg< _Tp, n > &a)
Store data to memory (aligned)
Definition: intrin_cpp.hpp:2251
v_reg< short, 8 > v_int16x8
Eight 16-bit signed integer values.
Definition: intrin_cpp.hpp:495
v_reg< double, 2 > v_float64x2
Two 64-bit floating point values (double precision)
Definition: intrin_cpp.hpp:503
OutputArray dst
Definition: imgproc.hpp:3564
StoreMode
Definition: intrin.hpp:100
@ STORE_ALIGNED_NOCACHE
Definition: intrin.hpp:103
@ STORE_ALIGNED
Definition: intrin.hpp:102
@ STORE_UNALIGNED
Definition: intrin.hpp:101
"black box" representation of the file storage associated with a file on disk.
Definition: calib3d.hpp:441
CV_INTRIN_DEF_TYPE_TRAITS_NO_Q_TYPE(unsigned, int, unsigned, unsigned, uint64, unsigned)
CV_INTRIN_DEF_TYPE_TRAITS(uchar, schar, uchar, uchar, ushort, unsigned, unsigned)
Definition: intrin.hpp:110