15 #ifndef __IPSDKUTIL_INSTRUCTIONSET_ARITHMETIC_DETAIL_AVX2_POLYNOMPACK_H__ 16 #define __IPSDKUTIL_INSTRUCTIONSET_ARITHMETIC_DETAIL_AVX2_POLYNOMPACK_H__ 20 #include <IPSDKUtil/InstructionSet/Arithmetic/detail/PolynomReg.h> 23 #include <boost/mpl/not_equal_to.hpp> 32 #define DEFINE_POLYNOMPACK_AVX2(N) \ 33 template <typename T> \ 34 struct PolynomPack<eInstructionSet::eIS_Avx2, eInstructionSet::eIS_Avx2, N, T, typename boost::enable_if_c<boost::mpl::equal_to<boost::mpl::int_<sizeof(T)>, boost::mpl::int_<1> >::value>::type> \ 36 static IPSDK_FORCEINLINE \ 37 BasePack<ePackType::ePT_Avx, T> \ 38 act(const BasePack<ePackType::ePT_Avx, T>& in, \ 39 BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(N), const T& c)) \ 41 BasePack<ePackType::ePT_Scalar, T> out; \ 42 act(in, BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(N), c), out); \ 46 static IPSDK_FORCEINLINE \ 48 act(const BasePack<ePackType::ePT_Avx, T>& in, \ 49 BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(N), const T& c), \ 50 BasePack<ePackType::ePT_Avx, T>& out) \ 52 PolynomReg<eInstructionSet::eIS_Avx2, eInstructionSet::eIS_Avx2, N, T>::act(in._val[0], BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(N), c), out._val[0]); \ 56 template <typename T> \ 57 struct PolynomPack<eInstructionSet::eIS_Avx2, eInstructionSet::eIS_Fma3, N, T, typename boost::enable_if_c<boost::mpl::equal_to<boost::mpl::int_<sizeof(T)>, boost::mpl::int_<1> >::value>::type> \ 59 static IPSDK_FORCEINLINE \ 60 BasePack<ePackType::ePT_Avx, T> \ 61 act(const BasePack<ePackType::ePT_Avx, T>& in, \ 62 BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(N), const T& c)) \ 64 BasePack<ePackType::ePT_Scalar, T> out; \ 65 act(in, BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(N), c), out); \ 69 static IPSDK_FORCEINLINE \ 71 act(const BasePack<ePackType::ePT_Avx, T>& in, \ 72 BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(N), const T& c), \ 73 BasePack<ePackType::ePT_Avx, T>& out) \ 75 PolynomReg<eInstructionSet::eIS_Avx2, eInstructionSet::eIS_Fma3, N, T>::act(in._val[0], BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(N), c), out._val[0]); \ 79 template <typename T> \ 80 struct PolynomPack<eInstructionSet::eIS_Avx2, eInstructionSet::eIS_Avx2, N, T, typename boost::enable_if_c<boost::mpl::equal_to<boost::mpl::int_<sizeof(T)>, boost::mpl::int_<2> >::value>::type> \ 82 static IPSDK_FORCEINLINE \ 83 BasePack<ePackType::ePT_Avx, T> \ 84 act(const BasePack<ePackType::ePT_Avx, T>& in, \ 85 BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(N), const T& c)) \ 87 BasePack<ePackType::ePT_Scalar, T> out; \ 88 act(in, BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(N), c), out); \ 92 static IPSDK_FORCEINLINE \ 94 act(const BasePack<ePackType::ePT_Avx, T>& in, \ 95 BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(N), const T& c), \ 96 BasePack<ePackType::ePT_Avx, T>& out) \ 98 PolynomReg<eInstructionSet::eIS_Avx2, eInstructionSet::eIS_Avx2, N, T>::act(in._val[0], BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(N), c), out._val[0]); \ 99 PolynomReg<eInstructionSet::eIS_Avx2, eInstructionSet::eIS_Avx2, N, T>::act(in._val[1], BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(N), c), out._val[1]); \ 103 template <typename T> \ 104 struct PolynomPack<eInstructionSet::eIS_Avx2, eInstructionSet::eIS_Fma3, N, T, typename boost::enable_if_c<boost::mpl::equal_to<boost::mpl::int_<sizeof(T)>, boost::mpl::int_<2> >::value>::type> \ 106 static IPSDK_FORCEINLINE \ 107 BasePack<ePackType::ePT_Avx, T> \ 108 act(const BasePack<ePackType::ePT_Avx, T>& in, \ 109 BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(N), const T& c)) \ 111 BasePack<ePackType::ePT_Scalar, T> out; \ 112 act(in, BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(N), c), out); \ 116 static IPSDK_FORCEINLINE \ 118 act(const BasePack<ePackType::ePT_Avx, T>& in, \ 119 BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(N), const T& c), \ 120 BasePack<ePackType::ePT_Avx, T>& out) \ 122 PolynomReg<eInstructionSet::eIS_Avx2, eInstructionSet::eIS_Fma3, N, T>::act(in._val[0], BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(N), c), out._val[0]); \ 123 PolynomReg<eInstructionSet::eIS_Avx2, eInstructionSet::eIS_Fma3, N, T>::act(in._val[1], BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(N), c), out._val[1]); \ 127 template <typename T> \ 128 struct PolynomPack<eInstructionSet::eIS_Avx2, eInstructionSet::eIS_Avx2, N, T, typename boost::enable_if_c<boost::mpl::equal_to<boost::mpl::int_<sizeof(T)>, boost::mpl::int_<4> >::value>::type> \ 130 static IPSDK_FORCEINLINE \ 131 BasePack<ePackType::ePT_Avx, T> \ 132 act(const BasePack<ePackType::ePT_Avx, T>& in, \ 133 BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(N), const T& c)) \ 135 BasePack<ePackType::ePT_Scalar, T> out; \ 136 act(in, BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(N), c), out); \ 140 static IPSDK_FORCEINLINE \ 142 act(const BasePack<ePackType::ePT_Avx, T>& in, \ 143 BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(N), const T& c), \ 144 BasePack<ePackType::ePT_Avx, T>& out) \ 146 PolynomReg<eInstructionSet::eIS_Avx2, eInstructionSet::eIS_Avx2, N, T>::act(in._val[0], BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(N), c), out._val[0]); \ 147 PolynomReg<eInstructionSet::eIS_Avx2, eInstructionSet::eIS_Avx2, N, T>::act(in._val[1], BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(N), c), out._val[1]); \ 148 PolynomReg<eInstructionSet::eIS_Avx2, eInstructionSet::eIS_Avx2, N, T>::act(in._val[2], BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(N), c), out._val[2]); \ 149 PolynomReg<eInstructionSet::eIS_Avx2, eInstructionSet::eIS_Avx2, N, T>::act(in._val[3], BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(N), c), out._val[3]); \ 153 template <typename T> \ 154 struct PolynomPack<eInstructionSet::eIS_Avx2, eInstructionSet::eIS_Fma3, N, T, typename boost::enable_if_c<boost::mpl::equal_to<boost::mpl::int_<sizeof(T)>, boost::mpl::int_<4> >::value>::type> \ 156 static IPSDK_FORCEINLINE \ 157 BasePack<ePackType::ePT_Avx, T> \ 158 act(const BasePack<ePackType::ePT_Avx, T>& in, \ 159 BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(N), const T& c)) \ 161 BasePack<ePackType::ePT_Scalar, T> out; \ 162 act(in, BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(N), c), out); \ 166 static IPSDK_FORCEINLINE \ 168 act(const BasePack<ePackType::ePT_Avx, T>& in, \ 169 BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(N), const T& c), \ 170 BasePack<ePackType::ePT_Avx, T>& out) \ 172 PolynomReg<eInstructionSet::eIS_Avx2, eInstructionSet::eIS_Fma3, N, T>::act(in._val[0], BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(N), c), out._val[0]); \ 173 PolynomReg<eInstructionSet::eIS_Avx2, eInstructionSet::eIS_Fma3, N, T>::act(in._val[1], BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(N), c), out._val[1]); \ 174 PolynomReg<eInstructionSet::eIS_Avx2, eInstructionSet::eIS_Fma3, N, T>::act(in._val[2], BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(N), c), out._val[2]); \ 175 PolynomReg<eInstructionSet::eIS_Avx2, eInstructionSet::eIS_Fma3, N, T>::act(in._val[3], BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(N), c), out._val[3]); \ 179 DEFINE_POLYNOMPACK_AVX2(20)
180 DEFINE_POLYNOMPACK_AVX2(19)
181 DEFINE_POLYNOMPACK_AVX2(18)
182 DEFINE_POLYNOMPACK_AVX2(17)
183 DEFINE_POLYNOMPACK_AVX2(16)
184 DEFINE_POLYNOMPACK_AVX2(15)
185 DEFINE_POLYNOMPACK_AVX2(14)
186 DEFINE_POLYNOMPACK_AVX2(13)
187 DEFINE_POLYNOMPACK_AVX2(12)
188 DEFINE_POLYNOMPACK_AVX2(11)
189 DEFINE_POLYNOMPACK_AVX2(10)
190 DEFINE_POLYNOMPACK_AVX2(9)
191 DEFINE_POLYNOMPACK_AVX2(8)
192 DEFINE_POLYNOMPACK_AVX2(7)
193 DEFINE_POLYNOMPACK_AVX2(6)
194 DEFINE_POLYNOMPACK_AVX2(5)
195 DEFINE_POLYNOMPACK_AVX2(4)
196 DEFINE_POLYNOMPACK_AVX2(3)
197 DEFINE_POLYNOMPACK_AVX2(2)
198 DEFINE_POLYNOMPACK_AVX2(1)
207 #endif // __IPSDKUTIL_INSTRUCTIONSET_ARITHMETIC_DETAIL_AVX2_POLYNOMPACK_H__ Defines the IPSDK_FORCEINLINE.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
BasePack class; defines a set of scalars (for instruction set "standard") or registers (for all other...
Definition of import/export macro for library.