Botan 3.8.1
Crypto and TLS for C&
Botan::SIMD_8x32 Class Referencefinal

#include <simd_avx2.h>

Public Member Functions

BOTAN_FN_ISA_AVX2 SIMD_8x32 andc (const SIMD_8x32 &other) const noexcept
 
BOTAN_FN_ISA_AVX2 SIMD_8x32 bswap () const noexcept
 
BOTAN_FN_ISA_AVX2 SIMD_8x32 operator& (const SIMD_8x32 &other) const noexcept
 
BOTAN_FN_ISA_AVX2 void operator&= (const SIMD_8x32 &other)
 
BOTAN_FN_ISA_AVX2 SIMD_8x32 operator+ (const SIMD_8x32 &other) const noexcept
 
BOTAN_FN_ISA_AVX2 void operator+= (const SIMD_8x32 &other)
 
BOTAN_FN_ISA_AVX2 SIMD_8x32 operator- (const SIMD_8x32 &other) const noexcept
 
BOTAN_FN_ISA_AVX2 void operator-= (const SIMD_8x32 &other)
 
SIMD_8x32operator= (const SIMD_8x32 &other)=default
 
SIMD_8x32operator= (SIMD_8x32 &&other)=default
 
BOTAN_FN_ISA_AVX2 SIMD_8x32 operator^ (const SIMD_8x32 &other) const noexcept
 
BOTAN_FN_ISA_AVX2 void operator^= (const SIMD_8x32 &other)
 
BOTAN_FN_ISA_AVX2 void operator^= (uint32_t other)
 
BOTAN_FN_ISA_AVX2 SIMD_8x32 operator| (const SIMD_8x32 &other) const noexcept
 
BOTAN_FN_ISA_AVX2 void operator|= (const SIMD_8x32 &other)
 
BOTAN_FN_ISA_AVX2 SIMD_8x32 operator~ () const noexcept
 
__m256i BOTAN_FN_ISA_AVX2 raw () const noexcept
 
BOTAN_FN_ISA_AVX2 SIMD_8x32 rev_words () const noexcept
 
BOTAN_FN_ISA_AVX2 SIMD_8x32 reverse () const noexcept
 
template<size_t ROT>
requires (ROT > 0 && ROT < 32)
BOTAN_FN_ISA_AVX2 SIMD_8x32 rotl () const noexcept
 
template<size_t ROT>
BOTAN_FN_ISA_AVX2 SIMD_8x32 rotr () const noexcept
 
template<int SHIFT>
BOTAN_FN_ISA_AVX2 SIMD_8x32 shl () const noexcept
 
template<int SHIFT>
BOTAN_FN_ISA_AVX2 SIMD_8x32 shr () const noexcept
 
SIMD_8x32 BOTAN_FN_ISA_AVX2 sigma0 () const noexcept
 
SIMD_8x32 BOTAN_FN_ISA_AVX2 sigma1 () const noexcept
 
BOTAN_FN_ISA_AVX2 BOTAN_FORCE_INLINE SIMD_8x32 () noexcept
 
BOTAN_FN_ISA_AVX2 SIMD_8x32 (__m256i x) noexcept
 
 SIMD_8x32 (const SIMD_8x32 &other)=default
 
BOTAN_FN_ISA_AVX2 SIMD_8x32 (const uint32_t B[8]) noexcept
 
 SIMD_8x32 (SIMD_8x32 &&other)=default
 
BOTAN_FN_ISA_AVX2 SIMD_8x32 (uint32_t B0, uint32_t B1, uint32_t B2, uint32_t B3) noexcept
 
BOTAN_FN_ISA_AVX2 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
 
BOTAN_FN_ISA_AVX2 void store_be (uint8_t out[]) const noexcept
 
BOTAN_FN_ISA_AVX2 void store_le (uint8_t out[]) const noexcept
 
BOTAN_FN_ISA_AVX2 void store_le128 (uint32_t out1[], uint32_t out2[]) const noexcept
 
BOTAN_FN_ISA_AVX2 void store_le128 (uint8_t out[]) const noexcept
 
 ~SIMD_8x32 ()=default
 

Static Public Member Functions

static SIMD_8x32 BOTAN_FN_ISA_AVX2 byte_shuffle (const SIMD_8x32 &tbl, const SIMD_8x32 &idx)
 
static BOTAN_FN_ISA_AVX2 SIMD_8x32 choose (const SIMD_8x32 &mask, const SIMD_8x32 &a, const SIMD_8x32 &b) noexcept
 
static BOTAN_FN_ISA_AVX2 SIMD_8x32 load_be (const uint8_t *in) noexcept
 
static BOTAN_FN_ISA_AVX2 SIMD_8x32 load_be128 (const uint8_t in1[], const uint8_t in2[]) noexcept
 
static BOTAN_FN_ISA_AVX2 SIMD_8x32 load_le (const uint32_t *in) noexcept
 
static BOTAN_FN_ISA_AVX2 SIMD_8x32 load_le (const uint8_t *in) noexcept
 
static BOTAN_FN_ISA_AVX2 SIMD_8x32 load_le128 (const uint32_t *in) noexcept
 
static BOTAN_FN_ISA_AVX2 SIMD_8x32 load_le128 (const uint32_t in1[], const uint32_t in2[]) noexcept
 
static BOTAN_FN_ISA_AVX2 SIMD_8x32 load_le128 (const uint8_t *in) noexcept
 
static BOTAN_FN_ISA_AVX2 SIMD_8x32 majority (const SIMD_8x32 &x, const SIMD_8x32 &y, const SIMD_8x32 &z) noexcept
 
static BOTAN_FN_ISA_AVX2 void reset_registers () noexcept
 
static BOTAN_FN_ISA_AVX2 SIMD_8x32 splat (uint32_t B) noexcept
 
static BOTAN_FN_ISA_AVX2 void transpose (SIMD_8x32 &B0, SIMD_8x32 &B1, SIMD_8x32 &B2, SIMD_8x32 &B3) noexcept
 
static BOTAN_FN_ISA_AVX2 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
 
static BOTAN_FN_ISA_AVX2 void zero_registers () noexcept
 

Detailed Description

Definition at line 17 of file simd_avx2.h.

Constructor & Destructor Documentation

◆ SIMD_8x32() [1/7]

◆ SIMD_8x32() [2/7]

Botan::SIMD_8x32::SIMD_8x32 ( SIMD_8x32 && other)
default

References SIMD_8x32().

◆ ~SIMD_8x32()

Botan::SIMD_8x32::~SIMD_8x32 ( )
default

◆ SIMD_8x32() [3/7]

BOTAN_FN_ISA_AVX2 BOTAN_FORCE_INLINE Botan::SIMD_8x32::SIMD_8x32 ( )
inlinenoexcept

Definition at line 28 of file simd_avx2.h.

28{ m_avx2 = _mm256_setzero_si256(); }

References BOTAN_FORCE_INLINE.

Referenced by andc(), bswap(), byte_shuffle(), load_be128(), load_le(), load_le(), load_le128(), load_le128(), load_le128(), operator~(), rev_words(), reverse(), rotl(), shl(), shr(), and splat().

◆ SIMD_8x32() [4/7]

BOTAN_FN_ISA_AVX2 Botan::SIMD_8x32::SIMD_8x32 ( const uint32_t B[8])
inlineexplicitnoexcept

Definition at line 31 of file simd_avx2.h.

31 {
32 m_avx2 = _mm256_loadu_si256(reinterpret_cast<const __m256i*>(B));
33 }

◆ SIMD_8x32() [5/7]

BOTAN_FN_ISA_AVX2 Botan::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 )
inlineexplicitnoexcept

Definition at line 36 of file simd_avx2.h.

43 {
44 m_avx2 = _mm256_set_epi32(B7, B6, B5, B4, B3, B2, B1, B0);
45 }

◆ SIMD_8x32() [6/7]

BOTAN_FN_ISA_AVX2 Botan::SIMD_8x32::SIMD_8x32 ( uint32_t B0,
uint32_t B1,
uint32_t B2,
uint32_t B3 )
inlineexplicitnoexcept

Definition at line 48 of file simd_avx2.h.

48 {
49 m_avx2 = _mm256_set_epi32(B3, B2, B1, B0, B3, B2, B1, B0);
50 }

◆ SIMD_8x32() [7/7]

BOTAN_FN_ISA_AVX2 Botan::SIMD_8x32::SIMD_8x32 ( __m256i x)
inlinenoexcept

Definition at line 317 of file simd_avx2.h.

317: m_avx2(x) {}

Member Function Documentation

◆ andc()

BOTAN_FN_ISA_AVX2 SIMD_8x32 Botan::SIMD_8x32::andc ( const SIMD_8x32 & other) const
inlinenoexcept

Definition at line 225 of file simd_avx2.h.

225 {
226 return SIMD_8x32(_mm256_andnot_si256(m_avx2, other.m_avx2));
227 }
BOTAN_FN_ISA_AVX2 BOTAN_FORCE_INLINE SIMD_8x32() noexcept
Definition simd_avx2.h:28

References SIMD_8x32(), and SIMD_8x32().

◆ bswap()

BOTAN_FN_ISA_AVX2 SIMD_8x32 Botan::SIMD_8x32::bswap ( ) const
inlinenoexcept

Definition at line 230 of file simd_avx2.h.

230 {
231 alignas(32) const uint8_t BSWAP_TBL[32] = {3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12,
232 19, 18, 17, 16, 23, 22, 21, 20, 27, 26, 25, 24, 31, 30, 29, 28};
233
234 const __m256i bswap = _mm256_load_si256(reinterpret_cast<const __m256i*>(BSWAP_TBL));
235
236 const __m256i output = _mm256_shuffle_epi8(m_avx2, bswap);
237
238 return SIMD_8x32(output);
239 }
BOTAN_FN_ISA_AVX2 SIMD_8x32 bswap() const noexcept
Definition simd_avx2.h:230

References bswap(), SIMD_8x32(), and SIMD_8x32().

Referenced by bswap(), load_be(), reverse(), and store_be().

◆ byte_shuffle()

static SIMD_8x32 BOTAN_FN_ISA_AVX2 Botan::SIMD_8x32::byte_shuffle ( const SIMD_8x32 & tbl,
const SIMD_8x32 & idx )
inlinestatic

Definition at line 304 of file simd_avx2.h.

304 {
305 return SIMD_8x32(_mm256_shuffle_epi8(tbl.raw(), idx.raw()));
306 }

References raw(), SIMD_8x32(), and SIMD_8x32().

◆ choose()

static BOTAN_FN_ISA_AVX2 SIMD_8x32 Botan::SIMD_8x32::choose ( const SIMD_8x32 & mask,
const SIMD_8x32 & a,
const SIMD_8x32 & b )
inlinestaticnoexcept

Definition at line 287 of file simd_avx2.h.

287 {
288#if defined(__AVX512VL__)
289 return _mm256_ternarylogic_epi32(mask.raw(), a.raw(), b.raw(), 0xca);
290#else
291 return (mask & a) ^ mask.andc(b);
292#endif
293 }

References SIMD_8x32().

Referenced by majority().

◆ load_be()

static BOTAN_FN_ISA_AVX2 SIMD_8x32 Botan::SIMD_8x32::load_be ( const uint8_t * in)
inlinestaticnoexcept

Definition at line 76 of file simd_avx2.h.

76{ return load_le(in).bswap(); }
static BOTAN_FN_ISA_AVX2 SIMD_8x32 load_le(const uint8_t *in) noexcept
Definition simd_avx2.h:56

References bswap(), load_le(), and SIMD_8x32().

◆ load_be128()

static BOTAN_FN_ISA_AVX2 SIMD_8x32 Botan::SIMD_8x32::load_be128 ( const uint8_t in1[],
const uint8_t in2[] )
inlinestaticnoexcept

Definition at line 93 of file simd_avx2.h.

93 {
94 return SIMD_8x32(
95 _mm256_loadu2_m128i(reinterpret_cast<const __m128i*>(in2), reinterpret_cast<const __m128i*>(in1)))
96 .bswap();
97 }

References SIMD_8x32(), and SIMD_8x32().

◆ load_le() [1/2]

static BOTAN_FN_ISA_AVX2 SIMD_8x32 Botan::SIMD_8x32::load_le ( const uint32_t * in)
inlinestaticnoexcept

Definition at line 61 of file simd_avx2.h.

61 {
62 return SIMD_8x32(_mm256_loadu_si256(reinterpret_cast<const __m256i*>(in)));
63 }

References SIMD_8x32(), and SIMD_8x32().

◆ load_le() [2/2]

static BOTAN_FN_ISA_AVX2 SIMD_8x32 Botan::SIMD_8x32::load_le ( const uint8_t * in)
inlinestaticnoexcept

Definition at line 56 of file simd_avx2.h.

56 {
57 return SIMD_8x32(_mm256_loadu_si256(reinterpret_cast<const __m256i*>(in)));
58 }

References SIMD_8x32(), and SIMD_8x32().

Referenced by load_be().

◆ load_le128() [1/3]

static BOTAN_FN_ISA_AVX2 SIMD_8x32 Botan::SIMD_8x32::load_le128 ( const uint32_t * in)
inlinestaticnoexcept

Definition at line 71 of file simd_avx2.h.

71 {
72 return SIMD_8x32(_mm256_broadcastsi128_si256(_mm_loadu_si128(reinterpret_cast<const __m128i*>(in))));
73 }

References SIMD_8x32(), and SIMD_8x32().

◆ load_le128() [2/3]

static BOTAN_FN_ISA_AVX2 SIMD_8x32 Botan::SIMD_8x32::load_le128 ( const uint32_t in1[],
const uint32_t in2[] )
inlinestaticnoexcept

Definition at line 87 of file simd_avx2.h.

87 {
88 return SIMD_8x32(
89 _mm256_loadu2_m128i(reinterpret_cast<const __m128i*>(in2), reinterpret_cast<const __m128i*>(in1)));
90 }

References SIMD_8x32(), and SIMD_8x32().

◆ load_le128() [3/3]

static BOTAN_FN_ISA_AVX2 SIMD_8x32 Botan::SIMD_8x32::load_le128 ( const uint8_t * in)
inlinestaticnoexcept

Definition at line 66 of file simd_avx2.h.

66 {
67 return SIMD_8x32(_mm256_broadcastsi128_si256(_mm_loadu_si128(reinterpret_cast<const __m128i*>(in))));
68 }

References SIMD_8x32(), and SIMD_8x32().

◆ majority()

static BOTAN_FN_ISA_AVX2 SIMD_8x32 Botan::SIMD_8x32::majority ( const SIMD_8x32 & x,
const SIMD_8x32 & y,
const SIMD_8x32 & z )
inlinestaticnoexcept

Definition at line 296 of file simd_avx2.h.

296 {
297#if defined(__AVX512VL__)
298 return _mm256_ternarylogic_epi32(x.raw(), y.raw(), z.raw(), 0xe8);
299#else
300 return SIMD_8x32::choose(x ^ y, z, y);
301#endif
302 }
static BOTAN_FN_ISA_AVX2 SIMD_8x32 choose(const SIMD_8x32 &mask, const SIMD_8x32 &a, const SIMD_8x32 &b) noexcept
Definition simd_avx2.h:287

References choose(), and SIMD_8x32().

◆ operator&()

BOTAN_FN_ISA_AVX2 SIMD_8x32 Botan::SIMD_8x32::operator& ( const SIMD_8x32 & other) const
inlinenoexcept

Definition at line 184 of file simd_avx2.h.

184 {
185 SIMD_8x32 retval(*this);
186 retval &= other;
187 return retval;
188 }
SIMD_8x32(const SIMD_8x32 &other)=default

References SIMD_8x32().

◆ operator&=()

BOTAN_FN_ISA_AVX2 void Botan::SIMD_8x32::operator&= ( const SIMD_8x32 & other)
inline

Definition at line 206 of file simd_avx2.h.

206{ m_avx2 = _mm256_and_si256(m_avx2, other.m_avx2); }

References SIMD_8x32().

◆ operator+()

BOTAN_FN_ISA_AVX2 SIMD_8x32 Botan::SIMD_8x32::operator+ ( const SIMD_8x32 & other) const
inlinenoexcept

Definition at line 156 of file simd_avx2.h.

156 {
157 SIMD_8x32 retval(*this);
158 retval += other;
159 return retval;
160 }

References SIMD_8x32().

◆ operator+=()

BOTAN_FN_ISA_AVX2 void Botan::SIMD_8x32::operator+= ( const SIMD_8x32 & other)
inline

Definition at line 191 of file simd_avx2.h.

191{ m_avx2 = _mm256_add_epi32(m_avx2, other.m_avx2); }

References SIMD_8x32().

◆ operator-()

BOTAN_FN_ISA_AVX2 SIMD_8x32 Botan::SIMD_8x32::operator- ( const SIMD_8x32 & other) const
inlinenoexcept

Definition at line 163 of file simd_avx2.h.

163 {
164 SIMD_8x32 retval(*this);
165 retval -= other;
166 return retval;
167 }

References SIMD_8x32().

◆ operator-=()

BOTAN_FN_ISA_AVX2 void Botan::SIMD_8x32::operator-= ( const SIMD_8x32 & other)
inline

Definition at line 194 of file simd_avx2.h.

194{ m_avx2 = _mm256_sub_epi32(m_avx2, other.m_avx2); }

References SIMD_8x32().

◆ operator=() [1/2]

SIMD_8x32 & Botan::SIMD_8x32::operator= ( const SIMD_8x32 & other)
default

References SIMD_8x32().

◆ operator=() [2/2]

SIMD_8x32 & Botan::SIMD_8x32::operator= ( SIMD_8x32 && other)
default

References SIMD_8x32().

◆ operator^()

BOTAN_FN_ISA_AVX2 SIMD_8x32 Botan::SIMD_8x32::operator^ ( const SIMD_8x32 & other) const
inlinenoexcept

Definition at line 170 of file simd_avx2.h.

170 {
171 SIMD_8x32 retval(*this);
172 retval ^= other;
173 return retval;
174 }

References SIMD_8x32().

◆ operator^=() [1/2]

BOTAN_FN_ISA_AVX2 void Botan::SIMD_8x32::operator^= ( const SIMD_8x32 & other)
inline

Definition at line 197 of file simd_avx2.h.

197{ m_avx2 = _mm256_xor_si256(m_avx2, other.m_avx2); }

References SIMD_8x32().

◆ operator^=() [2/2]

BOTAN_FN_ISA_AVX2 void Botan::SIMD_8x32::operator^= ( uint32_t other)
inline

Definition at line 200 of file simd_avx2.h.

200{ *this ^= SIMD_8x32::splat(other); }
static BOTAN_FN_ISA_AVX2 SIMD_8x32 splat(uint32_t B) noexcept
Definition simd_avx2.h:53

References splat().

◆ operator|()

BOTAN_FN_ISA_AVX2 SIMD_8x32 Botan::SIMD_8x32::operator| ( const SIMD_8x32 & other) const
inlinenoexcept

Definition at line 177 of file simd_avx2.h.

177 {
178 SIMD_8x32 retval(*this);
179 retval |= other;
180 return retval;
181 }

References SIMD_8x32().

◆ operator|=()

BOTAN_FN_ISA_AVX2 void Botan::SIMD_8x32::operator|= ( const SIMD_8x32 & other)
inline

Definition at line 203 of file simd_avx2.h.

203{ m_avx2 = _mm256_or_si256(m_avx2, other.m_avx2); }

References SIMD_8x32().

◆ operator~()

BOTAN_FN_ISA_AVX2 SIMD_8x32 Botan::SIMD_8x32::operator~ ( ) const
inlinenoexcept

Definition at line 219 of file simd_avx2.h.

219 {
220 return SIMD_8x32(_mm256_xor_si256(m_avx2, _mm256_set1_epi32(0xFFFFFFFF)));
221 }

References SIMD_8x32(), and SIMD_8x32().

◆ raw()

__m256i BOTAN_FN_ISA_AVX2 Botan::SIMD_8x32::raw ( ) const
inlinenoexcept

Definition at line 314 of file simd_avx2.h.

314{ return m_avx2; }

Referenced by byte_shuffle(), Botan::gf2p8affine(), Botan::gf2p8affineinv(), Botan::gf2p8mul(), rev_words(), store_le128(), and store_le128().

◆ reset_registers()

static BOTAN_FN_ISA_AVX2 void Botan::SIMD_8x32::reset_registers ( )
inlinestaticnoexcept

Definition at line 309 of file simd_avx2.h.

309{ _mm256_zeroupper(); }

◆ rev_words()

BOTAN_FN_ISA_AVX2 SIMD_8x32 Botan::SIMD_8x32::rev_words ( ) const
inlinenoexcept

Definition at line 253 of file simd_avx2.h.

253{ return SIMD_8x32(_mm256_shuffle_epi32(raw(), 0b00011011)); }
__m256i BOTAN_FN_ISA_AVX2 raw() const noexcept
Definition simd_avx2.h:314

References raw(), SIMD_8x32(), and SIMD_8x32().

◆ reverse()

BOTAN_FN_ISA_AVX2 SIMD_8x32 Botan::SIMD_8x32::reverse ( ) const
inlinenoexcept

Definition at line 243 of file simd_avx2.h.

243 {
244 alignas(32) const uint8_t REV_TBL[32] = {15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
245 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
246
247 const __m256i bswap = _mm256_load_si256(reinterpret_cast<const __m256i*>(REV_TBL));
248 const __m256i output = _mm256_shuffle_epi8(m_avx2, bswap);
249 return SIMD_8x32(output);
250 }

References bswap(), SIMD_8x32(), and SIMD_8x32().

◆ rotl()

template<size_t ROT>
requires (ROT > 0 && ROT < 32)
BOTAN_FN_ISA_AVX2 SIMD_8x32 Botan::SIMD_8x32::rotl ( ) const
inlinenoexcept

Definition at line 108 of file simd_avx2.h.

110 {
111#if defined(__AVX512VL__)
112 return SIMD_8x32(_mm256_rol_epi32(m_avx2, ROT));
113#else
114 if constexpr(ROT == 8) {
115 const __m256i shuf_rotl_8 =
116 _mm256_set_epi64x(0x0e0d0c0f'0a09080b, 0x06050407'02010003, 0x0e0d0c0f'0a09080b, 0x06050407'02010003);
117
118 return SIMD_8x32(_mm256_shuffle_epi8(m_avx2, shuf_rotl_8));
119 } else if constexpr(ROT == 16) {
120 const __m256i shuf_rotl_16 =
121 _mm256_set_epi64x(0x0d0c0f0e'09080b0a, 0x05040706'01000302, 0x0d0c0f0e'09080b0a, 0x05040706'01000302);
122
123 return SIMD_8x32(_mm256_shuffle_epi8(m_avx2, shuf_rotl_16));
124 } else if constexpr(ROT == 24) {
125 const __m256i shuf_rotl_24 =
126 _mm256_set_epi64x(0x0c0f0e0d'080b0a09, 0x04070605'00030201, 0x0c0f0e0d'080b0a09, 0x04070605'00030201);
127
128 return SIMD_8x32(_mm256_shuffle_epi8(m_avx2, shuf_rotl_24));
129 } else {
130 return SIMD_8x32(_mm256_or_si256(_mm256_slli_epi32(m_avx2, static_cast<int>(ROT)),
131 _mm256_srli_epi32(m_avx2, static_cast<int>(32 - ROT))));
132 }
133#endif
134 }

References SIMD_8x32(), and SIMD_8x32().

Referenced by Botan::rotl(), and rotr().

◆ rotr()

template<size_t ROT>
BOTAN_FN_ISA_AVX2 SIMD_8x32 Botan::SIMD_8x32::rotr ( ) const
inlinenoexcept

Definition at line 137 of file simd_avx2.h.

137 {
138 return this->rotl<32 - ROT>();
139 }
BOTAN_FN_ISA_AVX2 SIMD_8x32 rotl() const noexcept
Definition simd_avx2.h:108

References rotl(), and SIMD_8x32().

Referenced by Botan::rotr(), sigma0(), and sigma1().

◆ shl()

template<int SHIFT>
BOTAN_FN_ISA_AVX2 SIMD_8x32 Botan::SIMD_8x32::shl ( ) const
inlinenoexcept

Definition at line 209 of file simd_avx2.h.

209 {
210 return SIMD_8x32(_mm256_slli_epi32(m_avx2, SHIFT));
211 }

References SIMD_8x32(), and SIMD_8x32().

Referenced by Botan::shl().

◆ shr()

template<int SHIFT>
BOTAN_FN_ISA_AVX2 SIMD_8x32 Botan::SIMD_8x32::shr ( ) const
inlinenoexcept

Definition at line 214 of file simd_avx2.h.

214 {
215 return SIMD_8x32(_mm256_srli_epi32(m_avx2, SHIFT));
216 }

References SIMD_8x32(), and SIMD_8x32().

◆ sigma0()

SIMD_8x32 BOTAN_FN_ISA_AVX2 Botan::SIMD_8x32::sigma0 ( ) const
inlinenoexcept

Definition at line 141 of file simd_avx2.h.

141 {
142 const SIMD_8x32 rot1 = this->rotr<2>();
143 const SIMD_8x32 rot2 = this->rotr<13>();
144 const SIMD_8x32 rot3 = this->rotr<22>();
145 return rot1 ^ rot2 ^ rot3;
146 }
BOTAN_FN_ISA_AVX2 SIMD_8x32 rotr() const noexcept
Definition simd_avx2.h:137

References rotr(), and SIMD_8x32().

◆ sigma1()

SIMD_8x32 BOTAN_FN_ISA_AVX2 Botan::SIMD_8x32::sigma1 ( ) const
inlinenoexcept

Definition at line 148 of file simd_avx2.h.

148 {
149 const SIMD_8x32 rot1 = this->rotr<6>();
150 const SIMD_8x32 rot2 = this->rotr<11>();
151 const SIMD_8x32 rot3 = this->rotr<25>();
152 return rot1 ^ rot2 ^ rot3;
153 }

References rotr(), and SIMD_8x32().

◆ splat()

static BOTAN_FN_ISA_AVX2 SIMD_8x32 Botan::SIMD_8x32::splat ( uint32_t B)
inlinestaticnoexcept

Definition at line 53 of file simd_avx2.h.

53{ return SIMD_8x32(_mm256_set1_epi32(B)); }

References SIMD_8x32(), and SIMD_8x32().

Referenced by operator^=().

◆ store_be()

BOTAN_FN_ISA_AVX2 void Botan::SIMD_8x32::store_be ( uint8_t out[]) const
inlinenoexcept

Definition at line 105 of file simd_avx2.h.

105{ bswap().store_le(out); }
BOTAN_FN_ISA_AVX2 void store_le(uint8_t out[]) const noexcept
Definition simd_avx2.h:79

References bswap(), and store_le().

◆ store_le()

BOTAN_FN_ISA_AVX2 void Botan::SIMD_8x32::store_le ( uint8_t out[]) const
inlinenoexcept

Definition at line 79 of file simd_avx2.h.

79{ _mm256_storeu_si256(reinterpret_cast<__m256i*>(out), m_avx2); }

Referenced by store_be().

◆ store_le128() [1/2]

BOTAN_FN_ISA_AVX2 void Botan::SIMD_8x32::store_le128 ( uint32_t out1[],
uint32_t out2[] ) const
inlinenoexcept

Definition at line 100 of file simd_avx2.h.

100 {
101 _mm256_storeu2_m128i(reinterpret_cast<__m128i*>(out2), reinterpret_cast<__m128i*>(out1), raw());
102 }

References raw().

◆ store_le128() [2/2]

BOTAN_FN_ISA_AVX2 void Botan::SIMD_8x32::store_le128 ( uint8_t out[]) const
inlinenoexcept

Definition at line 82 of file simd_avx2.h.

82 {
83 _mm_storeu_si128(reinterpret_cast<__m128i*>(out), _mm256_extracti128_si256(raw(), 0));
84 }

References raw().

◆ transpose() [1/2]

static BOTAN_FN_ISA_AVX2 void Botan::SIMD_8x32::transpose ( SIMD_8x32 & B0,
SIMD_8x32 & B1,
SIMD_8x32 & B2,
SIMD_8x32 & B3 )
inlinestaticnoexcept

Definition at line 256 of file simd_avx2.h.

256 {
257 const __m256i T0 = _mm256_unpacklo_epi32(B0.m_avx2, B1.m_avx2);
258 const __m256i T1 = _mm256_unpacklo_epi32(B2.m_avx2, B3.m_avx2);
259 const __m256i T2 = _mm256_unpackhi_epi32(B0.m_avx2, B1.m_avx2);
260 const __m256i T3 = _mm256_unpackhi_epi32(B2.m_avx2, B3.m_avx2);
261
262 B0.m_avx2 = _mm256_unpacklo_epi64(T0, T1);
263 B1.m_avx2 = _mm256_unpackhi_epi64(T0, T1);
264 B2.m_avx2 = _mm256_unpacklo_epi64(T2, T3);
265 B3.m_avx2 = _mm256_unpackhi_epi64(T2, T3);
266 }

References SIMD_8x32().

Referenced by transpose().

◆ transpose() [2/2]

static BOTAN_FN_ISA_AVX2 void Botan::SIMD_8x32::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 )
inlinestaticnoexcept

Definition at line 269 of file simd_avx2.h.

276 {
277 transpose(B0, B1, B2, B3);
278 transpose(B4, B5, B6, B7);
279
280 swap_tops(B0, B4);
281 swap_tops(B1, B5);
282 swap_tops(B2, B6);
283 swap_tops(B3, B7);
284 }
static BOTAN_FN_ISA_AVX2 void transpose(SIMD_8x32 &B0, SIMD_8x32 &B1, SIMD_8x32 &B2, SIMD_8x32 &B3) noexcept
Definition simd_avx2.h:256

References SIMD_8x32(), and transpose().

◆ zero_registers()

static BOTAN_FN_ISA_AVX2 void Botan::SIMD_8x32::zero_registers ( )
inlinestaticnoexcept

Definition at line 312 of file simd_avx2.h.

312{ _mm256_zeroall(); }

The documentation for this class was generated from the following file: