Generic SIMD Intrinsic Library API  0.6
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
generic4.h
Go to the documentation of this file.
1 
101 #ifndef GENERIC4_H_
102 #define GENERIC4_H_
103 
104 #include "gsimd_utility.h"
105 
106 namespace generic {
107 
108 #define LANES 4
109 //
111 // Constructor Section
112 //
114 
115 template <>
116 struct svec<LANES,bool>;
117 template <>
118  struct svec<LANES,int8_t>;
119 template <>
120  struct svec<LANES,uint8_t>;
121 template <>
122  struct svec<LANES,int16_t>;
123 template <>
124  struct svec<LANES,uint16_t>;
125 template <>
126  struct svec<LANES,int32_t>;
127 template <>
128  struct svec<LANES,uint32_t>;
129 template <>
130  struct svec<LANES,int64_t>;
131 template <>
132  struct svec<LANES,uint64_t>;
133 template <>
134  struct svec<LANES,float>;
135 template <>
136  struct svec<LANES,double>;
137 template <>
138  struct svec<LANES,void*>;
139 
148 template<>
149 struct svec<LANES,bool> {
150 
151  uint32_t v; //only use 4 bits
152 
157  FORCEINLINE svec() { v = 0;}
164  FORCEINLINE svec(uint32_t a, uint32_t b, uint32_t c, uint32_t d) {
165  v = ((a ? 1 : 0) |(b ? 2 : 0)|(c ? 4 : 0)|(d ? 8 : 0));
166  }
173  FORCEINLINE svec( uint32_t a){
174  v = a ? 15 : 0;
175  }
176 
180 };
181 
182 
186 template <>
187 struct svec<LANES,int8_t> {
188  int8_t v[LANES];
189 
199  FORCEINLINE svec(int8_t a, int8_t b, int8_t c, int8_t d) {
200  v[0] = a; v[1] = b; v[2] = c; v[3] = d;
201  }
206  FORCEINLINE svec( int8_t a) {
207  v[0] = v[1] = v[2] = v[3] = a;
208  }
213  SUBSCRIPT_FUNC_DECL(int8_t);
215 
216  VEC_CLASS_METHOD_DECL(int8_t);
217  VEC_INT_CLASS_METHOD_DECL(int8_t, uint8_t);
218 };
219 
224 template<>
225 struct svec<LANES,uint8_t> {
226  uint8_t v[LANES];
236  FORCEINLINE svec(uint8_t a, uint8_t b, uint8_t c, uint8_t d) {
237  v[0] = a; v[1] = b; v[2] = c; v[3] = d;
238  }
244  FORCEINLINE svec(uint8_t a){
245  v[0] = v[1] = v[2] = v[3] = a;
246  }
251  SUBSCRIPT_FUNC_DECL(uint8_t);
253 
254  VEC_CLASS_METHOD_DECL(uint8_t);
255  VEC_INT_CLASS_METHOD_DECL(uint8_t, uint8_t);
256 };
257 
261 template <>
262 struct svec<LANES,int16_t> {
263  int16_t v[LANES];
273  FORCEINLINE svec(int16_t a, int16_t b, int16_t c, int16_t d) {
274  v[0] = a; v[1] = b; v[2] = c; v[3] = d;
275  }
281  FORCEINLINE svec( int16_t a) {
282  v[0] = v[1] = v[2] = v[3] = a;
283  }
288  SUBSCRIPT_FUNC_DECL(int16_t);
289  COUT_FUNC_DECL(int16_t);
290 
291  VEC_CLASS_METHOD_DECL(int16_t);
292  VEC_INT_CLASS_METHOD_DECL(int16_t, uint16_t);
293 
294 };
295 
299 template <>
300 struct svec<LANES,uint16_t> {
301  uint16_t v[LANES];
311  FORCEINLINE svec(uint16_t a, uint16_t b, uint16_t c, uint16_t d) {
312  v[0] = a; v[1] = b; v[2] = c; v[3] = d;
313  }
319  FORCEINLINE svec( uint16_t a) {
320  v[0] = v[1] = v[2] = v[3] = a;
321  }
326  SUBSCRIPT_FUNC_DECL(uint16_t);
327  COUT_FUNC_DECL(uint16_t);
328 
329  VEC_CLASS_METHOD_DECL(uint16_t);
330  VEC_INT_CLASS_METHOD_DECL(uint16_t, uint16_t);
331 
332 };
333 
337 template <>
338 struct svec<LANES,int32_t> {
339  int32_t v[LANES];
349  FORCEINLINE svec(int a, int b, int c, int d) {
350  v[0] = a; v[1] = b; v[2] = c; v[3] = d;
351  }
357  FORCEINLINE svec(int32_t a) {
358  v[0] = v[1] = v[2] = v[3] = a;
359  }
364  SUBSCRIPT_FUNC_DECL(int32_t);
365  COUT_FUNC_DECL(int32_t);
366 
367  VEC_CLASS_METHOD_DECL(int32_t);
368  VEC_INT_CLASS_METHOD_DECL(int32_t, uint32_t);
369 
370 };
371 
375 template <>
376 struct svec<LANES,uint32_t> {
377  uint32_t v[LANES];
387  FORCEINLINE svec(uint32_t a, uint32_t b, uint32_t c, uint32_t d) {
388  v[0] = a; v[1] = b; v[2] = c; v[3] = d;
389  }
395  FORCEINLINE svec( uint32_t a) {
396  v[0] = v[1] = v[2] = v[3] = a;
397  }
402  SUBSCRIPT_FUNC_DECL(uint32_t);
403  COUT_FUNC_DECL(uint32_t);
404 
405  VEC_CLASS_METHOD_DECL(uint32_t);
406  VEC_INT_CLASS_METHOD_DECL(uint32_t, uint32_t);
407 };
408 
412 template <>
413 struct svec<LANES,int64_t> {
414  int64_t v[LANES];
424  FORCEINLINE svec(int64_t a, int64_t b, int64_t c, int64_t d) {
425  v[0] = a; v[1] = b; v[2] = c; v[3] = d;
426  }
432  FORCEINLINE svec( int64_t a) {
433  v[0] = v[1] = v[2] = v[3] = a;
434  }
439  SUBSCRIPT_FUNC_DECL(int64_t);
440  COUT_FUNC_DECL(int64_t);
441 
442  VEC_CLASS_METHOD_DECL(int64_t);
443  VEC_INT_CLASS_METHOD_DECL(int64_t, uint64_t);
444 };
445 
449 template <>
450 struct svec<LANES,uint64_t> {
451  uint64_t v[LANES];
461  FORCEINLINE svec(uint64_t a, uint64_t b, uint64_t c, uint64_t d) {
462  v[0] = a; v[1] = b; v[2] = c; v[3] = d;
463  }
469  FORCEINLINE svec( uint64_t a) {
470  v[0] = v[1] = v[2] = v[3] = a;
471  }
476  SUBSCRIPT_FUNC_DECL(uint64_t);
477  COUT_FUNC_DECL(uint64_t);
478 
479  VEC_CLASS_METHOD_DECL(uint64_t);
480  VEC_INT_CLASS_METHOD_DECL(uint64_t, uint64_t);
481 };
482 
486 template<>
487 struct svec<LANES,float> {
488  float v[LANES];
498  FORCEINLINE svec(float a, float b, float c, float d) {
499  v[0] = a; v[1] = b; v[2] = c; v[3] = d;
500  }
506  FORCEINLINE svec( float a) {
507  v[0] = v[1] = v[2] = v[3] = a;
508  }
513  SUBSCRIPT_FUNC_DECL(float);
515 
516  VEC_CLASS_METHOD_DECL(float);
518 };
519 
523 template<>
524 struct svec<LANES,double> {
525  double v[LANES];
535  FORCEINLINE svec(double a, double b, double c, double d) {
536  v[0] = a; v[1] = b; v[2] = c; v[3] = d;
537  }
543  FORCEINLINE svec( double a) {
544  v[0] = v[1] = v[2] = v[3] = a;
545  }
550  SUBSCRIPT_FUNC_DECL(double);
551  COUT_FUNC_DECL(double);
552 
553  VEC_CLASS_METHOD_DECL(double);
555 };
556 
557 
559 //
560 // Data operation interfaces
561 //
563 
564 //
566 //
567 //i1 use different approach
568 static FORCEINLINE uint32_t svec_extract(svec<LANES,bool> v, int index) {
569  return (v.v & (1 << index)) ? -1 : 0;
570 }
571 static FORCEINLINE void svec_insert(svec<LANES,bool> *v, int index, uint32_t val) {
572  if(!val) {
573  v->v &= ~(1 << index);
574  } else {
575  v->v |= (1 << index);
576  }
577 }
578 INSERT_EXTRACT(int8_t);
579 INSERT_EXTRACT(uint8_t);
580 INSERT_EXTRACT(int16_t);
581 INSERT_EXTRACT(uint16_t);
582 INSERT_EXTRACT(int32_t);
583 INSERT_EXTRACT(uint32_t);
584 INSERT_EXTRACT(int64_t);
585 INSERT_EXTRACT(uint64_t);
586 INSERT_EXTRACT(float);
587 INSERT_EXTRACT(double);
588 
589 // 1. Load / Store
590 LOAD_STORE(bool);
591 LOAD_STORE(int8_t);
592 LOAD_STORE(uint8_t);
593 LOAD_STORE(int16_t);
594 LOAD_STORE(uint16_t);
595 LOAD_STORE(int32_t);
596 LOAD_STORE(uint32_t);
597 LOAD_STORE(int64_t);
598 LOAD_STORE(uint64_t);
599 LOAD_STORE(float);
600 LOAD_STORE(double);
601 
602 // 3. Select
603 static FORCEINLINE svec<LANES,bool> svec_select(svec<LANES,bool> mask, svec<LANES,bool> a, svec<LANES,bool> b) {
604  svec<LANES,bool> ret;
605  ret.v = (a.v & mask.v) | (b.v & ~mask.v);
606  return ret;
607 }
608 SELECT(int8_t);
609 SELECT(uint8_t);
610 SELECT(int16_t);
611 SELECT(uint16_t);
612 SELECT(int32_t);
613 SELECT(uint32_t);
614 SELECT(int64_t);
615 SELECT(uint64_t);
616 SELECT(float);
617 SELECT(double);
618 
623 SELECT_BOOLCOND(uint16_t);
625 SELECT_BOOLCOND(uint32_t);
627 SELECT_BOOLCOND(uint64_t);
630 
631 // 4. broadcast/rotate/shuffle/smear/setzero
632 BROADCAST(int8_t);
633 BROADCAST(uint8_t);
634 BROADCAST(int16_t);
635 BROADCAST(uint16_t);
636 BROADCAST(int32_t);
637 BROADCAST(uint32_t);
638 BROADCAST(int64_t);
639 BROADCAST(uint64_t);
640 BROADCAST(float);
641 BROADCAST(double);
642 
643 ROTATE(int8_t);
644 ROTATE(uint8_t);
645 ROTATE(int16_t);
646 ROTATE(uint16_t);
647 ROTATE(int32_t);
648 ROTATE(uint32_t);
649 ROTATE(int64_t);
650 ROTATE(uint64_t);
651 ROTATE(float);
652 ROTATE(double);
653 
654 SHUFFLES(int8_t);
655 SHUFFLES(uint8_t);
656 SHUFFLES(int16_t);
657 SHUFFLES(uint16_t);
658 SHUFFLES(int32_t);
659 SHUFFLES(uint32_t);
660 SHUFFLES(int64_t);
661 SHUFFLES(uint64_t);
662 SHUFFLES(float);
663 SHUFFLES(double);
664 
665 //load const
666 LOAD_CONST(int8_t);
667 LOAD_CONST(uint8_t);
668 LOAD_CONST(int16_t);
669 LOAD_CONST(uint16_t);
670 LOAD_CONST(int32_t);
671 LOAD_CONST(uint32_t);
672 LOAD_CONST(int64_t);
673 LOAD_CONST(uint64_t);
674 LOAD_CONST(float);
675 LOAD_CONST(double);
676 
677 
678 // 5. Gather / Scatter
691 #if defined(__x86_64__) || defined(__PPC64__)
692 template<>
693 struct svec<LANES,void*> : public svec<LANES,uint64_t>{
698  FORCEINLINE svec(void* p0, void* p1, void* p2, void* p3):
699  svec<LANES,uint64_t>((uint64_t)(p0),(uint64_t)(p1),(uint64_t)(p2),(uint64_t)(p3)){}
700 };
701 #else // 32-bit
702 template<>
703  struct svec<LANES,void*>: public svec<LANES,uint32_t>{
708  FORCEINLINE svec(void* p0, void* p1, void* p2, void* p3):
709  svec<LANES,uint32_t>((uint32_t)(p0),(uint32_t)(p1),(uint32_t)(p2),(uint32_t)(p3)){}
710 };
711 #endif // __PPC64__
712 
713 #ifndef DOXYGEN_SHOULD_SKIP_THIS //not want generate svec_gather*/svec_scatter methods
714 
715 template <class RetVecType> static RetVecType svec_gather(svec<LANES, uint32_t> ptrs, svec<LANES,bool> mask);
716 template <class RetVecType> static RetVecType svec_gather(svec<LANES, uint64_t> ptrs, svec<LANES,bool> mask);
717 
718 GATHER_GENERAL(int8_t, uint32_t);
719 GATHER_GENERAL(int8_t, uint64_t);
720 GATHER_GENERAL(uint8_t, uint32_t);
721 GATHER_GENERAL(uint8_t, uint64_t);
722 GATHER_GENERAL(int16_t, uint32_t);
723 GATHER_GENERAL(int16_t, uint64_t);
724 GATHER_GENERAL(uint16_t, uint32_t);
725 GATHER_GENERAL(uint16_t, uint64_t);
726 GATHER_GENERAL(int32_t, uint32_t);
727 GATHER_GENERAL(int32_t, uint64_t);
728 GATHER_GENERAL(uint32_t, uint32_t);
729 GATHER_GENERAL(uint32_t, uint64_t);
730 GATHER_GENERAL(int64_t, uint32_t);
731 GATHER_GENERAL(int64_t, uint64_t);
732 GATHER_GENERAL(uint64_t, uint32_t);
733 GATHER_GENERAL(uint64_t, uint64_t);
734 GATHER_GENERAL(float, uint32_t);
735 GATHER_GENERAL(float, uint64_t);
736 GATHER_GENERAL(double, uint32_t);
737 GATHER_GENERAL(double, uint64_t);
738 
739 GATHER_BASE_OFFSETS(int8_t, int32_t);
740 GATHER_BASE_OFFSETS(int8_t, int64_t);
741 GATHER_BASE_OFFSETS(uint8_t, int32_t);
742 GATHER_BASE_OFFSETS(uint8_t, int64_t);
743 GATHER_BASE_OFFSETS(int16_t, int32_t);
744 GATHER_BASE_OFFSETS(int16_t, int64_t);
745 GATHER_BASE_OFFSETS(uint16_t, int32_t);
746 GATHER_BASE_OFFSETS(uint16_t, int64_t);
747 GATHER_BASE_OFFSETS(int32_t, int32_t);
748 GATHER_BASE_OFFSETS(int32_t, int64_t);
749 GATHER_BASE_OFFSETS(uint32_t, int32_t);
750 GATHER_BASE_OFFSETS(uint32_t, int64_t);
751 GATHER_BASE_OFFSETS(int64_t, int32_t);
752 GATHER_BASE_OFFSETS(int64_t, int64_t);
753 GATHER_BASE_OFFSETS(uint64_t, int32_t);
754 GATHER_BASE_OFFSETS(uint64_t, int64_t);
755 GATHER_BASE_OFFSETS(float, int32_t);
756 GATHER_BASE_OFFSETS(float, int64_t);
757 GATHER_BASE_OFFSETS(double, int32_t);
758 GATHER_BASE_OFFSETS(double, int64_t);
759 
760 GATHER_STRIDE(int8_t, int32_t);
761 GATHER_STRIDE(int8_t, int64_t);
762 GATHER_STRIDE(uint8_t, int32_t);
763 GATHER_STRIDE(uint8_t, int64_t);
764 GATHER_STRIDE(int16_t, int32_t);
765 GATHER_STRIDE(int16_t, int64_t);
766 GATHER_STRIDE(uint16_t, int32_t);
767 GATHER_STRIDE(uint16_t, int64_t);
768 GATHER_STRIDE(int32_t, int32_t);
769 GATHER_STRIDE(int32_t, int64_t);
770 GATHER_STRIDE(uint32_t, int32_t);
771 GATHER_STRIDE(uint32_t, int64_t);
772 GATHER_STRIDE(int64_t, int32_t);
773 GATHER_STRIDE(int64_t, int64_t);
774 GATHER_STRIDE(uint64_t, int32_t);
775 GATHER_STRIDE(uint64_t, int64_t);
776 GATHER_STRIDE(float, int32_t);
777 GATHER_STRIDE(float, int64_t);
778 GATHER_STRIDE(double, int32_t);
779 GATHER_STRIDE(double, int64_t);
780 
781 
782 SCATTER_GENERAL(int8_t, uint32_t);
783 SCATTER_GENERAL(int8_t, uint64_t);
784 SCATTER_GENERAL(uint8_t, uint32_t);
785 SCATTER_GENERAL(uint8_t, uint64_t);
786 SCATTER_GENERAL(int16_t, uint32_t);
787 SCATTER_GENERAL(int16_t, uint64_t);
788 SCATTER_GENERAL(uint16_t, uint32_t);
789 SCATTER_GENERAL(uint16_t, uint64_t);
790 SCATTER_GENERAL(int32_t, uint32_t);
791 SCATTER_GENERAL(int32_t, uint64_t);
792 SCATTER_GENERAL(uint32_t, uint32_t);
793 SCATTER_GENERAL(uint32_t, uint64_t);
794 SCATTER_GENERAL(int64_t, uint32_t);
795 SCATTER_GENERAL(int64_t, uint64_t);
796 SCATTER_GENERAL(uint64_t, uint32_t);
797 SCATTER_GENERAL(uint64_t, uint64_t);
798 SCATTER_GENERAL(float, uint32_t);
799 SCATTER_GENERAL(float, uint64_t);
800 SCATTER_GENERAL(double, uint32_t);
801 SCATTER_GENERAL(double, uint64_t);
802 
803 SCATTER_BASE_OFFSETS(int8_t, int32_t);
804 SCATTER_BASE_OFFSETS(int8_t, int64_t);
805 SCATTER_BASE_OFFSETS(uint8_t, int32_t);
806 SCATTER_BASE_OFFSETS(uint8_t, int64_t);
807 SCATTER_BASE_OFFSETS(int16_t, int32_t);
808 SCATTER_BASE_OFFSETS(int16_t, int64_t);
809 SCATTER_BASE_OFFSETS(uint16_t, int32_t);
810 SCATTER_BASE_OFFSETS(uint16_t, int64_t);
811 SCATTER_BASE_OFFSETS(int32_t, int32_t);
812 SCATTER_BASE_OFFSETS(int32_t, int64_t);
813 SCATTER_BASE_OFFSETS(uint32_t, int32_t);
814 SCATTER_BASE_OFFSETS(uint32_t, int64_t);
815 SCATTER_BASE_OFFSETS(int64_t, int32_t);
816 SCATTER_BASE_OFFSETS(int64_t, int64_t);
817 SCATTER_BASE_OFFSETS(uint64_t, int32_t);
818 SCATTER_BASE_OFFSETS(uint64_t, int64_t);
819 SCATTER_BASE_OFFSETS(float, int32_t);
820 SCATTER_BASE_OFFSETS(float, int64_t);
821 SCATTER_BASE_OFFSETS(double, int32_t);
822 SCATTER_BASE_OFFSETS(double, int64_t);
823 
824 SCATTER_STRIDE(int8_t, int32_t);
825 SCATTER_STRIDE(int8_t, int64_t);
826 SCATTER_STRIDE(uint8_t, int32_t);
827 SCATTER_STRIDE(uint8_t, int64_t);
828 SCATTER_STRIDE(int16_t, int32_t);
829 SCATTER_STRIDE(int16_t, int64_t);
830 SCATTER_STRIDE(uint16_t, int32_t);
831 SCATTER_STRIDE(uint16_t, int64_t);
832 SCATTER_STRIDE(int32_t, int32_t);
833 SCATTER_STRIDE(int32_t, int64_t);
834 SCATTER_STRIDE(uint32_t, int32_t);
835 SCATTER_STRIDE(uint32_t, int64_t);
836 SCATTER_STRIDE(int64_t, int32_t);
837 SCATTER_STRIDE(int64_t, int64_t);
838 SCATTER_STRIDE(uint64_t, int32_t);
839 SCATTER_STRIDE(uint64_t, int64_t);
840 SCATTER_STRIDE(float, int32_t);
841 SCATTER_STRIDE(float, int64_t);
842 SCATTER_STRIDE(double, int32_t);
843 SCATTER_STRIDE(double, int64_t);
844 
845 #endif //DOXYGEN_SHOULD_SKIP_THIS
846 
847 
848 // 5. masked load/masked store
849 
850 //Masked load/store is implemented based on gather_base_offsets/scatter_base_offsets
851 //Here we only use offsets with 32bit
852 
853 MASKED_LOAD_STORE_L4(int8_t);
854 MASKED_LOAD_STORE_L4(uint8_t);
855 MASKED_LOAD_STORE_L4(int16_t);
856 MASKED_LOAD_STORE_L4(uint16_t);
857 MASKED_LOAD_STORE_L4(int32_t);
858 MASKED_LOAD_STORE_L4(uint32_t);
859 MASKED_LOAD_STORE_L4(int64_t);
860 MASKED_LOAD_STORE_L4(uint64_t);
861 MASKED_LOAD_STORE_L4(float);
862 MASKED_LOAD_STORE_L4(double);
863 
865 //
866 // Mask type (i1) interfaces
867 //
869 
870 // 1. mask construction
876 static FORCEINLINE bool svec_any_true(const svec<LANES,bool>& mask) {
877  return (mask.v != 0);
878 }
879 
885 static FORCEINLINE bool svec_all_true(const svec<LANES,bool>& mask) {
886  return (mask.v & 0xF) == 0xF;
887 }
888 
889 
895 static FORCEINLINE bool svec_none_true(const svec<LANES,bool>& mask) {
896  return (mask.v == 0);
897 }
898 
899 // 2. bit operations
900 
904 static FORCEINLINE svec<LANES,bool> svec_and(svec<LANES,bool> a, svec<LANES,bool> b) {
905  svec<LANES,bool> ret;
906  ret.v = a.v & b.v;
907  return ret;
908 }
909 
910 
914 static FORCEINLINE svec<LANES,bool> svec_or(svec<LANES,bool> a, svec<LANES,bool> b) {
915  svec<LANES,bool> ret;
916  ret.v = a.v | b.v;
917  return ret;
918 }
919 
923 static FORCEINLINE svec<LANES,bool> svec_xor(svec<LANES,bool> a, svec<LANES,bool> b) {
924  svec<LANES,bool> ret;
925  ret.v = a.v ^ b.v;
926  return ret;
927 }
928 
932 static FORCEINLINE svec<LANES,bool> svec_not(svec<LANES,bool> a) {
933  svec<LANES,bool> ret;
934  ret.v = ~a.v;
935  return ret;
936 }
937 
944 static FORCEINLINE uint64_t svec_movmsk(svec<LANES,bool> mask) {
945  return (uint64_t)(mask.v);
946 }
947 
948 
950 //
951 // General data operation interfaces
952 //
954 // 1. Unary
955 
956 // neg operation
957 UNARY_OP(int8_t, svec_neg, -);
958 UNARY_OP(uint8_t, svec_neg, -);
959 UNARY_OP(int16_t, svec_neg, -);
960 UNARY_OP(uint16_t, svec_neg, -);
961 UNARY_OP(int32_t, svec_neg, -);
962 UNARY_OP(uint32_t, svec_neg, -);
963 UNARY_OP(int64_t, svec_neg, -);
964 UNARY_OP(uint64_t, svec_neg, -);
965 UNARY_OP(float, svec_neg, -);
966 UNARY_OP(double, svec_neg, -);
967 
968 // 2. Math unary
969 //round
970 UNARY_OP(float, svec_round, roundf);
971 UNARY_OP(double, svec_round, round);
972 //floor
973 UNARY_OP(float, svec_floor, floorf);
974 UNARY_OP(double, svec_floor, floor);
975 //ceil
976 UNARY_OP(float, svec_ceil, ceilf);
977 UNARY_OP(double, svec_ceil, ceil);
978 //reverse 1/
979 UNARY_OP(float, svec_rcp, 1.0/);
980 UNARY_OP(double, svec_rcp, 1.0/);
981 //reverse sqrt
982 UNARY_OP(float, svec_rsqrt, 1.0/sqrtf);
983 UNARY_OP(double, svec_rsqrt, 1.0/sqrt);
984 //sqrt
985 UNARY_OP(float, svec_sqrt, sqrtf);
986 UNARY_OP(double, svec_sqrt, sqrt);
987 //exp
988 UNARY_OP(float, svec_exp, expf);
989 UNARY_OP(double, svec_exp, exp);
990 //log
991 UNARY_OP(float, svec_log, logf);
992 UNARY_OP(double, svec_log, log);
993 //abs - for all types
994 UNARY_OP(int8_t, svec_abs, abs<int8_t>);
995 static FORCEINLINE svec<LANES,uint8_t> svec_abs(svec<LANES,uint8_t> v) { return v;}
996 UNARY_OP(int16_t, svec_abs, abs<int16_t>);
997 static FORCEINLINE svec<LANES,uint16_t> svec_abs(svec<LANES,uint16_t> v) { return v;}
998 UNARY_OP(int32_t, svec_abs, abs<int32_t>);
999 static FORCEINLINE svec<LANES,uint32_t> svec_abs(svec<LANES,uint32_t> v) { return v;}
1000 UNARY_OP(int64_t, svec_abs, abs<int64_t>);
1001 static FORCEINLINE svec<LANES,uint64_t> svec_abs(svec<LANES,uint64_t> v) { return v;}
1002 UNARY_OP(float, svec_abs, abs);
1003 UNARY_OP(double, svec_abs, abs);
1004 
1005 // 3. Binary
1006 
1007 //add, sub, div, mul.
1008 #define BINARY_OP_METHODS(STYPE) \
1009 BINARY_OP(STYPE, svec_add, +); \
1010 BINARY_OP(STYPE, svec_sub, -); \
1011 BINARY_OP(STYPE, svec_mul, *); \
1012 BINARY_OP(STYPE, svec_div, /); \
1013 BINARY_OP_SCALAR(STYPE, svec_add_scalar, +); \
1014 BINARY_SCALAR_OP(STYPE, svec_scalar_add, +); \
1015 BINARY_OP_SCALAR(STYPE, svec_sub_scalar, -); \
1016 BINARY_SCALAR_OP(STYPE, svec_scalar_sub, -); \
1017 BINARY_OP_SCALAR(STYPE, svec_mul_scalar, *); \
1018 BINARY_SCALAR_OP(STYPE, svec_scalar_mul, *); \
1019 BINARY_OP_SCALAR(STYPE, svec_div_scalar, /); \
1020 BINARY_SCALAR_OP(STYPE, svec_scalar_div, /); \
1021 
1022 #define INT_BINARY_OP_METHODS(STYPE) \
1023 BINARY_OP(STYPE, svec_or, |); \
1024 BINARY_OP(STYPE, svec_and, &); \
1025 BINARY_OP(STYPE, svec_xor, ^); \
1026 BINARY_SHT_SCALAR(STYPE, int32_t, svec_shl, <<); \
1027 BINARY_SHT_SCALAR(STYPE, int32_t, svec_shr, >>); \
1028 BINARY_OP(STYPE, svec_rem, %); \
1029 BINARY_OP_SCALAR(STYPE, svec_rem, %);
1030 
1031 BINARY_OP_METHODS(int8_t);
1032 BINARY_OP_METHODS(uint8_t);
1033 BINARY_OP_METHODS(int16_t);
1034 BINARY_OP_METHODS(uint16_t);
1035 BINARY_OP_METHODS(int32_t);
1036 BINARY_OP_METHODS(uint32_t);
1037 BINARY_OP_METHODS(int64_t);
1038 BINARY_OP_METHODS(uint64_t);
1039 BINARY_OP_METHODS(float);
1040 BINARY_OP_METHODS(double);
1041 
1042 INT_BINARY_OP_METHODS(int8_t);
1043 INT_BINARY_OP_METHODS(uint8_t);
1044 INT_BINARY_OP_METHODS(int16_t);
1045 INT_BINARY_OP_METHODS(uint16_t);
1046 INT_BINARY_OP_METHODS(int32_t);
1047 INT_BINARY_OP_METHODS(uint32_t);
1048 INT_BINARY_OP_METHODS(int64_t);
1049 INT_BINARY_OP_METHODS(uint64_t);
1050 
1051 
1052 //power only for float
1053 BINARY_OP_FUNC(float, svec_pow, powf);
1054 BINARY_OP_FUNC(double, svec_pow, pow);
1055 
1056 //shift left
1057 BINARY_OP2(int8_t, uint8_t, svec_shl, <<);
1058 BINARY_OP2(uint8_t, uint8_t, svec_shl, <<);
1059 BINARY_OP2(int16_t, uint16_t, svec_shl, <<);
1060 BINARY_OP2(uint16_t, uint16_t, svec_shl, <<);
1061 BINARY_OP2(int32_t, uint32_t, svec_shl, <<);
1062 BINARY_OP2(uint32_t, uint32_t, svec_shl, <<);
1063 BINARY_OP2(int64_t, uint64_t, svec_shl, <<);
1064 BINARY_OP2(uint64_t, uint64_t, svec_shl, <<);
1065 
1066 //shift right
1067 BINARY_OP2(int8_t, uint8_t, svec_shr, >>);
1068 BINARY_OP2(uint8_t, uint8_t, svec_shr, >>);
1069 BINARY_OP2(int16_t, uint16_t, svec_shr, >>);
1070 BINARY_OP2(uint16_t, uint16_t, svec_shr, >>);
1071 BINARY_OP2(int32_t, uint32_t, svec_shr, >>);
1072 BINARY_OP2(uint32_t, uint32_t, svec_shr, >>);
1073 BINARY_OP2(int64_t, uint64_t, svec_shr, >>);
1074 BINARY_OP2(uint64_t, uint64_t, svec_shr, >>);
1075 
1076 // 4. Ternary
1077 
1078 //madd / msub for only int32/u32/float/double
1079 TERNERY(int32_t);
1080 TERNERY(uint32_t);
1081 TERNERY(int64_t);
1082 TERNERY(uint64_t);
1083 TERNERY(float);
1084 TERNERY(double);
1085 
1086 
1087 // 5. Max/Min & 6. Reduce
1088 #define MAX_MIN_REDUCE_METHODS(STYPE) \
1089 BINARY_OP_FUNC(STYPE, svec_max, max<STYPE>); \
1090 BINARY_OP_FUNC(STYPE, svec_min, min<STYPE>); \
1091 BINARY_OP_REDUCE_FUNC(STYPE, svec_reduce_add, add<STYPE>); \
1092 BINARY_OP_REDUCE_FUNC(STYPE, svec_reduce_max, max<STYPE>); \
1093 BINARY_OP_REDUCE_FUNC(STYPE, svec_reduce_min, min<STYPE>); \
1094 
1095 MAX_MIN_REDUCE_METHODS(int8_t);
1096 MAX_MIN_REDUCE_METHODS(uint8_t);
1097 MAX_MIN_REDUCE_METHODS(int16_t);
1098 MAX_MIN_REDUCE_METHODS(uint16_t);
1099 MAX_MIN_REDUCE_METHODS(int32_t);
1100 MAX_MIN_REDUCE_METHODS(uint32_t);
1101 MAX_MIN_REDUCE_METHODS(int64_t);
1102 MAX_MIN_REDUCE_METHODS(uint64_t);
1103 MAX_MIN_REDUCE_METHODS(float);
1104 MAX_MIN_REDUCE_METHODS(double);
1105 
1107  return svec<LANES,float>(
1108  svec_reduce_add(v0),
1109  svec_reduce_add(v1),
1110  svec_reduce_add(v2),
1111  svec_reduce_add(v3)
1112  );
1113 }
1114 
1116  return svec<LANES,double>(
1117  svec_reduce_add(v0),
1118  svec_reduce_add(v1),
1119  svec_reduce_add(v2),
1120  svec_reduce_add(v3)
1121  );
1122 }
1123 
1124 
1125 // 7. Compare
1126 CMP_ALL_OP(int8_t);
1127 CMP_ALL_OP(uint8_t);
1128 CMP_ALL_OP(int16_t);
1129 CMP_ALL_OP(uint16_t);
1130 CMP_ALL_OP(int32_t);
1131 CMP_ALL_OP(uint32_t);
1132 CMP_ALL_OP(int64_t);
1133 CMP_ALL_OP(uint64_t);
1134 CMP_ALL_OP(float);
1135 CMP_ALL_OP(double);
1136 
1143 CMP_OP(bool, equal, ==);
1144 CMP_OP(bool, not_equal, !=);
1145 
1146 // 8. Cast
1147 
1153 //i1 -> all
1154 //CAST(bool, uint32_t);
1155 CAST(bool, int8_t); //better way: packing
1156 CAST(bool, uint8_t); //better way: packing
1157 CAST(bool, int16_t); //better way: packing
1158 CAST(bool, uint16_t); //better way: packing
1159 CAST(bool, int32_t);
1160 CAST(bool, uint32_t);
1161 CAST(bool, int64_t); //better way: unpack, singed ext
1162 CAST(bool, uint64_t);//better way: unpack, singed ext
1163 CAST(bool, float); //si to fp call
1164 CAST(bool, double);
1165 
1166 //i8 -> all
1167 CAST(int8_t, bool);
1168 //CAST(int8_t, int8_t);
1169 CAST(int8_t, uint8_t);
1170 CAST(int8_t, int16_t); //better way, use vec_unpackh
1171 CAST(int8_t, uint16_t); //better way, sext + zero mask and
1172 CAST(int8_t, int32_t); //better way, use twice vec_unpack
1173 CAST(int8_t, uint32_t); //better way, use unpack + zero mask
1174 CAST(int8_t, int64_t);
1175 CAST(int8_t, uint64_t);
1176 CAST(int8_t, float);
1177 CAST(int8_t, double);
1178 
1179 //u8 -> all
1180 CAST(uint8_t, bool);
1181 CAST(uint8_t, int8_t);
1182 //CAST(uint8_t, uint8_t);
1183 CAST(uint8_t, int16_t); //better way, use unpack + zero mask
1184 CAST(uint8_t, uint16_t); //better way use unpack + zero mask
1185 CAST(uint8_t, int32_t);
1186 CAST(uint8_t, uint32_t);
1187 CAST(uint8_t, int64_t);
1188 CAST(uint8_t, uint64_t);
1189 CAST(uint8_t, float);
1190 CAST(uint8_t, double);
1191 
1192 //i16 -> all
1193 CAST(int16_t, bool);
1194 CAST(int16_t, int8_t); //could use pack
1195 CAST(int16_t, uint8_t); //could use pack
1196 //CAST(int16_t, int16_t);
1197 CAST(int16_t, uint16_t);
1198 CAST(int16_t, int32_t); //use unpack
1199 CAST(int16_t, uint32_t); //use unpack and zeromaskout
1200 CAST(int16_t, int64_t);
1201 CAST(int16_t, uint64_t);
1202 CAST(int16_t, float);
1203 CAST(int16_t, double);
1204 
1205 //u16 -> all
1206 CAST(uint16_t, bool);
1207 CAST(uint16_t, int8_t);
1208 CAST(uint16_t, uint8_t);
1209 CAST(uint16_t, int16_t);
1210 //CAST(uint16_t, uint16_t);
1211 CAST(uint16_t, int32_t); //use unpack +mask
1212 CAST(uint16_t, uint32_t); //use unpack + mask
1213 CAST(uint16_t, int64_t);
1214 CAST(uint16_t, uint64_t);
1215 CAST(uint16_t, float);
1216 CAST(uint16_t, double);
1217 
1218 //i32 -> all
1219 CAST(int32_t, bool);
1220 CAST(int32_t, int8_t);
1221 CAST(int32_t, uint8_t);
1222 CAST(int32_t, int16_t);
1223 CAST(int32_t, uint16_t);
1224 //CAST(int32_t, int32_t);
1225 CAST(int32_t, uint32_t);
1226 CAST(int32_t, int64_t); //use p8 unpack
1227 CAST(int32_t, uint64_t); //use p8 unpack
1228 CAST(int32_t, float); //use ctf
1229 CAST(int32_t, double);
1230 
1231 //u32 -> all
1232 CAST(uint32_t, bool);
1233 CAST(uint32_t, int8_t);
1234 CAST(uint32_t, uint8_t);
1235 CAST(uint32_t, int16_t);
1236 CAST(uint32_t, uint16_t);
1237 CAST(uint32_t, int32_t);
1238 //CAST(uint32_t, uint32_t);
1239 CAST(uint32_t, int64_t); //use p8 unpack
1240 CAST(uint32_t, uint64_t); //use p8 unpack
1241 CAST(uint32_t, float);
1242 CAST(uint32_t, double);
1243 
1244 //i64-> all
1245 CAST(int64_t, bool);
1246 CAST(int64_t, int8_t);
1247 CAST(int64_t, uint8_t);
1248 CAST(int64_t, int16_t);
1249 CAST(int64_t, uint16_t);
1250 CAST(int64_t, int32_t); //use p8 trunk
1251 CAST(int64_t, uint32_t); //use p8 trunk
1252 //CAST(int64_t, int64_t);
1253 CAST(int64_t, uint64_t);
1254 CAST(int64_t, float);
1255 CAST(int64_t, double);
1256 
1257 //u64 -> all
1258 CAST(uint64_t, bool);
1259 CAST(uint64_t, int8_t);
1260 CAST(uint64_t, uint8_t);
1261 CAST(uint64_t, int16_t);
1262 CAST(uint64_t, uint16_t);
1263 CAST(uint64_t, int32_t); //use p8 pack
1264 CAST(uint64_t, uint32_t); //use p8 pack
1265 CAST(uint64_t, int64_t);
1266 //CAST(uint64_t, uint64_t);
1267 CAST(uint64_t, float);
1268 CAST(uint64_t, double);
1269 
1270 //float -> all
1271 CAST(float, bool);
1272 CAST(float, int8_t); //use cts + pack+pack
1273 CAST(float, uint8_t); //use ctu + pack + pack
1274 CAST(float, int16_t); //use cts + pack
1275 CAST(float, uint16_t); //use ctu + pack
1276 CAST(float, int32_t);//use cts
1277 CAST(float, uint32_t); //use ctu
1278 CAST(float, int64_t);
1279 CAST(float, uint64_t);
1280 //CAST(float, float);
1281 CAST(float, double);
1282 
1283 //double -> all
1284 CAST(double, bool);
1285 CAST(double, int8_t);
1286 CAST(double, uint8_t);
1287 CAST(double, int16_t);
1288 CAST(double, uint16_t);
1289 CAST(double, int32_t);
1290 CAST(double, uint32_t);
1291 CAST(double, int64_t);
1292 CAST(double, uint64_t);
1293 CAST(double, float);
1294 //CAST(double, double);
1295 
1297 
1298 
1302 CAST_BITS(int32_t, i32, float, f);
1303 CAST_BITS(uint32_t, u32, float, f);
1304 CAST_BITS(float, f, int32_t, i32);
1305 CAST_BITS(float, f, uint32_t, u32);
1306 
1307 CAST_BITS(int64_t, i64, double, d);
1308 CAST_BITS(uint64_t, u64, double, d);
1309 CAST_BITS(double, d, int64_t, i64);
1310 CAST_BITS(double, d, uint64_t, u64);
1311 
1312 
1314 //
1315 // Class operations based on the above interfaces
1316 //
1318 
1319 //add the impl of i1's
1320 FORCEINLINE void svec<LANES,bool>::Helper::operator=(uint32_t value) {
1321  svec_insert(m_self, m_index, value);
1322 }
1323 FORCEINLINE void svec<LANES,bool>::Helper::operator=(svec<LANES,bool>::Helper helper) {
1324  svec_insert(m_self, m_index, helper.operator uint32_t());
1325 }
1326 FORCEINLINE svec<LANES,bool>::Helper::operator uint32_t() const {
1327  return svec_extract(*m_self, m_index);
1328 }
1329 const FORCEINLINE uint32_t svec<LANES,bool>::operator[](int index) const {
1330  return svec_extract(*this, index);
1331 }
1342 
1348 FORCEINLINE bool svec<LANES,bool>::any_true() { return svec_any_true(*this); }
1349 
1355 FORCEINLINE bool svec<LANES,bool>::all_true() { return svec_all_true(*this); }
1356 
1362 FORCEINLINE bool svec<LANES,bool>::none_true() { return svec_none_true(*this); }
1363 
1368 FORCEINLINE svec<LANES,bool> svec<LANES,bool>::operator~() { return svec_not(*this); }
1369 
1375 FORCEINLINE svec<LANES,bool> svec<LANES,bool>::operator|(svec<LANES,bool> a) { return svec_or(*this, a); }
1381 FORCEINLINE svec<LANES,bool> svec<LANES,bool>::operator&(svec<LANES,bool> a) { return svec_and(*this, a); }
1387 FORCEINLINE svec<LANES,bool> svec<LANES,bool>::operator^(svec<LANES,bool> a) { return svec_xor(*this, a); }
1392 FORCEINLINE svec<LANES,bool> svec<LANES,bool>::operator!() { return svec_not(*this); }
1393 
1399 FORCEINLINE svec<LANES,bool> svec<LANES,bool>::operator&&(svec<LANES,bool> a) { return svec_and(*this, a); }
1405 FORCEINLINE svec<LANES,bool> svec<LANES,bool>::operator||(svec<LANES,bool> a) { return svec_or(*this, a); }
1411 FORCEINLINE svec<LANES,bool> svec<LANES,bool>::operator ==(svec<LANES,bool> a) {
1412  return svec_equal(*this, a);
1413 }
1414 
1420 FORCEINLINE svec<LANES,bool> svec<LANES,bool>::operator !=(svec<LANES,bool> a) {
1421  return svec_not_equal(*this, a);
1422 }
1423 
1425 VEC_CMP_IMPL(uint8_t);
1426 VEC_CMP_IMPL(int16_t);
1427 VEC_CMP_IMPL(uint16_t);
1428 VEC_CMP_IMPL(int32_t);
1429 VEC_CMP_IMPL(uint32_t);
1430 VEC_CMP_IMPL(int64_t);
1431 VEC_CMP_IMPL(uint64_t);
1434 
1446 
1447 VEC_INT_CLASS_METHOD_IMPL(int8_t, uint8_t);
1448 VEC_INT_CLASS_METHOD_IMPL(uint8_t, uint8_t);
1449 VEC_INT_CLASS_METHOD_IMPL(int16_t, uint16_t);
1450 VEC_INT_CLASS_METHOD_IMPL(uint16_t, uint16_t);
1451 VEC_INT_CLASS_METHOD_IMPL(int32_t, uint32_t);
1452 VEC_INT_CLASS_METHOD_IMPL(uint32_t, uint32_t);
1453 VEC_INT_CLASS_METHOD_IMPL(int64_t, uint64_t);
1454 VEC_INT_CLASS_METHOD_IMPL(uint64_t, uint64_t);
1455 
1458 
1459 #undef LANES
1460 } //end of namespace generic
1461 #endif /* POWER_VSX4_H_ */
1462 
#define COUT_FUNC_BOOL_DECL()
Definition: gsimd_utility.h:266
svec(double a)
Constructor.
Definition: generic4.h:543
svec(int8_t a)
Constructor.
Definition: generic4.h:206
#define MAX_MIN_REDUCE_METHODS(STYPE)
Definition: generic4.h:1088
#define VEC_INT_CLASS_METHOD_DECL(STYPE, USTYPE)
macros method definition for integer vector only Note: shift&#39;s operator can only be unsigned vector ...
Definition: gsimd_utility.h:379
svec(uint8_t a, uint8_t b, uint8_t c, uint8_t d)
Constructor.
Definition: generic4.h:236
svec(void *p0, void *p1, void *p2, void *p3)
Constructor.
Definition: generic4.h:708
svec(uint32_t a, uint32_t b, uint32_t c, uint32_t d)
Constructor.
Definition: generic4.h:164
#define SCATTER_BASE_OFFSETS(STYPE, OSTYPE)
Definition: gsimd_utility.h:765
svec(int64_t a, int64_t b, int64_t c, int64_t d)
Constructor.
Definition: generic4.h:424
#define CAST(SFROM, STO)
Definition: gsimd_utility.h:1112
svec(int32_t a)
Constructor.
Definition: generic4.h:357
svec(uint8_t a)
Constructor.
Definition: generic4.h:244
svec(int64_t a)
Constructor.
Definition: generic4.h:432
#define LOAD_CONST(STYPE)
Definition: gsimd_utility.h:562
#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&#39;s method
Definition: gsimd_utility.h:350
#define INT_BINARY_OP_METHODS(STYPE)
Definition: generic4.h:1022
svec(float a)
Constructor.
Definition: generic4.h:506
#define BINARY_OP_FUNC(STYPE, NAME, FUNC)
Definition: gsimd_utility.h:869
svec()
Default constructor.
Definition: generic4.h:231
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
svec()
Default constructor.
Definition: generic4.h:382
#define SVEC_BOOL_CLASS_METHOD_DECL()
macros for svec&lt;N,bool&gt; class&#39;s class method
Definition: gsimd_utility.h:330
svec()
Default constructor.
Definition: generic4.h:268
svec(double a, double b, double c, double d)
Constructor.
Definition: generic4.h:535
svec(uint32_t a)
Constructor.
Definition: generic4.h:395
#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 BINARY_OP_METHODS(STYPE)
Definition: generic4.h:1008
svec(float a, float b, float c, float d)
Constructor.
Definition: generic4.h:498
svec()
Default constructor,.
Definition: generic4.h:419
svec(uint64_t a, uint64_t b, uint64_t c, uint64_t d)
Constructor.
Definition: generic4.h:461
#define SUBSCRIPT_FUNC_IMPL(STYPE)
Definition: gsimd_utility.h:1160
#define VEC_CMP_IMPL(STYPE)
Definition: gsimd_utility.h:1175
#define GATHER_GENERAL(STYPE, PSTYPE)
slow implementation of gather general Must use template to specify the return type ...
Definition: gsimd_utility.h:602
svec(uint16_t a)
Constructor.
Definition: generic4.h:319
#define SUBSCRIPT_FUNC_DECL(STYPE)
macros to define a intrinsic based subscript opertor
Definition: gsimd_utility.h:247
Definition: generic.h:57
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&#39;s class method impl
Definition: gsimd_utility.h:1285
#define SUBSCRIPT_FUNC_BOOL_DECL(STYPE)
Definition: gsimd_utility.h:251
#define VEC_CLASS_METHOD_IMPL(STYPE)
Definition: gsimd_utility.h:1301
#define MASKED_LOAD_STORE_L4(STYPE)
Definition: gsimd_utility.h:797
#define VEC_FLOAT_CLASS_METHOD_IMPL(STYPE)
Definition: gsimd_utility.h:1433
#define LANES
Definition: generic4.h:108
svec(int a, int b, int c, int d)
Constructor.
Definition: generic4.h:349
#define INSERT_EXTRACT(STYPE)
macros for svec&#39;s insert extract method implementation The implementation is based on vector type&#39;s s...
Definition: gsimd_utility.h:409
svec()
Default constructor.
Definition: generic4.h:456
#define LOAD_STORE(STYPE)
Definition: gsimd_utility.h:419
svec()
Default constructor.
Definition: generic4.h:530
#define CAST_BITS(SFROM, FROM_F, STO, TO_F)
Definition: gsimd_utility.h:1143
#define GATHER_STRIDE(STYPE, OSTYPE)
macros for general impl of gather base step
Definition: gsimd_utility.h:666
svec()
Default constructor.
Definition: generic4.h:306
svec(int8_t a, int8_t b, int8_t c, int8_t d)
Constructor.
Definition: generic4.h:199
#define SCATTER_STRIDE(STYPE, OSTYPE)
Definition: gsimd_utility.h:705
#define SCATTER_GENERAL(STYPE, PSTYPE)
Definition: gsimd_utility.h:736
#define GATHER_BASE_OFFSETS(STYPE, OSTYPE)
Definition: gsimd_utility.h:647
svec(uint32_t a, uint32_t b, uint32_t c, uint32_t d)
Constructor.
Definition: generic4.h:387
#define UNARY_OP(STYPE, NAME, OP)
Definition: gsimd_utility.h:833
#define SELECT(STYPE)
macros for svec&#39;s select by mask vector method generic implementation
Definition: gsimd_utility.h:448
#define CMP_ALL_OP(STYPE)
Definition: gsimd_utility.h:1107
#define BINARY_OP2(STYPE, STYPE2, NAME, OP)
Definition: gsimd_utility.h:861
svec(int16_t a)
Constructor.
Definition: generic4.h:281
#define COUT_FUNC_CHAR_DECL(STYPE)
Definition: gsimd_utility.h:275
#define CMP_OP(STYPE, NAME, OP)
macros for binary: vector op scalar
Definition: gsimd_utility.h:1049
svec(uint64_t a)
Constructor.
Definition: generic4.h:469
svec()
Default constructor.
Definition: generic4.h:344
#define SHUFFLES(STYPE)
macro for shuffle/shuffle2 methods implementation
Definition: gsimd_utility.h:521
svec()
Default constructor.
Definition: generic4.h:157
#define SELECT_BOOLCOND(STYPE)
macros for svec&#39;s select by bool scalar method implementation
Definition: gsimd_utility.h:459
#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(int16_t a, int16_t b, int16_t c, int16_t d)
Constructor.
Definition: generic4.h:273
svec()
Default constructor.
Definition: generic4.h:194
svec()
Default constructor.
Definition: generic4.h:493
svec(uint32_t a)
Constructor.
Definition: generic4.h:173
svec(uint16_t a, uint16_t b, uint16_t c, uint16_t d)
Constructor.
Definition: generic4.h:311