Botan 3.14.1
Crypto and TLS for C&
Botan::SIMD_8x64 Class Referencefinal

#include <simd_8x64.h>

Public Member Functions

SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 andc (const SIMD_8x64 &other) const
SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 bswap () const
template<int LANE>
requires (LANE >= 0 && LANE < 8)
uint64_t BOTAN_FN_ISA_SIMD_8X64 extract () const
uint8_t BOTAN_FN_ISA_SIMD_8X64 lanes_eq (const SIMD_8x64 &other) const
uint8_t BOTAN_FN_ISA_SIMD_8X64 lanes_gt (const SIMD_8x64 &other) const
SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 madd52hi (const SIMD_8x64 &a, const SIMD_8x64 &b) const
SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 madd52lo (const SIMD_8x64 &a, const SIMD_8x64 &b) const
SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 masked_madd52hi (uint8_t lanes, const SIMD_8x64 &a, const SIMD_8x64 &b) const
SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 masked_madd52lo (uint8_t lanes, const SIMD_8x64 &a, const SIMD_8x64 &b) const
SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 operator& (const SIMD_8x64 &other) const
BOTAN_FN_ISA_SIMD_8X64 void operator&= (const SIMD_8x64 &other)
SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 operator+ (const SIMD_8x64 &other) const
BOTAN_FN_ISA_SIMD_8X64 void operator+= (const SIMD_8x64 &other)
SIMD_8x64 & operator= (const SIMD_8x64 &other)=default
SIMD_8x64 & operator= (SIMD_8x64 &&other)=default
SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 operator^ (const SIMD_8x64 &other) const
BOTAN_FN_ISA_SIMD_8X64 void operator^= (const SIMD_8x64 &other)
SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 operator| (const SIMD_8x64 &other) const
BOTAN_FN_ISA_SIMD_8X64 void operator|= (const SIMD_8x64 &other)
__m512i BOTAN_FN_ISA_SIMD_8X64 raw () const noexcept
template<size_t ROT>
BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64 rotl () const
template<size_t ROT>
requires (ROT > 0 && ROT < 64)
BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64 rotr () const
template<int SHIFT>
SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 shl () const noexcept
template<int SHIFT>
SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 shr () const noexcept
SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 sigma0 () const
SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 sigma1 () const
BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64 ()
BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64 (__m512i x)
 SIMD_8x64 (const SIMD_8x64 &other)=default
 SIMD_8x64 (SIMD_8x64 &&other)=default
BOTAN_FN_ISA_SIMD_8X64 void store_be (uint8_t out[]) const
void store_le (uint64_t out[8]) const
BOTAN_FN_ISA_SIMD_8X64 void store_le (uint8_t out[]) const
BOTAN_FN_ISA_SIMD_8X64 void store_le4 (void *out0, void *out1, void *out2, void *out3)
 ~SIMD_8x64 ()=default

Static Public Member Functions

template<int LANES>
requires (LANES > 0 && LANES < 8)
static SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 alignr (const SIMD_8x64 &hi, const SIMD_8x64 &lo)
static SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 alignr8 (const SIMD_8x64 &a, const SIMD_8x64 &b)
static BOTAN_FN_ISA_AVX512 SIMD_8x64 broadcast_2x64 (const uint64_t *in)
static BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64 chi (const SIMD_8x64 &x, const SIMD_8x64 &y, const SIMD_8x64 &z)
static BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64 choose (const SIMD_8x64 &mask, const SIMD_8x64 &a, const SIMD_8x64 &b)
static SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 interleave_hi (const SIMD_8x64 &a, const SIMD_8x64 &b)
static SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 interleave_lo (const SIMD_8x64 &a, const SIMD_8x64 &b)
template<size_t Stride>
static BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64 load_be (const uint8_t *const *ptrs, size_t i, size_t n, size_t offset=0)
static BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64 load_be (const void *in)
static BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64 load_be4 (const void *in0, const void *in1, const void *in2, const void *in3)
static BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64 load_le (const void *in)
static BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64 load_le4 (const void *in0, const void *in1, const void *in2, const void *in3)
static BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64 majority (const SIMD_8x64 &x, const SIMD_8x64 &y, const SIMD_8x64 &z)
static SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 masked_add (uint8_t lanes, const SIMD_8x64 &a, const SIMD_8x64 &b)
static BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64 mul2_32 (SIMD_8x64 x, SIMD_8x64 y)
static BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64 splat (uint64_t v)
static BOTAN_FN_ISA_SIMD_8X64 void transpose (SIMD_8x64 &B0, SIMD_8x64 &B1, SIMD_8x64 &B2, SIMD_8x64 &B3, SIMD_8x64 &B4, SIMD_8x64 &B5, SIMD_8x64 &B6, SIMD_8x64 &B7)
static void BOTAN_FN_ISA_SIMD_8X64 twist (SIMD_8x64 &B, SIMD_8x64 &C, SIMD_8x64 &D)
static void BOTAN_FN_ISA_SIMD_8X64 untwist (SIMD_8x64 &B, SIMD_8x64 &C, SIMD_8x64 &D)

Detailed Description

Definition at line 18 of file simd_8x64.h.

Constructor & Destructor Documentation

◆ SIMD_8x64() [1/4]

◆ SIMD_8x64() [2/4]

Botan::SIMD_8x64::SIMD_8x64 ( SIMD_8x64 && other)
default

References SIMD_8x64().

◆ ~SIMD_8x64()

Botan::SIMD_8x64::~SIMD_8x64 ( )
default

◆ SIMD_8x64() [3/4]

BOTAN_FN_ISA_SIMD_8X64 Botan::SIMD_8x64::SIMD_8x64 ( )
inline

◆ SIMD_8x64() [4/4]

BOTAN_FN_ISA_SIMD_8X64 Botan::SIMD_8x64::SIMD_8x64 ( __m512i x)
inlineexplicit

Definition at line 348 of file simd_8x64.h.

348: m_simd(x) {}

Member Function Documentation

◆ alignr()

template<int LANES>
requires (LANES > 0 && LANES < 8)
SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 Botan::SIMD_8x64::alignr ( const SIMD_8x64 & hi,
const SIMD_8x64 & lo )
inlinestatic

Shift the concatenation hi:lo right by LANES lanes, returning the low 8 lanes

Definition at line 239 of file simd_8x64.h.

241 {
242 return SIMD_8x64(_mm512_alignr_epi64(hi.m_simd, lo.m_simd, LANES));
243 }
BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64()
Definition simd_8x64.h:29

References SIMD_8x64(), and SIMD_8x64().

◆ alignr8()

SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 Botan::SIMD_8x64::alignr8 ( const SIMD_8x64 & a,
const SIMD_8x64 & b )
inlinestatic

Definition at line 231 of file simd_8x64.h.

231 {
232 return SIMD_8x64(_mm512_alignr_epi8(a.m_simd, b.m_simd, 8));
233 }

References SIMD_8x64(), and SIMD_8x64().

◆ andc()

SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 Botan::SIMD_8x64::andc ( const SIMD_8x64 & other) const
inline

Definition at line 136 of file simd_8x64.h.

136 {
137 return SIMD_8x64(_mm512_andnot_si512(m_simd, other.m_simd));
138 }

References SIMD_8x64(), and SIMD_8x64().

◆ broadcast_2x64()

BOTAN_FN_ISA_AVX512 SIMD_8x64 Botan::SIMD_8x64::broadcast_2x64 ( const uint64_t * in)
inlinestatic

Definition at line 56 of file simd_8x64.h.

56 {
57 return SIMD_8x64(_mm512_broadcast_i64x2(_mm_loadu_si128(reinterpret_cast<const __m128i*>(in))));
58 }

References SIMD_8x64(), and SIMD_8x64().

◆ bswap()

SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 Botan::SIMD_8x64::bswap ( ) const
inline

Definition at line 72 of file simd_8x64.h.

72 {
73 // clang-format off
74 const auto idx = _mm512_set_epi8(
75 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7,
76 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7);
77 // clang-format on
78
79 return SIMD_8x64(_mm512_shuffle_epi8(m_simd, idx));
80 }

References SIMD_8x64(), and SIMD_8x64().

Referenced by load_be(), load_be4(), and store_be().

◆ chi()

BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64 Botan::SIMD_8x64::chi ( const SIMD_8x64 & x,
const SIMD_8x64 & y,
const SIMD_8x64 & z )
inlinestatic

The Keccak chi operation, x ^ (~y & z)

Definition at line 143 of file simd_8x64.h.

143 {
144 constexpr uint8_t xor_not_and = 0b11010010;
145 return SIMD_8x64(_mm512_ternarylogic_epi64(x.m_simd, y.m_simd, z.m_simd, xor_not_and));
146 }

References SIMD_8x64(), and SIMD_8x64().

◆ choose()

BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64 Botan::SIMD_8x64::choose ( const SIMD_8x64 & mask,
const SIMD_8x64 & a,
const SIMD_8x64 & b )
inlinestatic

Definition at line 175 of file simd_8x64.h.

175 {
176 return SIMD_8x64(_mm512_ternarylogic_epi64(mask.raw(), a.raw(), b.raw(), 0xca));
177 }

References raw(), SIMD_8x64(), and SIMD_8x64().

◆ extract()

template<int LANE>
requires (LANE >= 0 && LANE < 8)
uint64_t BOTAN_FN_ISA_SIMD_8X64 Botan::SIMD_8x64::extract ( ) const
inline

Definition at line 246 of file simd_8x64.h.

248 {
249 const __m128i v = _mm512_extracti64x2_epi64(m_simd, LANE / 2);
250 return static_cast<uint64_t>(_mm_extract_epi64(v, LANE % 2));
251 }

◆ interleave_hi()

SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 Botan::SIMD_8x64::interleave_hi ( const SIMD_8x64 & a,
const SIMD_8x64 & b )
inlinestatic

Interleave the high halves of a and b: a4 b4 a5 b5 a6 b6 a7 b7

Definition at line 292 of file simd_8x64.h.

292 {
293 const auto idx = _mm512_set_epi64(15, 7, 14, 6, 13, 5, 12, 4);
294 return SIMD_8x64(_mm512_permutex2var_epi64(a.m_simd, idx, b.m_simd));
295 }

References SIMD_8x64(), and SIMD_8x64().

◆ interleave_lo()

SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 Botan::SIMD_8x64::interleave_lo ( const SIMD_8x64 & a,
const SIMD_8x64 & b )
inlinestatic

Interleave the low halves of a and b: a0 b0 a1 b1 a2 b2 a3 b3

Definition at line 284 of file simd_8x64.h.

284 {
285 const auto idx = _mm512_set_epi64(11, 3, 10, 2, 9, 1, 8, 0);
286 return SIMD_8x64(_mm512_permutex2var_epi64(a.m_simd, idx, b.m_simd));
287 }

References SIMD_8x64(), and SIMD_8x64().

◆ lanes_eq()

uint8_t BOTAN_FN_ISA_SIMD_8X64 Botan::SIMD_8x64::lanes_eq ( const SIMD_8x64 & other) const
inline

Return a bitmask of the lanes where this == other

Definition at line 300 of file simd_8x64.h.

300 {
301 return _mm512_cmpeq_epi64_mask(m_simd, other.m_simd);
302 }

References SIMD_8x64().

◆ lanes_gt()

uint8_t BOTAN_FN_ISA_SIMD_8X64 Botan::SIMD_8x64::lanes_gt ( const SIMD_8x64 & other) const
inline

Return a bitmask of the lanes where this > other (unsigned)

Definition at line 307 of file simd_8x64.h.

307 {
308 return _mm512_cmpgt_epu64_mask(m_simd, other.m_simd);
309 }

References SIMD_8x64().

◆ load_be() [1/2]

template<size_t Stride>
BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64 Botan::SIMD_8x64::load_be ( const uint8_t *const * ptrs,
size_t i,
size_t n,
size_t offset = 0 )
inlinestatic

Load in big endian order from ptrs[i] + Stride * n + offset, gathering lane i's n'th block out of a set of per lane buffers

Definition at line 68 of file simd_8x64.h.

68 {
69 return load_be(ptrs[i] + Stride * n + offset);
70 }
static BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64 load_be(const void *in)
Definition simd_8x64.h:60

References load_be().

◆ load_be() [2/2]

BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64 Botan::SIMD_8x64::load_be ( const void * in)
inlinestatic

Definition at line 60 of file simd_8x64.h.

60{ return SIMD_8x64::load_le(in).bswap(); }
SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 bswap() const
Definition simd_8x64.h:72
static BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64 load_le(const void *in)
Definition simd_8x64.h:51

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

Referenced by load_be(), and Botan::sha2_64_mb_compress_x8().

◆ load_be4()

BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64 Botan::SIMD_8x64::load_be4 ( const void * in0,
const void * in1,
const void * in2,
const void * in3 )
inlinestatic

Definition at line 44 of file simd_8x64.h.

47 {
48 return SIMD_8x64::load_le4(in0, in1, in2, in3).bswap();
49 }
static BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64 load_le4(const void *in0, const void *in1, const void *in2, const void *in3)
Definition simd_8x64.h:32

References bswap(), load_le4(), and SIMD_8x64().

◆ load_le()

BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64 Botan::SIMD_8x64::load_le ( const void * in)
inlinestatic

Definition at line 51 of file simd_8x64.h.

51 {
52 return SIMD_8x64(_mm512_loadu_si512(reinterpret_cast<const __m512i*>(in)));
53 }

References SIMD_8x64(), and SIMD_8x64().

Referenced by Botan::keccak_mb_absorb_x8(), Botan::keccak_mb_permute_x8(), load_be(), Botan::sha2_64_mb_compress_x8(), and Botan::sha2_64_mb_extract_x8().

◆ load_le4()

BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64 Botan::SIMD_8x64::load_le4 ( const void * in0,
const void * in1,
const void * in2,
const void * in3 )
inlinestatic

Definition at line 32 of file simd_8x64.h.

35 {
36 auto r = _mm512_setzero_si512();
37 r = _mm512_inserti32x4(r, _mm_loadu_si128(reinterpret_cast<const __m128i*>(in0)), 3);
38 r = _mm512_inserti32x4(r, _mm_loadu_si128(reinterpret_cast<const __m128i*>(in1)), 2);
39 r = _mm512_inserti32x4(r, _mm_loadu_si128(reinterpret_cast<const __m128i*>(in2)), 1);
40 r = _mm512_inserti32x4(r, _mm_loadu_si128(reinterpret_cast<const __m128i*>(in3)), 0);
41 return SIMD_8x64(r);
42 }

References SIMD_8x64(), and SIMD_8x64().

Referenced by load_be4().

◆ madd52hi()

SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 Botan::SIMD_8x64::madd52hi ( const SIMD_8x64 & a,
const SIMD_8x64 & b ) const
inline

IFMA: this + high 52 bits of (a * b), using the low 52 bits of each lane of a and b

Definition at line 263 of file simd_8x64.h.

263 {
264 return SIMD_8x64(_mm512_madd52hi_epu64(m_simd, a.m_simd, b.m_simd));
265 }

References SIMD_8x64(), and SIMD_8x64().

◆ madd52lo()

SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 Botan::SIMD_8x64::madd52lo ( const SIMD_8x64 & a,
const SIMD_8x64 & b ) const
inline

IFMA: this + low 52 bits of (a * b), using the low 52 bits of each lane of a and b

Definition at line 256 of file simd_8x64.h.

256 {
257 return SIMD_8x64(_mm512_madd52lo_epu64(m_simd, a.m_simd, b.m_simd));
258 }

References SIMD_8x64(), and SIMD_8x64().

◆ majority()

BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64 Botan::SIMD_8x64::majority ( const SIMD_8x64 & x,
const SIMD_8x64 & y,
const SIMD_8x64 & z )
inlinestatic

Definition at line 180 of file simd_8x64.h.

180 {
181 return SIMD_8x64(_mm512_ternarylogic_epi64(x.raw(), y.raw(), z.raw(), 0xe8));
182 }

References raw(), SIMD_8x64(), and SIMD_8x64().

◆ masked_add()

SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 Botan::SIMD_8x64::masked_add ( uint8_t lanes,
const SIMD_8x64 & a,
const SIMD_8x64 & b )
inlinestatic

Return a + b in the lanes selected by the bitmask, and a elsewhere

Definition at line 314 of file simd_8x64.h.

314 {
315 return SIMD_8x64(_mm512_mask_add_epi64(a.m_simd, lanes, a.m_simd, b.m_simd));
316 }

References SIMD_8x64(), and SIMD_8x64().

◆ masked_madd52hi()

SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 Botan::SIMD_8x64::masked_madd52hi ( uint8_t lanes,
const SIMD_8x64 & a,
const SIMD_8x64 & b ) const
inline

As madd52hi, but only in the lanes selected by the bitmask; the other lanes are unchanged

Definition at line 277 of file simd_8x64.h.

277 {
278 return SIMD_8x64(_mm512_mask_madd52hi_epu64(m_simd, lanes, a.m_simd, b.m_simd));
279 }

References SIMD_8x64(), and SIMD_8x64().

◆ masked_madd52lo()

SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 Botan::SIMD_8x64::masked_madd52lo ( uint8_t lanes,
const SIMD_8x64 & a,
const SIMD_8x64 & b ) const
inline

As madd52lo, but only in the lanes selected by the bitmask; the other lanes are unchanged

Definition at line 270 of file simd_8x64.h.

270 {
271 return SIMD_8x64(_mm512_mask_madd52lo_epu64(m_simd, lanes, a.m_simd, b.m_simd));
272 }

References SIMD_8x64(), and SIMD_8x64().

◆ mul2_32()

BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64 Botan::SIMD_8x64::mul2_32 ( SIMD_8x64 x,
SIMD_8x64 y )
inlinestatic

Definition at line 322 of file simd_8x64.h.

322 {
323 const __m512i m = _mm512_mul_epu32(x.m_simd, y.m_simd);
324 return SIMD_8x64(_mm512_add_epi64(m, m));
325 }

References SIMD_8x64(), and SIMD_8x64().

◆ operator&()

SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 Botan::SIMD_8x64::operator& ( const SIMD_8x64 & other) const
inline

Definition at line 109 of file simd_8x64.h.

109 {
110 SIMD_8x64 retval(*this);
111 retval &= other;
112 return retval;
113 }
SIMD_8x64(const SIMD_8x64 &other)=default

References SIMD_8x64().

◆ operator&=()

BOTAN_FN_ISA_SIMD_8X64 void Botan::SIMD_8x64::operator&= ( const SIMD_8x64 & other)
inline

Definition at line 129 of file simd_8x64.h.

129 {
130 m_simd = _mm512_and_si512(m_simd, other.m_simd);
131 }

References SIMD_8x64().

◆ operator+()

SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 Botan::SIMD_8x64::operator+ ( const SIMD_8x64 & other) const
inline

Definition at line 97 of file simd_8x64.h.

97 {
98 SIMD_8x64 retval(*this);
99 retval += other;
100 return retval;
101 }

References SIMD_8x64().

◆ operator+=()

BOTAN_FN_ISA_SIMD_8X64 void Botan::SIMD_8x64::operator+= ( const SIMD_8x64 & other)
inline

Definition at line 121 of file simd_8x64.h.

121 {
122 m_simd = _mm512_add_epi64(m_simd, other.m_simd);
123 }

References SIMD_8x64().

◆ operator=() [1/2]

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

References SIMD_8x64().

◆ operator=() [2/2]

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

References SIMD_8x64().

◆ operator^()

SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 Botan::SIMD_8x64::operator^ ( const SIMD_8x64 & other) const
inline

Definition at line 103 of file simd_8x64.h.

103 {
104 SIMD_8x64 retval(*this);
105 retval ^= other;
106 return retval;
107 }

References SIMD_8x64().

◆ operator^=()

BOTAN_FN_ISA_SIMD_8X64 void Botan::SIMD_8x64::operator^= ( const SIMD_8x64 & other)
inline

Definition at line 125 of file simd_8x64.h.

125 {
126 m_simd = _mm512_xor_si512(m_simd, other.m_simd);
127 }

References SIMD_8x64().

◆ operator|()

SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 Botan::SIMD_8x64::operator| ( const SIMD_8x64 & other) const
inline

Definition at line 115 of file simd_8x64.h.

115 {
116 SIMD_8x64 retval(*this);
117 retval |= other;
118 return retval;
119 }

References SIMD_8x64().

◆ operator|=()

BOTAN_FN_ISA_SIMD_8X64 void Botan::SIMD_8x64::operator|= ( const SIMD_8x64 & other)
inline

Definition at line 133 of file simd_8x64.h.

133{ m_simd = _mm512_or_si512(m_simd, other.m_simd); }

References SIMD_8x64().

◆ raw()

__m512i BOTAN_FN_ISA_SIMD_8X64 Botan::SIMD_8x64::raw ( ) const
inlinenoexcept

Definition at line 346 of file simd_8x64.h.

346{ return m_simd; }

Referenced by choose(), and majority().

◆ rotl()

template<size_t ROT>
BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64 Botan::SIMD_8x64::rotl ( ) const
inline

Definition at line 156 of file simd_8x64.h.

156 {
157 return this->rotr<64 - ROT>();
158 }
BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64 rotr() const
Definition simd_8x64.h:149

References rotr(), and SIMD_8x64().

◆ rotr()

template<size_t ROT>
requires (ROT > 0 && ROT < 64)
BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64 Botan::SIMD_8x64::rotr ( ) const
inline

Definition at line 149 of file simd_8x64.h.

151 {
152 return SIMD_8x64(_mm512_ror_epi64(m_simd, ROT));
153 }

References SIMD_8x64(), and SIMD_8x64().

Referenced by rotl(), sigma0(), and sigma1().

◆ shl()

template<int SHIFT>
SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 Botan::SIMD_8x64::shl ( ) const
inlinenoexcept

Definition at line 227 of file simd_8x64.h.

227 {
228 return SIMD_8x64(_mm512_slli_epi64(m_simd, SHIFT));
229 }

References SIMD_8x64(), and SIMD_8x64().

◆ shr()

template<int SHIFT>
SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 Botan::SIMD_8x64::shr ( ) const
inlinenoexcept

Definition at line 222 of file simd_8x64.h.

222 {
223 return SIMD_8x64(_mm512_srli_epi64(m_simd, SHIFT));
224 }

References SIMD_8x64(), and SIMD_8x64().

◆ sigma0()

SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 Botan::SIMD_8x64::sigma0 ( ) const
inline

Definition at line 160 of file simd_8x64.h.

160 {
161 const SIMD_8x64 r1 = this->rotr<28>();
162 const SIMD_8x64 r2 = this->rotr<34>();
163 const SIMD_8x64 r3 = this->rotr<39>();
164 return r1 ^ r2 ^ r3;
165 }

References rotr(), and SIMD_8x64().

◆ sigma1()

SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 Botan::SIMD_8x64::sigma1 ( ) const
inline

Definition at line 167 of file simd_8x64.h.

167 {
168 const SIMD_8x64 r1 = this->rotr<14>();
169 const SIMD_8x64 r2 = this->rotr<18>();
170 const SIMD_8x64 r3 = this->rotr<41>();
171 return r1 ^ r2 ^ r3;
172 }

References rotr(), and SIMD_8x64().

◆ splat()

BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64 Botan::SIMD_8x64::splat ( uint64_t v)
inlinestatic

Definition at line 319 of file simd_8x64.h.

319{ return SIMD_8x64(_mm512_set1_epi64(v)); }

References SIMD_8x64(), and SIMD_8x64().

◆ store_be()

BOTAN_FN_ISA_SIMD_8X64 void Botan::SIMD_8x64::store_be ( uint8_t out[]) const
inline

Definition at line 88 of file simd_8x64.h.

88{ bswap().store_le(out); }
void store_le(uint64_t out[8]) const
Definition simd_8x64.h:82

References bswap(), and store_le().

Referenced by Botan::sha2_64_mb_extract_x8().

◆ store_le() [1/2]

void Botan::SIMD_8x64::store_le ( uint64_t out[8]) const
inline

Definition at line 82 of file simd_8x64.h.

82{ this->store_le(reinterpret_cast<uint8_t*>(out)); }

References store_le().

Referenced by Botan::keccak_mb_absorb_x8(), Botan::keccak_mb_permute_x8(), Botan::sha2_64_mb_compress_x8(), store_be(), and store_le().

◆ store_le() [2/2]

BOTAN_FN_ISA_SIMD_8X64 void Botan::SIMD_8x64::store_le ( uint8_t out[]) const
inline

Definition at line 84 of file simd_8x64.h.

84 {
85 _mm512_storeu_si512(reinterpret_cast<__m512i*>(out), m_simd);
86 }

◆ store_le4()

BOTAN_FN_ISA_SIMD_8X64 void Botan::SIMD_8x64::store_le4 ( void * out0,
void * out1,
void * out2,
void * out3 )
inline

Definition at line 90 of file simd_8x64.h.

90 {
91 _mm_storeu_si128(reinterpret_cast<__m128i*>(out0), _mm512_extracti32x4_epi32(m_simd, 3));
92 _mm_storeu_si128(reinterpret_cast<__m128i*>(out1), _mm512_extracti32x4_epi32(m_simd, 2));
93 _mm_storeu_si128(reinterpret_cast<__m128i*>(out2), _mm512_extracti32x4_epi32(m_simd, 1));
94 _mm_storeu_si128(reinterpret_cast<__m128i*>(out3), _mm512_extracti32x4_epi32(m_simd, 0));
95 }

◆ transpose()

BOTAN_FN_ISA_SIMD_8X64 void Botan::SIMD_8x64::transpose ( SIMD_8x64 & B0,
SIMD_8x64 & B1,
SIMD_8x64 & B2,
SIMD_8x64 & B3,
SIMD_8x64 & B4,
SIMD_8x64 & B5,
SIMD_8x64 & B6,
SIMD_8x64 & B7 )
inlinestatic

Definition at line 185 of file simd_8x64.h.

192 {
193 const auto t0 = _mm512_unpacklo_epi64(B0.m_simd, B1.m_simd);
194 const auto t1 = _mm512_unpackhi_epi64(B0.m_simd, B1.m_simd);
195 const auto t2 = _mm512_unpacklo_epi64(B2.m_simd, B3.m_simd);
196 const auto t3 = _mm512_unpackhi_epi64(B2.m_simd, B3.m_simd);
197 const auto t4 = _mm512_unpacklo_epi64(B4.m_simd, B5.m_simd);
198 const auto t5 = _mm512_unpackhi_epi64(B4.m_simd, B5.m_simd);
199 const auto t6 = _mm512_unpacklo_epi64(B6.m_simd, B7.m_simd);
200 const auto t7 = _mm512_unpackhi_epi64(B6.m_simd, B7.m_simd);
201
202 const auto s0 = _mm512_shuffle_i64x2(t0, t2, 0x88);
203 const auto s1 = _mm512_shuffle_i64x2(t1, t3, 0x88);
204 const auto s2 = _mm512_shuffle_i64x2(t0, t2, 0xdd);
205 const auto s3 = _mm512_shuffle_i64x2(t1, t3, 0xdd);
206 const auto s4 = _mm512_shuffle_i64x2(t4, t6, 0x88);
207 const auto s5 = _mm512_shuffle_i64x2(t5, t7, 0x88);
208 const auto s6 = _mm512_shuffle_i64x2(t4, t6, 0xdd);
209 const auto s7 = _mm512_shuffle_i64x2(t5, t7, 0xdd);
210
211 B0.m_simd = _mm512_shuffle_i64x2(s0, s4, 0x88);
212 B1.m_simd = _mm512_shuffle_i64x2(s1, s5, 0x88);
213 B2.m_simd = _mm512_shuffle_i64x2(s2, s6, 0x88);
214 B3.m_simd = _mm512_shuffle_i64x2(s3, s7, 0x88);
215 B4.m_simd = _mm512_shuffle_i64x2(s0, s4, 0xdd);
216 B5.m_simd = _mm512_shuffle_i64x2(s1, s5, 0xdd);
217 B6.m_simd = _mm512_shuffle_i64x2(s2, s6, 0xdd);
218 B7.m_simd = _mm512_shuffle_i64x2(s3, s7, 0xdd);
219 }

References SIMD_8x64().

Referenced by Botan::sha2_64_mb_compress_x8(), and Botan::sha2_64_mb_extract_x8().

◆ twist()

void BOTAN_FN_ISA_SIMD_8X64 Botan::SIMD_8x64::twist ( SIMD_8x64 & B,
SIMD_8x64 & C,
SIMD_8x64 & D )
inlinestatic

Definition at line 328 of file simd_8x64.h.

328 {
329 const auto b_perm = _mm512_set_epi64(4, 7, 6, 5, 0, 3, 2, 1);
330 const auto c_perm = _mm512_set_epi64(5, 4, 7, 6, 1, 0, 3, 2);
331 const auto d_perm = _mm512_set_epi64(6, 5, 4, 7, 2, 1, 0, 3);
332 B = SIMD_8x64(_mm512_permutexvar_epi64(b_perm, B.m_simd));
333 C = SIMD_8x64(_mm512_permutexvar_epi64(c_perm, C.m_simd));
334 D = SIMD_8x64(_mm512_permutexvar_epi64(d_perm, D.m_simd));
335 }

References SIMD_8x64(), and SIMD_8x64().

◆ untwist()

void BOTAN_FN_ISA_SIMD_8X64 Botan::SIMD_8x64::untwist ( SIMD_8x64 & B,
SIMD_8x64 & C,
SIMD_8x64 & D )
inlinestatic

Definition at line 337 of file simd_8x64.h.

337 {
338 const auto b_perm = _mm512_set_epi64(6, 5, 4, 7, 2, 1, 0, 3);
339 const auto c_perm = _mm512_set_epi64(5, 4, 7, 6, 1, 0, 3, 2);
340 const auto d_perm = _mm512_set_epi64(4, 7, 6, 5, 0, 3, 2, 1);
341 B = SIMD_8x64(_mm512_permutexvar_epi64(b_perm, B.m_simd));
342 C = SIMD_8x64(_mm512_permutexvar_epi64(c_perm, C.m_simd));
343 D = SIMD_8x64(_mm512_permutexvar_epi64(d_perm, D.m_simd));
344 }

References SIMD_8x64(), and SIMD_8x64().


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