Botan 3.9.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 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

Definition at line 29 of file simd_8x64.h.

29: 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 121 of file simd_8x64.h.

121: 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 117 of file simd_8x64.h.

117 {
118 return SIMD_8x64(_mm512_alignr_epi8(a.m_simd, b.m_simd, 8));
119 }
BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64()
Definition simd_8x64.h:29

References SIMD_8x64(), and SIMD_8x64().

◆ bswap()

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

Definition at line 57 of file simd_8x64.h.

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

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

55{ return SIMD_8x64::load_le(in).bswap(); }
SIMD_8x64 BOTAN_FN_ISA_SIMD_8X64 bswap() const
Definition simd_8x64.h:57
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().

◆ 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 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 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().

◆ operator+()

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

Definition at line 80 of file simd_8x64.h.

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

92 {
93 m_simd = _mm512_add_epi64(m_simd, other.m_simd);
94 }

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

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

References SIMD_8x64().

◆ operator^=()

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

Definition at line 96 of file simd_8x64.h.

96 {
97 m_simd = _mm512_xor_si512(m_simd, other.m_simd);
98 }

References SIMD_8x64().

◆ rotl()

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

Definition at line 108 of file simd_8x64.h.

108 {
109 return this->rotr<64 - ROT>();
110 }
BOTAN_FN_ISA_SIMD_8X64 SIMD_8x64 rotr() const
Definition simd_8x64.h:101

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

103 {
104 return SIMD_8x64(_mm512_ror_epi64(m_simd, ROT));
105 }

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

113 {
114 return SIMD_8x64(_mm512_srli_epi64(m_simd, SHIFT));
115 }

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

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

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

69 {
70 _mm512_storeu_si512(reinterpret_cast<__m512i*>(out), m_simd);
71 }

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

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

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