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

#include <simd_8x64.h>

Public Member Functions

SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 bswap () const
SIMD_8x64 operator+ (const SIMD_8x64 &other) const
BOTAN_FN_ISA_SIMD_8X64 void operator+= (const SIMD_8x64 &other)
SIMD_8x64operator= (const SIMD_8x64 &other)=default
SIMD_8x64operator= (SIMD_8x64 &&other)=default
SIMD_8x64 operator^ (const SIMD_8x64 &other) const
BOTAN_FN_ISA_SIMD_8X64 void operator^= (const SIMD_8x64 &other)
template<size_t ROT>
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 shr () const noexcept
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
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

static SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 alignr8 (const SIMD_8x64 &a, const SIMD_8x64 &b)
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)

Detailed Description

Definition at line 20 of file simd_8x64.h.

Constructor & Destructor Documentation

◆ SIMD_8x64() [1/4]

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

◆ 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

Definition at line 31 of file simd_8x64.h.

31: m_simd(_mm512_setzero_si512()) {}

Referenced by alignr8(), bswap(), load_le(), load_le4(), rotr(), and shr().

◆ SIMD_8x64() [4/4]

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

Definition at line 123 of file simd_8x64.h.

123: m_simd(x) {}

Member Function Documentation

◆ alignr8()

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

Definition at line 119 of file simd_8x64.h.

119 {
120 return SIMD_8x64(_mm512_alignr_epi8(a.m_simd, b.m_simd, 8));
121 }
BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64()
Definition simd_8x64.h:31

References SIMD_8x64(), and SIMD_8x64().

◆ bswap()

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

Definition at line 59 of file simd_8x64.h.

59 {
60 // clang-format off
61 const auto idx = _mm512_set_epi8(
62 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,
63 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);
64 // clang-format on
65
66 return SIMD_8x64(_mm512_shuffle_epi8(m_simd, idx));
67 }

References SIMD_8x64(), and SIMD_8x64().

Referenced by load_be(), and load_be4().

◆ load_be()

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

Definition at line 57 of file simd_8x64.h.

57{ return SIMD_8x64::load_le(in).bswap(); }
SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 bswap() const
Definition simd_8x64.h:59
static BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64 load_le(const void *in)
Definition simd_8x64.h:53

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

◆ 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 46 of file simd_8x64.h.

49 {
50 return SIMD_8x64::load_le4(in0, in1, in2, in3).bswap();
51 }
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:34

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 53 of file simd_8x64.h.

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

References SIMD_8x64(), and SIMD_8x64().

Referenced by load_be().

◆ 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 34 of file simd_8x64.h.

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

References SIMD_8x64(), and SIMD_8x64().

Referenced by load_be4().

◆ operator+()

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

Definition at line 82 of file simd_8x64.h.

82 {
83 SIMD_8x64 retval(*this);
84 retval += other;
85 return retval;
86 }
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 94 of file simd_8x64.h.

94 {
95 m_simd = _mm512_add_epi64(m_simd, other.m_simd);
96 }

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::SIMD_8x64::operator^ ( const SIMD_8x64 & other) const
inline

Definition at line 88 of file simd_8x64.h.

88 {
89 SIMD_8x64 retval(*this);
90 retval ^= other;
91 return retval;
92 }

References SIMD_8x64().

◆ operator^=()

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

Definition at line 98 of file simd_8x64.h.

98 {
99 m_simd = _mm512_xor_si512(m_simd, other.m_simd);
100 }

References SIMD_8x64().

◆ rotl()

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

Definition at line 110 of file simd_8x64.h.

110 {
111 return this->rotr<64 - ROT>();
112 }
BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64 rotr() const
Definition simd_8x64.h:103

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 103 of file simd_8x64.h.

105 {
106 return SIMD_8x64(_mm512_ror_epi64(m_simd, ROT));
107 }

References SIMD_8x64(), and SIMD_8x64().

Referenced by rotl().

◆ shr()

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

Definition at line 115 of file simd_8x64.h.

115 {
116 return SIMD_8x64(_mm512_srli_epi64(m_simd, SHIFT));
117 }

References SIMD_8x64(), and SIMD_8x64().

◆ store_le() [1/2]

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

Definition at line 69 of file simd_8x64.h.

69{ this->store_le(reinterpret_cast<uint8_t*>(out)); }
void store_le(uint64_t out[8]) const
Definition simd_8x64.h:69

References store_le().

Referenced by 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 71 of file simd_8x64.h.

71 {
72 _mm512_storeu_si512(reinterpret_cast<__m512i*>(out), m_simd);
73 }

◆ 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 75 of file simd_8x64.h.

75 {
76 _mm_storeu_si128(reinterpret_cast<__m128i*>(out0), _mm512_extracti32x4_epi32(m_simd, 3));
77 _mm_storeu_si128(reinterpret_cast<__m128i*>(out1), _mm512_extracti32x4_epi32(m_simd, 2));
78 _mm_storeu_si128(reinterpret_cast<__m128i*>(out2), _mm512_extracti32x4_epi32(m_simd, 1));
79 _mm_storeu_si128(reinterpret_cast<__m128i*>(out3), _mm512_extracti32x4_epi32(m_simd, 0));
80 }

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