32 #ifndef MCKL_RANDOM_INTERNAL_INCREMENT_SSE2_64_8_HPP 33 #define MCKL_RANDOM_INTERNAL_INCREMENT_SSE2_64_8_HPP 46 static constexpr std::size_t K_ = 1;
49 static void eval(std::array<T, K_> &ctr, std::array<__m128i, 8> &s)
51 __m128i c = _mm_set1_epi64x(static_cast<MCKL_INT64>(std::get<0>(ctr)));
53 std::get<0>(s) = _mm_add_epi64(c, _mm_set_epi64x(0x02, 0x01));
54 std::get<1>(s) = _mm_add_epi64(c, _mm_set_epi64x(0x04, 0x03));
55 std::get<2>(s) = _mm_add_epi64(c, _mm_set_epi64x(0x06, 0x05));
56 std::get<3>(s) = _mm_add_epi64(c, _mm_set_epi64x(0x08, 0x07));
57 std::get<4>(s) = _mm_add_epi64(c, _mm_set_epi64x(0x0A, 0x09));
58 std::get<5>(s) = _mm_add_epi64(c, _mm_set_epi64x(0x0C, 0x0B));
59 std::get<6>(s) = _mm_add_epi64(c, _mm_set_epi64x(0x0E, 0x0D));
60 std::get<7>(s) = _mm_add_epi64(c, _mm_set_epi64x(0x10, 0x0F));
67 static constexpr std::size_t K_ = 2;
70 static void eval(std::array<T, K_> &ctr, std::array<__m128i, 8> &s)
72 __m128i c = _mm_set_epi64x(static_cast<MCKL_INT64>(std::get<1>(ctr)),
73 static_cast<MCKL_INT64>(std::get<0>(ctr)));
75 std::get<0>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 1));
76 std::get<1>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 2));
77 std::get<2>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 3));
78 std::get<3>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 4));
79 std::get<4>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 5));
80 std::get<5>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 6));
81 std::get<6>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 7));
82 std::get<7>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 8));
89 static constexpr std::size_t K_ = 4;
92 static void eval(std::array<T, K_> &ctr, std::array<__m128i, 8> &s)
94 __m128i c = _mm_set_epi64x(static_cast<MCKL_INT64>(std::get<1>(ctr)),
95 static_cast<MCKL_INT64>(std::get<0>(ctr)));
97 std::get<0>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 1));
99 _mm_set_epi64x(static_cast<MCKL_INT64>(std::get<3>(ctr)),
100 static_cast<MCKL_INT64>(std::get<2>(ctr)));
101 std::get<2>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 2));
102 std::get<3>(s) = std::get<1>(s);
103 std::get<4>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 3));
104 std::get<5>(s) = std::get<1>(s);
105 std::get<6>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 4));
106 std::get<7>(s) = std::get<1>(s);
110 template <
typename T>
113 static constexpr std::size_t K_ = 8;
116 static void eval(std::array<T, K_> &ctr, std::array<__m128i, 8> &s)
118 __m128i c = _mm_set_epi64x(static_cast<MCKL_INT64>(std::get<1>(ctr)),
119 static_cast<MCKL_INT64>(std::get<0>(ctr)));
121 std::get<0>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 1));
123 _mm_set_epi64x(static_cast<MCKL_INT64>(std::get<3>(ctr)),
124 static_cast<MCKL_INT64>(std::get<2>(ctr)));
126 _mm_set_epi64x(static_cast<MCKL_INT64>(std::get<5>(ctr)),
129 _mm_set_epi64x(static_cast<MCKL_INT64>(std::get<7>(ctr)),
130 static_cast<MCKL_INT64>(std::get<6>(ctr)));
131 std::get<4>(s) = _mm_add_epi64(c, _mm_set_epi64x(0, 2));
132 std::get<5>(s) = std::get<1>(s);
133 std::get<6>(s) = std::get<2>(s);
134 std::get<7>(s) = std::get<3>(s);
138 template <
typename T>
141 static constexpr std::size_t K_ = 16;
144 static void eval(
const std::array<T, K_> &ctr, std::array<__m128i, 8> &s)
146 std::memcpy(s.data(), ctr.data(), 128);
147 std::get<0>(s) = _mm_add_epi64(std::get<0>(s), _mm_set_epi64x(0, 1));
157 #endif // MCKL_RANDOM_INTERNAL_INCREMENT_SSE2_64_8_HPP static void eval(std::array< T, K_ > &ctr, std::array< __m128i, 8 > &s)
#define MCKL_PUSH_GCC_WARNING(warning)
static void eval(std::array< T, K_ > &ctr, std::array< __m128i, 8 > &s)
static void eval(std::array< T, K_ > &ctr, std::array< __m128i, 8 > &s)
static void eval(const std::array< T, K_ > &ctr, std::array< __m128i, 8 > &s)
static void eval(std::array< T, K_ > &ctr, std::array< __m128i, 8 > &s)
#define MCKL_POP_GCC_WARNING