116 struct svec<
LANES,bool>;
118 struct svec<
LANES,int8_t>;
120 struct svec<
LANES,uint8_t>;
122 struct svec<
LANES,int16_t>;
124 struct svec<
LANES,uint16_t>;
126 struct svec<
LANES,int32_t>;
128 struct svec<
LANES,uint32_t>;
130 struct svec<
LANES,int64_t>;
132 struct svec<
LANES,uint64_t>;
134 struct svec<
LANES,float>;
136 struct svec<
LANES,double>;
138 struct svec<
LANES,void*>;
165 uint32_t e, uint32_t f, uint32_t g, uint32_t h) {
166 v = ((a ? 1 : 0) |(b ? 2 : 0)|(c ? 4 : 0)|(d ? 8 : 0)
167 |(e ? 16 : 0) |(f ? 32 : 0)|(g ? 64 : 0)|(h ? 128 : 0) );
202 int8_t e, int8_t f, int8_t g, int8_t h) {
203 v[0] = a; v[1] = b; v[2] = c; v[3] = d;
204 v[4] = e; v[5] = f; v[6] = g; v[7] = h;
211 v[0] = v[1] = v[2] = v[3] = v[4] = v[5] = v[6] = v[7] = a;
240 uint8_t e, uint8_t f, uint8_t g, uint8_t h) {
241 v[0] = a; v[1] = b; v[2] = c; v[3] = d;
242 v[4] = e; v[5] = f; v[6] = g; v[7] = h;
250 v[0] = v[1] = v[2] = v[3] = v[4] = v[5] = v[6] = v[7] = a;
279 int16_t e, int16_t f, int16_t g, int16_t h) {
280 v[0] = a; v[1] = b; v[2] = c; v[3] = d;
281 v[4] = e; v[5] = f; v[6] = g; v[7] = h;
289 v[0] = v[1] = v[2] = v[3] = v[4] = v[5] = v[6] = v[7] = a;
319 uint16_t e, uint16_t f, uint16_t g, uint16_t h) {
320 v[0] = a; v[1] = b; v[2] = c; v[3] = d;
321 v[4] = e; v[5] = f; v[6] = g; v[7] = h;
329 v[0] = v[1] = v[2] = v[3] = v[4] = v[5] = v[6] = v[7] = a;
359 int e,
int f,
int g,
int h) {
360 v[0] = a; v[1] = b; v[2] = c; v[3] = d;
361 v[4] = e; v[5] = f; v[6] = g; v[7] = h;
369 v[0] = v[1] = v[2] = v[3] = v[4] = v[5] = v[6] = v[7] = a;
399 uint32_t e, uint32_t f, uint32_t g, uint32_t h) {
400 v[0] = a; v[1] = b; v[2] = c; v[3] = d;
401 v[4] = e; v[5] = f; v[6] = g; v[7] = h;
409 v[0] = v[1] = v[2] = v[3] = v[4] = v[5] = v[6] = v[7] = a;
438 int64_t e, int64_t f, int64_t g, int64_t h) {
439 v[0] = a; v[1] = b; v[2] = c; v[3] = d;
440 v[4] = e; v[5] = f; v[6] = g; v[7] = h;
448 v[0] = v[1] = v[2] = v[3] = v[4] = v[5] = v[6] = v[7] = a;
477 uint64_t e, uint64_t f, uint64_t g, uint64_t h) {
478 v[0] = a; v[1] = b; v[2] = c; v[3] = d;
479 v[4] = e; v[5] = f; v[6] = g; v[7] = h;
487 v[0] = v[1] = v[2] = v[3] = v[4] = v[5] = v[6] = v[7] = a;
516 float e,
float f,
float g,
float h) {
517 v[0] = a; v[1] = b; v[2] = c; v[3] = d;
518 v[4] = e; v[5] = f; v[6] = g; v[7] = h;
526 v[0] = v[1] = v[2] = v[3] = v[4] = v[5] = v[6] = v[7] = a;
555 double e,
double f,
double g,
double h) {
556 v[0] = a; v[1] = b; v[2] = c; v[3] = d;
557 v[4] = e; v[5] = f; v[6] = g; v[7] = h;
565 v[0] = v[1] = v[2] = v[3] = v[4] = v[5] = v[6] = v[7] = a;
590 return (v.v & (1 << index)) ? -1 : 0;
592 static FORCEINLINE void svec_insert(svec<LANES,bool> *v,
int index, uint32_t val) {
594 v->v &= ~(1 << index);
596 v->v |= (1 << index);
624 static FORCEINLINE svec<LANES,bool>
svec_select(svec<LANES,bool> mask, svec<LANES,bool> a, svec<LANES,bool> b) {
625 svec<LANES,bool> ret;
626 ret.
v = (a.v & mask.v) | (b.v & ~mask.v);
712 #if defined(__x86_64__) || defined(__PPC64__)
719 FORCEINLINE svec(
void* p0,
void* p1,
void* p2,
void* p3,
void* p4,
void* p5,
void* p6,
void* p7):
720 svec<
LANES,uint64_t>((uint64_t)(p0),(uint64_t)(p1),(uint64_t)(p2),(uint64_t)(p3),(uint64_t)(p4),(uint64_t)(p5),(uint64_t)(p6),(uint64_t)(p7)){}
729 FORCEINLINE svec(
void* p0,
void* p1,
void* p2,
void* p3,
void* p4,
void* p5,
void* p6,
void* p7):
730 svec<
LANES,uint32_t>((uint32_t)(p0),(uint32_t)(p1),(uint32_t)(p2),(uint32_t)(p3),(uint32_t)(p4),(uint32_t)(p5),(uint32_t)(p6),(uint32_t)(p7)){}
734 #ifndef DOXYGEN_SHOULD_SKIP_THIS //not want generate svec_gather*/svec_scatter methods
736 template <
class RetVecType>
static RetVecType svec_gather(svec<LANES, uint32_t> ptrs, svec<LANES,bool> mask);
737 template <
class RetVecType>
static RetVecType svec_gather(svec<LANES, uint64_t> ptrs, svec<LANES,bool> mask);
866 #endif //DOXYGEN_SHOULD_SKIP_THIS
897 static FORCEINLINE bool svec_any_true(
const svec<LANES,bool>& mask) {
898 return (mask.v != 0);
906 static FORCEINLINE bool svec_all_true(
const svec<LANES,bool>& mask) {
907 return (mask.v & 0xFF) == 0xFF;
916 static FORCEINLINE bool svec_none_true(
const svec<LANES,bool>& mask) {
917 return (mask.v == 0);
925 static FORCEINLINE svec<LANES,bool> svec_and(svec<LANES,bool> a, svec<LANES,bool> b) {
926 svec<LANES,bool> ret;
935 static FORCEINLINE svec<LANES,bool> svec_or(svec<LANES,bool> a, svec<LANES,bool> b) {
936 svec<LANES,bool> ret;
944 static FORCEINLINE svec<LANES,bool> svec_xor(svec<LANES,bool> a, svec<LANES,bool> b) {
945 svec<LANES,bool> ret;
953 static FORCEINLINE svec<LANES,bool> svec_not(svec<LANES,bool> a) {
954 svec<LANES,bool> ret;
965 static FORCEINLINE uint64_t svec_movmsk(svec<LANES,bool> mask) {
966 return (uint64_t)(mask.v);
991 UNARY_OP(
float, svec_round, roundf);
992 UNARY_OP(
double, svec_round, round);
994 UNARY_OP(
float, svec_floor, floorf);
995 UNARY_OP(
double, svec_floor, floor);
1003 UNARY_OP(
float, svec_rsqrt, 1.0/sqrtf);
1004 UNARY_OP(
double, svec_rsqrt, 1.0/sqrt);
1015 UNARY_OP(int8_t, svec_abs, abs<int8_t>);
1016 static FORCEINLINE svec<LANES,uint8_t> svec_abs(svec<LANES,uint8_t> v) {
return v;}
1017 UNARY_OP(int16_t, svec_abs, abs<int16_t>);
1018 static FORCEINLINE svec<LANES,uint16_t> svec_abs(svec<LANES,uint16_t> v) {
return v;}
1019 UNARY_OP(int32_t, svec_abs, abs<int32_t>);
1020 static FORCEINLINE svec<LANES,uint32_t> svec_abs(svec<LANES,uint32_t> v) {
return v;}
1021 UNARY_OP(int64_t, svec_abs, abs<int64_t>);
1022 static FORCEINLINE svec<LANES,uint64_t> svec_abs(svec<LANES,uint64_t> v) {
return v;}
1029 #define BINARY_OP_METHODS(STYPE) \
1030 BINARY_OP(STYPE, svec_add, +); \
1031 BINARY_OP(STYPE, svec_sub, -); \
1032 BINARY_OP(STYPE, svec_mul, *); \
1033 BINARY_OP(STYPE, svec_div, /); \
1034 BINARY_OP_SCALAR(STYPE, svec_add_scalar, +); \
1035 BINARY_SCALAR_OP(STYPE, svec_scalar_add, +); \
1036 BINARY_OP_SCALAR(STYPE, svec_sub_scalar, -); \
1037 BINARY_SCALAR_OP(STYPE, svec_scalar_sub, -); \
1038 BINARY_OP_SCALAR(STYPE, svec_mul_scalar, *); \
1039 BINARY_SCALAR_OP(STYPE, svec_scalar_mul, *); \
1040 BINARY_OP_SCALAR(STYPE, svec_div_scalar, /); \
1041 BINARY_SCALAR_OP(STYPE, svec_scalar_div, /); \
1043 #define INT_BINARY_OP_METHODS(STYPE) \
1044 BINARY_OP(STYPE, svec_or, |); \
1045 BINARY_OP(STYPE, svec_and, &); \
1046 BINARY_OP(STYPE, svec_xor, ^); \
1047 BINARY_SHT_SCALAR(STYPE, int32_t, svec_shl, <<); \
1048 BINARY_SHT_SCALAR(STYPE, int32_t, svec_shr, >>); \
1049 BINARY_OP(STYPE, svec_rem, %); \
1050 BINARY_OP_SCALAR(STYPE, svec_rem, %);
1081 BINARY_OP2(uint16_t, uint16_t, svec_shl, <<);
1083 BINARY_OP2(uint32_t, uint32_t, svec_shl, <<);
1085 BINARY_OP2(uint64_t, uint64_t, svec_shl, <<);
1091 BINARY_OP2(uint16_t, uint16_t, svec_shr, >>);
1093 BINARY_OP2(uint32_t, uint32_t, svec_shr, >>);
1095 BINARY_OP2(uint64_t, uint64_t, svec_shr, >>);
1109 #define MAX_MIN_REDUCE_METHODS(STYPE) \
1110 BINARY_OP_FUNC(STYPE, svec_max, max<STYPE>); \
1111 BINARY_OP_FUNC(STYPE, svec_min, min<STYPE>); \
1112 BINARY_OP_REDUCE_FUNC(STYPE, svec_reduce_add, add<STYPE>); \
1113 BINARY_OP_REDUCE_FUNC(STYPE, svec_reduce_max, max<STYPE>); \
1114 BINARY_OP_REDUCE_FUNC(STYPE, svec_reduce_min, min<STYPE>); \
1130 svec_reduce_add(v0),
1131 svec_reduce_add(v1),
1132 svec_reduce_add(v2),
1133 svec_reduce_add(v3),
1134 svec_reduce_add(v4),
1135 svec_reduce_add(v5),
1136 svec_reduce_add(v6),
1161 CMP_OP(
bool, not_equal, !=);
1338 svec_insert(m_self, m_index, value);
1340 FORCEINLINE void svec<LANES,bool>::Helper::operator=(svec<LANES,bool>::Helper helper) {
1341 svec_insert(m_self, m_index, helper.operator uint32_t());
1343 FORCEINLINE svec<LANES,bool>::Helper::operator uint32_t()
const {
1344 return svec_extract(*m_self, m_index);
1346 const FORCEINLINE uint32_t svec<LANES,bool>::operator[](
int index)
const {
1347 return svec_extract(*
this, index);
1379 FORCEINLINE bool svec<LANES,bool>::none_true() {
return svec_none_true(*
this); }
1385 FORCEINLINE svec<LANES,bool> svec<LANES,bool>::operator~() {
return svec_not(*
this); }
1392 FORCEINLINE svec<LANES,bool> svec<LANES,bool>::operator|(svec<LANES,bool> a) {
return svec_or(*
this, a); }
1398 FORCEINLINE svec<LANES,bool> svec<LANES,bool>::operator&(svec<LANES,bool> a) {
return svec_and(*
this, a); }
1404 FORCEINLINE svec<LANES,bool> svec<LANES,bool>::operator^(svec<LANES,bool> a) {
return svec_xor(*
this, a); }
1409 FORCEINLINE svec<LANES,bool> svec<LANES,bool>::operator!() {
return svec_not(*
this); }
1416 FORCEINLINE svec<LANES,bool> svec<LANES,bool>::operator&&(svec<LANES,bool> a) {
return svec_and(*
this, a); }
1422 FORCEINLINE svec<LANES,bool> svec<LANES,bool>::operator||(svec<LANES,bool> a) {
return svec_or(*
this, a); }
1428 FORCEINLINE svec<LANES,bool> svec<LANES,bool>::operator ==(svec<LANES,bool> a) {
1429 return svec_equal(*
this, a);
1437 FORCEINLINE svec<LANES,bool> svec<LANES,bool>::operator !=(svec<LANES,bool> a) {
1438 return svec_not_equal(*
this, a);
#define COUT_FUNC_BOOL_DECL()
Definition: gsimd_utility.h:266
svec(float a, float b, float c, float d, float e, float f, float g, float h)
Constructor.
Definition: generic8.h:515
svec(int32_t a)
Constructor.
Definition: generic8.h:368
svec(void *p0, void *p1, void *p2, void *p3, void *p4, void *p5, void *p6, void *p7)
Constructor.
Definition: generic8.h:729
#define VEC_INT_CLASS_METHOD_DECL(STYPE, USTYPE)
macros method definition for integer vector only Note: shift's operator can only be unsigned vector ...
Definition: gsimd_utility.h:379
svec(int8_t a)
Constructor.
Definition: generic8.h:210
#define SCATTER_BASE_OFFSETS(STYPE, OSTYPE)
Definition: gsimd_utility.h:765
#define CAST(SFROM, STO)
Definition: gsimd_utility.h:1112
svec()
Default constructor.
Definition: generic8.h:196
#define BINARY_OP_METHODS(STYPE)
Definition: generic8.h:1029
svec(int16_t a)
Constructor.
Definition: generic8.h:288
svec(uint16_t a, uint16_t b, uint16_t c, uint16_t d, uint16_t e, uint16_t f, uint16_t g, uint16_t h)
Constructor.
Definition: generic8.h:318
svec(uint64_t a, uint64_t b, uint64_t c, uint64_t d, uint64_t e, uint64_t f, uint64_t g, uint64_t h)
Constructor.
Definition: generic8.h:476
#define LOAD_CONST(STYPE)
Definition: gsimd_utility.h:562
svec(uint8_t a)
Constructor.
Definition: generic8.h:249
#define VEC_FLOAT_CLASS_METHOD_DECL(STYPE)
Definition: gsimd_utility.h:393
#define VEC_CLASS_METHOD_DECL(STYPE)
macros for non-mask i8 - double types's method
Definition: gsimd_utility.h:350
svec(int8_t a, int8_t b, int8_t c, int8_t d, int8_t e, int8_t f, int8_t g, int8_t h)
Constructor.
Definition: generic8.h:201
#define BINARY_OP_FUNC(STYPE, NAME, FUNC)
Definition: gsimd_utility.h:869
svec< 4, bool > svec_select(svec< 4, bool > mask, svec< 4, bool > a, svec< 4, bool > b)
construct c by selecting elements from two input vectors according to the mask
Definition: power_vsx4.h:1126
#define ROTATE(STYPE)
macro for rotate method implementation
Definition: gsimd_utility.h:496
#define TERNERY(STYPE)
Definition: gsimd_utility.h:958
#define SVEC_BOOL_CLASS_METHOD_DECL()
macros for svec<N,bool> class's class method
Definition: gsimd_utility.h:330
svec(int16_t a, int16_t b, int16_t c, int16_t d, int16_t e, int16_t f, int16_t g, int16_t h)
Constructor.
Definition: generic8.h:278
#define BROADCAST(STYPE)
macro for broadcast method implementation All broadcast are slow implementation
Definition: gsimd_utility.h:472
#define COUT_FUNC_DECL(STYPE)
Definition: gsimd_utility.h:283
#define LANES
Definition: generic8.h:108
svec()
Default constructor.
Definition: generic8.h:393
#define SUBSCRIPT_FUNC_IMPL(STYPE)
Definition: gsimd_utility.h:1160
#define VEC_CMP_IMPL(STYPE)
Definition: gsimd_utility.h:1175
svec()
Default constructor.
Definition: generic8.h:510
#define GATHER_GENERAL(STYPE, PSTYPE)
slow implementation of gather general Must use template to specify the return type ...
Definition: gsimd_utility.h:602
#define INT_BINARY_OP_METHODS(STYPE)
Definition: generic8.h:1043
#define SUBSCRIPT_FUNC_DECL(STYPE)
macros to define a intrinsic based subscript opertor
Definition: gsimd_utility.h:247
svec(int64_t a, int64_t b, int64_t c, int64_t d, int64_t e, int64_t f, int64_t g, int64_t h)
Constructor.
Definition: generic8.h:437
svec(uint64_t a)
Constructor.
Definition: generic8.h:486
#define MASKED_LOAD_STORE_L8(STYPE)
Definition: gsimd_utility.h:805
svec< 4,float > svec_preduce_add(svec< 4, float > v0, svec< 4, float > v1, svec< 4, float > v2, svec< 4, float > v3)
Definition: generic4.h:1106
#define MVEC_CLASS_METHOD_IMPL(STYPE)
mask class's class method impl
Definition: gsimd_utility.h:1285
svec(int a, int b, int c, int d, int e, int f, int g, int h)
Constructor.
Definition: generic8.h:358
#define SUBSCRIPT_FUNC_BOOL_DECL(STYPE)
Definition: gsimd_utility.h:251
#define VEC_CLASS_METHOD_IMPL(STYPE)
Definition: gsimd_utility.h:1301
svec()
Default constructor.
Definition: generic8.h:549
#define VEC_FLOAT_CLASS_METHOD_IMPL(STYPE)
Definition: gsimd_utility.h:1433
#define INSERT_EXTRACT(STYPE)
macros for svec's insert extract method implementation The implementation is based on vector type's s...
Definition: gsimd_utility.h:409
svec(double a, double b, double c, double d, double e, double f, double g, double h)
Constructor.
Definition: generic8.h:554
#define LOAD_STORE(STYPE)
Definition: gsimd_utility.h:419
#define CAST_BITS(SFROM, FROM_F, STO, TO_F)
Definition: gsimd_utility.h:1143
svec()
Default constructor.
Definition: generic8.h:157
#define GATHER_STRIDE(STYPE, OSTYPE)
macros for general impl of gather base step
Definition: gsimd_utility.h:666
#define SCATTER_STRIDE(STYPE, OSTYPE)
Definition: gsimd_utility.h:705
#define SCATTER_GENERAL(STYPE, PSTYPE)
Definition: gsimd_utility.h:736
svec(uint32_t a)
Constructor.
Definition: generic8.h:408
svec()
Default constructor.
Definition: generic8.h:273
#define GATHER_BASE_OFFSETS(STYPE, OSTYPE)
Definition: gsimd_utility.h:647
uint32_t v
Definition: generic8.h:151
svec()
Default constructor.
Definition: generic8.h:471
svec()
Default constructor.
Definition: generic8.h:353
#define UNARY_OP(STYPE, NAME, OP)
Definition: gsimd_utility.h:833
svec(uint32_t a)
Constructor.
Definition: generic8.h:175
#define SELECT(STYPE)
macros for svec's select by mask vector method generic implementation
Definition: gsimd_utility.h:448
svec(uint8_t a, uint8_t b, uint8_t c, uint8_t d, uint8_t e, uint8_t f, uint8_t g, uint8_t h)
Constructor.
Definition: generic8.h:239
#define CMP_ALL_OP(STYPE)
Definition: gsimd_utility.h:1107
#define BINARY_OP2(STYPE, STYPE2, NAME, OP)
Definition: gsimd_utility.h:861
#define COUT_FUNC_CHAR_DECL(STYPE)
Definition: gsimd_utility.h:275
svec()
Default constructor,.
Definition: generic8.h:432
#define CMP_OP(STYPE, NAME, OP)
macros for binary: vector op scalar
Definition: gsimd_utility.h:1049
svec(float a)
Constructor.
Definition: generic8.h:525
svec()
Default constructor.
Definition: generic8.h:234
#define MAX_MIN_REDUCE_METHODS(STYPE)
Definition: generic8.h:1109
#define SHUFFLES(STYPE)
macro for shuffle/shuffle2 methods implementation
Definition: gsimd_utility.h:521
svec(uint16_t a)
Constructor.
Definition: generic8.h:328
#define SELECT_BOOLCOND(STYPE)
macros for svec's select by bool scalar method implementation
Definition: gsimd_utility.h:459
svec(uint32_t a, uint32_t b, uint32_t c, uint32_t d, uint32_t e, uint32_t f, uint32_t g, uint32_t h)
Constructor.
Definition: generic8.h:398
svec(int64_t a)
Constructor.
Definition: generic8.h:447
#define VEC_INT_CLASS_METHOD_IMPL(STYPE, STYPE2)
Definition: gsimd_utility.h:1394
#define FORCEINLINE
Definition: gsimd_utility.h:175
uint32_t v
Definition: generic4.h:151
svec(uint32_t a, uint32_t b, uint32_t c, uint32_t d, uint32_t e, uint32_t f, uint32_t g, uint32_t h)
Constructor.
Definition: generic8.h:164
svec(double a)
Constructor.
Definition: generic8.h:564
svec()
Default constructor.
Definition: generic8.h:313