32 #ifndef MCKL_RANDOM_INTERNAL_INCREMENT_SSE2_64_F_HPP 33 #define MCKL_RANDOM_INTERNAL_INCREMENT_SSE2_64_F_HPP 46 static constexpr std::size_t K_ = 1;
49 static void eval(
const std::array<T, K_> &ctr, std::array<__m128i, 16> &s)
51 __m128i c = _mm_set1_epi64x(static_cast<MCKL_INT64>(std::get<0>(ctr)));
53 std::get<0x0>(s) = _mm_add_epi64(c, _mm_set_epi64x(0x02, 0x01));
54 std::get<0x1>(s) = _mm_add_epi64(c, _mm_set_epi64x(0x04, 0x03));
55 std::get<0x2>(s) = _mm_add_epi64(c, _mm_set_epi64x(0x06, 0x05));
56 std::get<0x3>(s) = _mm_add_epi64(c, _mm_set_epi64x(0x08, 0x07));
57 std::get<0x4>(s) = _mm_add_epi64(c, _mm_set_epi64x(0x0A, 0x09));
58 std::get<0x5>(s) = _mm_add_epi64(c, _mm_set_epi64x(0x0C, 0x0B));
59 std::get<0x6>(s) = _mm_add_epi64(c, _mm_set_epi64x(0x0E, 0x0D));
60 std::get<0x7>(s) = _mm_add_epi64(c, _mm_set_epi64x(0x10, 0x0F));
61 std::get<0x8>(s) = _mm_add_epi64(c, _mm_set_epi64x(0x12, 0x11));
62 std::get<0x9>(s) = _mm_add_epi64(c, _mm_set_epi64x(0x14, 0x13));
63 std::get<0xA>(s) = _mm_add_epi64(c, _mm_set_epi64x(0x16, 0x15));
64 std::get<0xB>(s) = _mm_add_epi64(c, _mm_set_epi64x(0x18, 0x17));
65 std::get<0xC>(s) = _mm_add_epi64(c, _mm_set_epi64x(0x1A, 0x19));
66 std::get<0xD>(s) = _mm_add_epi64(c, _mm_set_epi64x(0x1C, 0x1B));
67 std::get<0xE>(s) = _mm_add_epi64(c, _mm_set_epi64x(0x1E, 0x1D));
68 std::get<0xF>(s) = _mm_add_epi64(c, _mm_set_epi64x(0x20, 0x1F));
75 static constexpr std::size_t K_ = 2;
78 static void eval(
const std::array<T, K_> &ctr, std::array<__m128i, 16> &s)
80 __m128i c = _mm_set_epi64x(static_cast<MCKL_INT64>(std::get<1>(ctr)),
81 static_cast<MCKL_INT64>(std::get<0>(ctr)));
83 std::get<0x0>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 0x01));
84 std::get<0x1>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 0x02));
85 std::get<0x2>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 0x03));
86 std::get<0x3>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 0x04));
87 std::get<0x4>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 0x05));
88 std::get<0x5>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 0x06));
89 std::get<0x6>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 0x07));
90 std::get<0x7>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 0x08));
91 std::get<0x8>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 0x09));
92 std::get<0x9>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 0x0A));
93 std::get<0xA>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 0x0B));
94 std::get<0xB>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 0x0C));
95 std::get<0xC>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 0x0D));
96 std::get<0xD>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 0x0E));
97 std::get<0xE>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 0x0F));
98 std::get<0xF>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 0x10));
102 template <
typename T>
105 static constexpr std::size_t K_ = 4;
108 static void eval(
const std::array<T, K_> &ctr, std::array<__m128i, 16> &s)
110 __m128i c = _mm_set_epi64x(static_cast<MCKL_INT64>(std::get<1>(ctr)),
111 static_cast<MCKL_INT64>(std::get<0>(ctr)));
113 std::get<0x0>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 1));
115 _mm_set_epi64x(static_cast<MCKL_INT64>(std::get<3>(ctr)),
116 static_cast<MCKL_INT64>(std::get<2>(ctr)));
117 std::get<0x2>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 2));
118 std::get<0x3>(s) = std::get<1>(s);
119 std::get<0x4>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 3));
120 std::get<0x5>(s) = std::get<1>(s);
121 std::get<0x6>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 4));
122 std::get<0x7>(s) = std::get<1>(s);
123 std::get<0x8>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 5));
124 std::get<0x9>(s) = std::get<1>(s);
125 std::get<0xA>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 6));
126 std::get<0xB>(s) = std::get<1>(s);
127 std::get<0xC>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 7));
128 std::get<0xD>(s) = std::get<1>(s);
129 std::get<0xE>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 8));
130 std::get<0xF>(s) = std::get<1>(s);
134 template <
typename T>
137 static constexpr std::size_t K_ = 8;
140 static void eval(
const std::array<T, K_> &ctr, std::array<__m128i, 16> &s)
142 __m128i c = _mm_set_epi64x(static_cast<MCKL_INT64>(std::get<1>(ctr)),
143 static_cast<MCKL_INT64>(std::get<0>(ctr)));
145 std::get<0x0>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 1));
147 _mm_set_epi64x(static_cast<MCKL_INT64>(std::get<3>(ctr)),
148 static_cast<MCKL_INT64>(std::get<2>(ctr)));
150 _mm_set_epi64x(static_cast<MCKL_INT64>(std::get<5>(ctr)),
153 _mm_set_epi64x(static_cast<MCKL_INT64>(std::get<7>(ctr)),
154 static_cast<MCKL_INT64>(std::get<6>(ctr)));
155 std::get<0x4>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 2));
156 std::get<0x5>(s) = std::get<1>(s);
157 std::get<0x6>(s) = std::get<2>(s);
158 std::get<0x7>(s) = std::get<3>(s);
159 std::get<0x8>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 3));
160 std::get<0x9>(s) = std::get<1>(s);
161 std::get<0xA>(s) = std::get<2>(s);
162 std::get<0xB>(s) = std::get<3>(s);
163 std::get<0xC>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 4));
164 std::get<0xD>(s) = std::get<1>(s);
165 std::get<0xE>(s) = std::get<2>(s);
166 std::get<0xF>(s) = std::get<3>(s);
170 template <
typename T>
173 static constexpr std::size_t K_ = 16;
176 static void eval(
const std::array<T, K_> &ctr, std::array<__m128i, 16> &s)
178 __m128i c = _mm_set_epi64x(static_cast<MCKL_INT64>(std::get<0x1>(ctr)),
179 static_cast<MCKL_INT64>(std::get<0x0>(ctr)));
181 std::get<0x0>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 1));
183 _mm_set_epi64x(static_cast<MCKL_INT64>(std::get<0x3>(ctr)),
184 static_cast<MCKL_INT64>(std::get<0x2>(ctr)));
186 _mm_set_epi64x(static_cast<MCKL_INT64>(std::get<0x5>(ctr)),
189 _mm_set_epi64x(static_cast<MCKL_INT64>(std::get<0x7>(ctr)),
190 static_cast<MCKL_INT64>(std::get<0x6>(ctr)));
192 _mm_set_epi64x(static_cast<MCKL_INT64>(std::get<0x9>(ctr)),
195 _mm_set_epi64x(static_cast<MCKL_INT64>(std::get<0xB>(ctr)),
196 static_cast<MCKL_INT64>(std::get<0xA>(ctr)));
198 _mm_set_epi64x(static_cast<MCKL_INT64>(std::get<0xD>(ctr)),
201 _mm_set_epi64x(static_cast<MCKL_INT64>(std::get<0xF>(ctr)),
202 static_cast<MCKL_INT64>(std::get<0xE>(ctr)));
203 std::get<0x8>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 2));
204 std::get<0x9>(s) = std::get<1>(s);
205 std::get<0xA>(s) = std::get<2>(s);
206 std::get<0xB>(s) = std::get<3>(s);
207 std::get<0xC>(s) = std::get<4>(s);
208 std::get<0xD>(s) = std::get<5>(s);
209 std::get<0xE>(s) = std::get<6>(s);
210 std::get<0xF>(s) = std::get<7>(s);
214 template <
typename T>
217 static constexpr std::size_t K_ = 64;
220 static void eval(
const std::array<T, K_> &ctr, std::array<__m128i, 16> &s)
222 std::memcpy(s.data(), ctr.data(), 256);
223 std::get<0>(s) = _mm_add_epi64(std::get<0>(s), _mm_set_epi64x(0, 1));
233 #endif // MCKL_RANDOM_INTERNAL_INCREMENT_SSE2_64_F_HPP #define MCKL_PUSH_GCC_WARNING(warning)
static void eval(const std::array< T, K_ > &ctr, std::array< __m128i, 16 > &s)
static void eval(const std::array< T, K_ > &ctr, std::array< __m128i, 16 > &s)
static void eval(const std::array< T, K_ > &ctr, std::array< __m128i, 16 > &s)
static void eval(const std::array< T, K_ > &ctr, std::array< __m128i, 16 > &s)
static void eval(const std::array< T, K_ > &ctr, std::array< __m128i, 16 > &s)
#define MCKL_POP_GCC_WARNING
static void eval(const std::array< T, K_ > &ctr, std::array< __m128i, 16 > &s)