Botan 3.14.1
Crypto and TLS for C&
simd_8x32.h
Go to the documentation of this file.
1/*
2* (C) 2018 Jack Lloyd
3*
4* Botan is released under the Simplified BSD License (see license.txt)
5*/
6
7#ifndef BOTAN_SIMD_8X32_H_
8#define BOTAN_SIMD_8X32_H_
9
10#include <botan/compiler.h>
11#include <botan/types.h>
12#include <botan/internal/isa_extn.h>
13#include <immintrin.h>
14
15namespace Botan {
16
17// NOLINTBEGIN(portability-simd-intrinsics)
18
19class SIMD_8x32 final {
20 public:
21 SIMD_8x32& operator=(const SIMD_8x32& other) = default;
22 SIMD_8x32(const SIMD_8x32& other) = default;
23
24 SIMD_8x32& operator=(SIMD_8x32&& other) = default;
25 SIMD_8x32(SIMD_8x32&& other) = default;
26
27 ~SIMD_8x32() = default;
28
29 BOTAN_FN_ISA_SIMD_8X32
30 BOTAN_FORCE_INLINE SIMD_8x32() noexcept : m_avx2(_mm256_setzero_si256()) {}
31
32 BOTAN_FN_ISA_SIMD_8X32
33 explicit SIMD_8x32(const uint32_t B[8]) noexcept {
34 // NOLINTNEXTLINE(*-prefer-member-initializer)
35 m_avx2 = _mm256_loadu_si256(reinterpret_cast<const __m256i*>(B));
36 }
37
38 BOTAN_FN_ISA_SIMD_8X32
39 explicit SIMD_8x32(uint32_t B0,
40 uint32_t B1,
41 uint32_t B2,
42 uint32_t B3,
43 uint32_t B4,
44 uint32_t B5,
45 uint32_t B6,
46 uint32_t B7) noexcept {
47 // NOLINTNEXTLINE(*-prefer-member-initializer)
48 m_avx2 = _mm256_set_epi32(B7, B6, B5, B4, B3, B2, B1, B0);
49 }
50
51 BOTAN_FN_ISA_SIMD_8X32
52 explicit SIMD_8x32(uint32_t B0, uint32_t B1, uint32_t B2, uint32_t B3) noexcept {
53 // NOLINTNEXTLINE(*-prefer-member-initializer)
54 m_avx2 = _mm256_set_epi32(B3, B2, B1, B0, B3, B2, B1, B0);
55 }
56
57 BOTAN_FN_ISA_SIMD_8X32
58 static SIMD_8x32 splat(uint32_t B) noexcept { return SIMD_8x32(_mm256_set1_epi32(B)); }
59
60 BOTAN_FN_ISA_SIMD_8X32
61 static SIMD_8x32 load_le(const uint8_t* in) noexcept {
62 return SIMD_8x32(_mm256_loadu_si256(reinterpret_cast<const __m256i*>(in)));
63 }
64
65 BOTAN_FN_ISA_SIMD_8X32
66 static SIMD_8x32 load_le(const uint32_t* in) noexcept {
67 return SIMD_8x32(_mm256_loadu_si256(reinterpret_cast<const __m256i*>(in)));
68 }
69
70 BOTAN_FN_ISA_SIMD_8X32
71 static SIMD_8x32 load_le128(const uint8_t* in) noexcept {
72 return SIMD_8x32(_mm256_broadcastsi128_si256(_mm_loadu_si128(reinterpret_cast<const __m128i*>(in))));
73 }
74
75 BOTAN_FN_ISA_SIMD_8X32
76 static SIMD_8x32 load_le128(const uint32_t* in) noexcept {
77 return SIMD_8x32(_mm256_broadcastsi128_si256(_mm_loadu_si128(reinterpret_cast<const __m128i*>(in))));
78 }
79
80 BOTAN_FN_ISA_SIMD_8X32
81 static SIMD_8x32 load_be(const uint8_t* in) noexcept { return load_le(in).bswap(); }
82
83 /**
84 * Load in big endian order from ptrs[i] + Stride * n + offset,
85 * gathering lane i's n'th block out of a set of per lane buffers
86 */
87 template <size_t Stride>
88 static BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32
89 load_be(const uint8_t* const* ptrs, size_t i, size_t n, size_t offset = 0) {
90 return load_be(ptrs[i] + Stride * n + offset);
91 }
92
93 BOTAN_FN_ISA_SIMD_8X32
94 void store_le(uint8_t out[]) const noexcept { _mm256_storeu_si256(reinterpret_cast<__m256i*>(out), m_avx2); }
95
96 BOTAN_FN_ISA_SIMD_8X32
97 void store_le(uint32_t out[]) const noexcept { _mm256_storeu_si256(reinterpret_cast<__m256i*>(out), m_avx2); }
98
99 BOTAN_FN_ISA_SIMD_8X32
100 void store_le128(uint8_t out[]) const noexcept {
101 _mm_storeu_si128(reinterpret_cast<__m128i*>(out), _mm256_extracti128_si256(raw(), 0));
102 }
103
104 BOTAN_FN_ISA_SIMD_8X32
105 static SIMD_8x32 load_le128(const uint32_t in1[], const uint32_t in2[]) noexcept {
106 return SIMD_8x32(
107 _mm256_loadu2_m128i(reinterpret_cast<const __m128i*>(in2), reinterpret_cast<const __m128i*>(in1)));
108 }
109
110 BOTAN_FN_ISA_SIMD_8X32
111 static SIMD_8x32 load_be128(const uint8_t in1[], const uint8_t in2[]) noexcept {
112 return SIMD_8x32(
113 _mm256_loadu2_m128i(reinterpret_cast<const __m128i*>(in2), reinterpret_cast<const __m128i*>(in1)))
114 .bswap();
115 }
116
117 BOTAN_FN_ISA_SIMD_8X32
118 void store_le128(uint32_t out1[], uint32_t out2[]) const noexcept {
119 _mm256_storeu2_m128i(reinterpret_cast<__m128i*>(out2), reinterpret_cast<__m128i*>(out1), raw());
120 }
121
122 BOTAN_FN_ISA_SIMD_8X32
123 void store_be(uint8_t out[]) const noexcept { bswap().store_le(out); }
124
125 template <size_t ROT>
126 BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32 rotl() const noexcept
127 requires(ROT > 0 && ROT < 32)
128 {
129#if defined(__AVX512VL__)
130 return SIMD_8x32(_mm256_rol_epi32(m_avx2, ROT));
131#else
132 if constexpr(ROT == 8) {
133 const __m256i shuf_rotl_8 =
134 _mm256_set_epi64x(0x0e0d0c0f'0a09080b, 0x06050407'02010003, 0x0e0d0c0f'0a09080b, 0x06050407'02010003);
135
136 return SIMD_8x32(_mm256_shuffle_epi8(m_avx2, shuf_rotl_8));
137 } else if constexpr(ROT == 16) {
138 const __m256i shuf_rotl_16 =
139 _mm256_set_epi64x(0x0d0c0f0e'09080b0a, 0x05040706'01000302, 0x0d0c0f0e'09080b0a, 0x05040706'01000302);
140
141 return SIMD_8x32(_mm256_shuffle_epi8(m_avx2, shuf_rotl_16));
142 } else if constexpr(ROT == 24) {
143 const __m256i shuf_rotl_24 =
144 _mm256_set_epi64x(0x0c0f0e0d'080b0a09, 0x04070605'00030201, 0x0c0f0e0d'080b0a09, 0x04070605'00030201);
145
146 return SIMD_8x32(_mm256_shuffle_epi8(m_avx2, shuf_rotl_24));
147 } else {
148 return SIMD_8x32(_mm256_xor_si256(_mm256_slli_epi32(m_avx2, static_cast<int>(ROT)),
149 _mm256_srli_epi32(m_avx2, static_cast<int>(32 - ROT))));
150 }
151#endif
152 }
153
154 template <size_t ROT>
155 BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32 rotr() const noexcept {
156 return this->rotl<32 - ROT>();
157 }
158
159 SIMD_8x32 BOTAN_FN_ISA_SIMD_8X32 sigma0() const noexcept {
160 const SIMD_8x32 r1 = this->rotr<2>();
161 const SIMD_8x32 r2 = this->rotr<13>();
162 const SIMD_8x32 r3 = this->rotr<22>();
163 return r1 ^ r2 ^ r3;
164 }
165
166 SIMD_8x32 BOTAN_FN_ISA_SIMD_8X32 sigma1() const noexcept {
167 const SIMD_8x32 r1 = this->rotr<6>();
168 const SIMD_8x32 r2 = this->rotr<11>();
169 const SIMD_8x32 r3 = this->rotr<25>();
170 return r1 ^ r2 ^ r3;
171 }
172
173 BOTAN_FN_ISA_SIMD_8X32
174 SIMD_8x32 operator+(const SIMD_8x32& other) const noexcept {
175 SIMD_8x32 retval(*this);
176 retval += other;
177 return retval;
178 }
179
180 BOTAN_FN_ISA_SIMD_8X32
181 SIMD_8x32 operator-(const SIMD_8x32& other) const noexcept {
182 SIMD_8x32 retval(*this);
183 retval -= other;
184 return retval;
185 }
186
187 BOTAN_FN_ISA_SIMD_8X32
188 SIMD_8x32 operator^(const SIMD_8x32& other) const noexcept {
189 SIMD_8x32 retval(*this);
190 retval ^= other;
191 return retval;
192 }
193
194 BOTAN_FN_ISA_SIMD_8X32
195 SIMD_8x32 operator|(const SIMD_8x32& other) const noexcept {
196 SIMD_8x32 retval(*this);
197 retval |= other;
198 return retval;
199 }
200
201 BOTAN_FN_ISA_SIMD_8X32
202 SIMD_8x32 operator&(const SIMD_8x32& other) const noexcept {
203 SIMD_8x32 retval(*this);
204 retval &= other;
205 return retval;
206 }
207
208 BOTAN_FN_ISA_SIMD_8X32
209 void operator+=(const SIMD_8x32& other) { m_avx2 = _mm256_add_epi32(m_avx2, other.m_avx2); }
210
211 BOTAN_FN_ISA_SIMD_8X32
212 void operator-=(const SIMD_8x32& other) { m_avx2 = _mm256_sub_epi32(m_avx2, other.m_avx2); }
213
214 BOTAN_FN_ISA_SIMD_8X32
215 void operator^=(const SIMD_8x32& other) { m_avx2 = _mm256_xor_si256(m_avx2, other.m_avx2); }
216
217 BOTAN_FN_ISA_SIMD_8X32
218 void operator^=(uint32_t other) { *this ^= SIMD_8x32::splat(other); }
219
220 BOTAN_FN_ISA_SIMD_8X32
221 void operator|=(const SIMD_8x32& other) { m_avx2 = _mm256_or_si256(m_avx2, other.m_avx2); }
222
223 BOTAN_FN_ISA_SIMD_8X32
224 void operator&=(const SIMD_8x32& other) { m_avx2 = _mm256_and_si256(m_avx2, other.m_avx2); }
225
226 template <int SHIFT>
227 BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32 shl() const noexcept {
228 return SIMD_8x32(_mm256_slli_epi32(m_avx2, SHIFT));
229 }
230
231 template <int SHIFT>
232 BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32 shr() const noexcept {
233 return SIMD_8x32(_mm256_srli_epi32(m_avx2, SHIFT));
234 }
235
236 BOTAN_FN_ISA_SIMD_8X32
237 SIMD_8x32 operator~() const noexcept {
238 return SIMD_8x32(_mm256_xor_si256(m_avx2, _mm256_set1_epi32(0xFFFFFFFF)));
239 }
240
241 // (~reg) & other
242 BOTAN_FN_ISA_SIMD_8X32
243 SIMD_8x32 andc(const SIMD_8x32& other) const noexcept {
244 return SIMD_8x32(_mm256_andnot_si256(m_avx2, other.m_avx2));
245 }
246
247 BOTAN_FN_ISA_SIMD_8X32
248 SIMD_8x32 bswap() const noexcept {
249 alignas(32) const uint8_t BSWAP_TBL[32] = {3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12,
250 19, 18, 17, 16, 23, 22, 21, 20, 27, 26, 25, 24, 31, 30, 29, 28};
251
252 const __m256i bswap = _mm256_load_si256(reinterpret_cast<const __m256i*>(BSWAP_TBL));
253
254 const __m256i output = _mm256_shuffle_epi8(m_avx2, bswap);
255
256 return SIMD_8x32(output);
257 }
258
259 // Equivalent to rev_words().bswap()
260 BOTAN_FN_ISA_SIMD_8X32
261 SIMD_8x32 reverse() const noexcept {
262 alignas(32) const uint8_t REV_TBL[32] = {15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
263 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
264
265 const __m256i bswap = _mm256_load_si256(reinterpret_cast<const __m256i*>(REV_TBL));
266 const __m256i output = _mm256_shuffle_epi8(m_avx2, bswap);
267 return SIMD_8x32(output);
268 }
269
270 BOTAN_FN_ISA_SIMD_8X32
271 SIMD_8x32 rev_words() const noexcept { return SIMD_8x32(_mm256_shuffle_epi32(raw(), 0b00011011)); }
272
273 BOTAN_FN_ISA_SIMD_8X32
274 static void transpose(SIMD_8x32& B0, SIMD_8x32& B1, SIMD_8x32& B2, SIMD_8x32& B3) noexcept {
275 const __m256i T0 = _mm256_unpacklo_epi32(B0.m_avx2, B1.m_avx2);
276 const __m256i T1 = _mm256_unpacklo_epi32(B2.m_avx2, B3.m_avx2);
277 const __m256i T2 = _mm256_unpackhi_epi32(B0.m_avx2, B1.m_avx2);
278 const __m256i T3 = _mm256_unpackhi_epi32(B2.m_avx2, B3.m_avx2);
279
280 B0.m_avx2 = _mm256_unpacklo_epi64(T0, T1);
281 B1.m_avx2 = _mm256_unpackhi_epi64(T0, T1);
282 B2.m_avx2 = _mm256_unpacklo_epi64(T2, T3);
283 B3.m_avx2 = _mm256_unpackhi_epi64(T2, T3);
284 }
285
286 static inline SIMD_8x32 BOTAN_FN_ISA_SIMD_8X32 alignr8(const SIMD_8x32& a, const SIMD_8x32& b) {
287 return SIMD_8x32(_mm256_alignr_epi8(a.raw(), b.raw(), 8));
288 }
289
290 template <size_t I>
291 BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32 shift_elems_left() const noexcept
292 requires(I > 0 && I <= 3)
293 {
294 return SIMD_8x32(_mm256_slli_si256(raw(), 4 * I));
295 }
296
297 template <size_t I>
298 BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32 shift_elems_right() const noexcept
299 requires(I > 0 && I <= 3)
300 {
301 return SIMD_8x32(_mm256_srli_si256(raw(), 4 * I));
302 }
303
304 BOTAN_FN_ISA_SIMD_8X32
305 static void transpose(SIMD_8x32& B0,
306 SIMD_8x32& B1,
307 SIMD_8x32& B2,
308 SIMD_8x32& B3,
309 SIMD_8x32& B4,
310 SIMD_8x32& B5,
311 SIMD_8x32& B6,
312 SIMD_8x32& B7) noexcept {
313 transpose(B0, B1, B2, B3);
314 transpose(B4, B5, B6, B7);
315
316 swap_tops(B0, B4);
317 swap_tops(B1, B5);
318 swap_tops(B2, B6);
319 swap_tops(B3, B7);
320 }
321
322 /**
323 * Unsigned lane comparison; returns a mask with all bits set in each
324 * 32-bit lane that is (unsigned) less than the corresponding lane of
325 * @p other, and all bits cleared otherwise.
326 */
327 SIMD_8x32 BOTAN_FN_ISA_SIMD_8X32 unsigned_lt(const SIMD_8x32& other) const noexcept {
328 // No unsigned comparison before AVX-512; bias into the signed domain
329 const __m256i bias = _mm256_set1_epi32(static_cast<int32_t>(0x80000000));
330 return SIMD_8x32(_mm256_cmpgt_epi32(_mm256_xor_si256(other.raw(), bias), _mm256_xor_si256(raw(), bias)));
331 }
332
333 BOTAN_FN_ISA_SIMD_8X32
334 static SIMD_8x32 choose(const SIMD_8x32& mask, const SIMD_8x32& a, const SIMD_8x32& b) noexcept {
335#if defined(__AVX512VL__)
336 return SIMD_8x32(_mm256_ternarylogic_epi32(mask.raw(), a.raw(), b.raw(), 0xca));
337#else
338 return (mask & a) ^ mask.andc(b);
339#endif
340 }
341
342 BOTAN_FN_ISA_SIMD_8X32
343 static SIMD_8x32 majority(const SIMD_8x32& x, const SIMD_8x32& y, const SIMD_8x32& z) noexcept {
344#if defined(__AVX512VL__)
345 return SIMD_8x32(_mm256_ternarylogic_epi32(x.raw(), y.raw(), z.raw(), 0xe8));
346#else
347 return SIMD_8x32::choose(x ^ y, z, y);
348#endif
349 }
350
351 static inline SIMD_8x32 BOTAN_FN_ISA_SIMD_8X32 byte_shuffle(const SIMD_8x32& tbl, const SIMD_8x32& idx) {
352 return SIMD_8x32(_mm256_shuffle_epi8(tbl.raw(), idx.raw()));
353 }
354
355 /**
356 * Byte shuffle with masking, performed within each half
357 *
358 * If the top bit of an index byte is set the output byte is zero,
359 * otherwise the low 4 bits select a byte from the same half of tbl.
360 */
361 static inline SIMD_8x32 BOTAN_FN_ISA_SIMD_8X32 masked_byte_shuffle(const SIMD_8x32& tbl, const SIMD_8x32& idx) {
362 return SIMD_8x32(_mm256_shuffle_epi8(tbl.raw(), idx.raw()));
363 }
364
365 /**
366 * Swap the two 128-bit halves of the register
367 */
368 SIMD_8x32 BOTAN_FN_ISA_SIMD_8X32 swap_halves() const noexcept {
369 return SIMD_8x32(_mm256_permute2x128_si256(raw(), raw(), 0x01));
370 }
371
372 /**
373 * Multiply each byte by x in GF(2^8) using the reduction polynomial
374 * given by POLY (which omits the implicit x^8 term)
375 */
376 template <uint8_t POLY>
377 SIMD_8x32 BOTAN_FN_ISA_SIMD_8X32 xtime() const noexcept {
378 const auto poly = _mm256_set1_epi8(static_cast<char>(POLY));
379 const auto shifted = _mm256_add_epi8(raw(), raw());
380 // blendv selects using the top bit of each byte of the mask argument
381 return SIMD_8x32(_mm256_blendv_epi8(shifted, _mm256_xor_si256(shifted, poly), raw()));
382 }
383
384 BOTAN_FN_ISA_SIMD_8X32
385 static void reset_registers() noexcept { _mm256_zeroupper(); }
386
387 BOTAN_FN_ISA_SIMD_8X32
388 static void zero_registers() noexcept { _mm256_zeroall(); }
389
390 __m256i BOTAN_FN_ISA_SIMD_8X32 raw() const noexcept { return m_avx2; }
391
392 BOTAN_FN_ISA_SIMD_8X32
393 explicit SIMD_8x32(__m256i x) noexcept : m_avx2(x) {}
394
395 private:
396 BOTAN_FN_ISA_SIMD_8X32
397 static void swap_tops(SIMD_8x32& A, SIMD_8x32& B) {
398 const auto T0 = SIMD_8x32(_mm256_permute2x128_si256(A.raw(), B.raw(), 0 + (2 << 4)));
399 const auto T1 = SIMD_8x32(_mm256_permute2x128_si256(A.raw(), B.raw(), 1 + (3 << 4)));
400 A = T0;
401 B = T1;
402 }
403
404 __m256i m_avx2;
405};
406
407// NOLINTEND(portability-simd-intrinsics)
408
409template <size_t R>
410inline SIMD_8x32 BOTAN_FN_ISA_SIMD_8X32 rotl(SIMD_8x32 input) {
411 return input.rotl<R>();
412}
413
414template <size_t R>
415inline SIMD_8x32 BOTAN_FN_ISA_SIMD_8X32 rotr(SIMD_8x32 input) {
416 return input.rotr<R>();
417}
418
419// For Serpent:
420template <size_t S>
421inline SIMD_8x32 BOTAN_FN_ISA_SIMD_8X32 shl(SIMD_8x32 input) {
422 return input.shl<S>();
423}
424
425} // namespace Botan
426
427#endif
BOTAN_FN_ISA_SIMD_8X32 void store_le(uint32_t out[]) const noexcept
Definition simd_8x32.h:97
BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32 shift_elems_right() const noexcept
Definition simd_8x32.h:298
BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32 andc(const SIMD_8x32 &other) const noexcept
Definition simd_8x32.h:243
static BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32 load_le128(const uint32_t *in) noexcept
Definition simd_8x32.h:76
SIMD_8x32 & operator=(SIMD_8x32 &&other)=default
SIMD_8x32(const SIMD_8x32 &other)=default
static BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32 load_le128(const uint32_t in1[], const uint32_t in2[]) noexcept
Definition simd_8x32.h:105
BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32 shr() const noexcept
Definition simd_8x32.h:232
BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32 operator-(const SIMD_8x32 &other) const noexcept
Definition simd_8x32.h:181
static BOTAN_FN_ISA_SIMD_8X32 void transpose(SIMD_8x32 &B0, SIMD_8x32 &B1, SIMD_8x32 &B2, SIMD_8x32 &B3, SIMD_8x32 &B4, SIMD_8x32 &B5, SIMD_8x32 &B6, SIMD_8x32 &B7) noexcept
Definition simd_8x32.h:305
static BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32 splat(uint32_t B) noexcept
Definition simd_8x32.h:58
static BOTAN_FN_ISA_SIMD_8X32 void transpose(SIMD_8x32 &B0, SIMD_8x32 &B1, SIMD_8x32 &B2, SIMD_8x32 &B3) noexcept
Definition simd_8x32.h:274
BOTAN_FN_ISA_SIMD_8X32 void operator^=(uint32_t other)
Definition simd_8x32.h:218
BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32 operator~() const noexcept
Definition simd_8x32.h:237
static BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32 load_le(const uint8_t *in) noexcept
Definition simd_8x32.h:61
static BOTAN_FN_ISA_SIMD_8X32 void zero_registers() noexcept
Definition simd_8x32.h:388
static BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32 load_le128(const uint8_t *in) noexcept
Definition simd_8x32.h:71
SIMD_8x32 BOTAN_FN_ISA_SIMD_8X32 unsigned_lt(const SIMD_8x32 &other) const noexcept
Definition simd_8x32.h:327
BOTAN_FN_ISA_SIMD_8X32 void operator-=(const SIMD_8x32 &other)
Definition simd_8x32.h:212
BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32 rotr() const noexcept
Definition simd_8x32.h:155
SIMD_8x32 BOTAN_FN_ISA_SIMD_8X32 swap_halves() const noexcept
Definition simd_8x32.h:368
BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32 rotl() const noexcept
Definition simd_8x32.h:126
~SIMD_8x32()=default
static BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32 choose(const SIMD_8x32 &mask, const SIMD_8x32 &a, const SIMD_8x32 &b) noexcept
Definition simd_8x32.h:334
BOTAN_FN_ISA_SIMD_8X32 void operator&=(const SIMD_8x32 &other)
Definition simd_8x32.h:224
BOTAN_FN_ISA_SIMD_8X32 void store_le128(uint32_t out1[], uint32_t out2[]) const noexcept
Definition simd_8x32.h:118
static SIMD_8x32 BOTAN_FN_ISA_SIMD_8X32 byte_shuffle(const SIMD_8x32 &tbl, const SIMD_8x32 &idx)
Definition simd_8x32.h:351
static BOTAN_FN_ISA_SIMD_8X32 void reset_registers() noexcept
Definition simd_8x32.h:385
BOTAN_FN_ISA_SIMD_8X32 void operator+=(const SIMD_8x32 &other)
Definition simd_8x32.h:209
BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32 shift_elems_left() const noexcept
Definition simd_8x32.h:291
SIMD_8x32(SIMD_8x32 &&other)=default
BOTAN_FN_ISA_SIMD_8X32 void operator^=(const SIMD_8x32 &other)
Definition simd_8x32.h:215
BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32 operator|(const SIMD_8x32 &other) const noexcept
Definition simd_8x32.h:195
SIMD_8x32 BOTAN_FN_ISA_SIMD_8X32 sigma0() const noexcept
Definition simd_8x32.h:159
BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32 operator^(const SIMD_8x32 &other) const noexcept
Definition simd_8x32.h:188
BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32 reverse() const noexcept
Definition simd_8x32.h:261
static BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32 load_le(const uint32_t *in) noexcept
Definition simd_8x32.h:66
BOTAN_FN_ISA_SIMD_8X32 BOTAN_FORCE_INLINE SIMD_8x32() noexcept
Definition simd_8x32.h:30
BOTAN_FN_ISA_SIMD_8X32 void store_le128(uint8_t out[]) const noexcept
Definition simd_8x32.h:100
BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32 bswap() const noexcept
Definition simd_8x32.h:248
BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32 rev_words() const noexcept
Definition simd_8x32.h:271
BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32(uint32_t B0, uint32_t B1, uint32_t B2, uint32_t B3, uint32_t B4, uint32_t B5, uint32_t B6, uint32_t B7) noexcept
Definition simd_8x32.h:39
SIMD_8x32 BOTAN_FN_ISA_SIMD_8X32 sigma1() const noexcept
Definition simd_8x32.h:166
static SIMD_8x32 BOTAN_FN_ISA_SIMD_8X32 alignr8(const SIMD_8x32 &a, const SIMD_8x32 &b)
Definition simd_8x32.h:286
static BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32 load_be(const uint8_t *in) noexcept
Definition simd_8x32.h:81
BOTAN_FN_ISA_SIMD_8X32 void store_be(uint8_t out[]) const noexcept
Definition simd_8x32.h:123
BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32 operator&(const SIMD_8x32 &other) const noexcept
Definition simd_8x32.h:202
SIMD_8x32 & operator=(const SIMD_8x32 &other)=default
SIMD_8x32 BOTAN_FN_ISA_SIMD_8X32 xtime() const noexcept
Definition simd_8x32.h:377
static BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32 load_be128(const uint8_t in1[], const uint8_t in2[]) noexcept
Definition simd_8x32.h:111
static BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32 majority(const SIMD_8x32 &x, const SIMD_8x32 &y, const SIMD_8x32 &z) noexcept
Definition simd_8x32.h:343
static BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32 load_be(const uint8_t *const *ptrs, size_t i, size_t n, size_t offset=0)
Definition simd_8x32.h:89
BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32 operator+(const SIMD_8x32 &other) const noexcept
Definition simd_8x32.h:174
__m256i BOTAN_FN_ISA_SIMD_8X32 raw() const noexcept
Definition simd_8x32.h:390
BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32(__m256i x) noexcept
Definition simd_8x32.h:393
static SIMD_8x32 BOTAN_FN_ISA_SIMD_8X32 masked_byte_shuffle(const SIMD_8x32 &tbl, const SIMD_8x32 &idx)
Definition simd_8x32.h:361
BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32(const uint32_t B[8]) noexcept
Definition simd_8x32.h:33
BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32(uint32_t B0, uint32_t B1, uint32_t B2, uint32_t B3) noexcept
Definition simd_8x32.h:52
BOTAN_FN_ISA_SIMD_8X32 SIMD_8x32 shl() const noexcept
Definition simd_8x32.h:227
BOTAN_FN_ISA_SIMD_8X32 void operator|=(const SIMD_8x32 &other)
Definition simd_8x32.h:221
BOTAN_FN_ISA_SIMD_8X32 void store_le(uint8_t out[]) const noexcept
Definition simd_8x32.h:94
#define BOTAN_FORCE_INLINE
Definition compiler.h:86
BOTAN_FORCE_INLINE constexpr T rotr(T input)
Definition rotate.h:35
BOTAN_FORCE_INLINE constexpr T rotl(T input)
Definition rotate.h:23
SIMD_4x32 shl(SIMD_4x32 input)
Definition simd_4x32.h:1004