Botan 3.11.1
Crypto and TLS for C&
Botan::SIMD_2x64 Class Referencefinal

#include <simd_2x64.h>

Public Member Functions

SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 andc (const SIMD_2x64 &other) const noexcept
SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 bswap () const
SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 operator+ (const SIMD_2x64 &other) const
void BOTAN_FN_ISA_SIMD_2X64 operator+= (const SIMD_2x64 &other)
SIMD_2x64operator= (const SIMD_2x64 &other)=default
SIMD_2x64operator= (SIMD_2x64 &&other)=default
SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 operator^ (const SIMD_2x64 &other) const
void BOTAN_FN_ISA_SIMD_2X64 operator^= (const SIMD_2x64 &other)
native_simd_type BOTAN_FN_ISA_SIMD_2X64 raw () const noexcept
SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 reverse_all_bytes () const
template<size_t ROT>
SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 rotl () const
template<size_t ROT>
requires (ROT > 0 && ROT < 64)
BOTAN_FN_ISA_SIMD_2X64 SIMD_2x64 rotr () const
template<int SHIFT>
SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 shl () const noexcept
template<int SHIFT>
SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 shr () const noexcept
BOTAN_FN_ISA_SIMD_2X64 SIMD_2x64 ()
 SIMD_2x64 (const SIMD_2x64 &other)=default
BOTAN_FN_ISA_SIMD_2X64 SIMD_2x64 (native_simd_type x)
 SIMD_2x64 (SIMD_2x64 &&other)=default
BOTAN_FN_ISA_SIMD_2X64 SIMD_2x64 (uint64_t low, uint64_t high)
void BOTAN_FN_ISA_SIMD_2X64 store_be (std::span< uint8_t, 16 > out) const
void BOTAN_FN_ISA_SIMD_2X64 store_be (uint64_t out[2]) const
void BOTAN_FN_ISA_SIMD_2X64 store_be (uint8_t out[]) const
void BOTAN_FN_ISA_SIMD_2X64 store_le (std::span< uint8_t, 16 > out) const
void BOTAN_FN_ISA_SIMD_2X64 store_le (uint64_t out[2]) const
void BOTAN_FN_ISA_SIMD_2X64 store_le (uint8_t out[]) const
SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 swap_lanes () const
 ~SIMD_2x64 ()=default

Static Public Member Functions

static SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 alignr8 (const SIMD_2x64 &a, const SIMD_2x64 &b)
static SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 all_ones ()
static SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 interleave_high (const SIMD_2x64 &a, const SIMD_2x64 &b)
static SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 interleave_low (const SIMD_2x64 &a, const SIMD_2x64 &b)
static SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 load_be (const void *in)
static SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 load_be (std::span< const uint8_t, 16 > in)
static SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 load_le (const void *in)
static SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 load_le (std::span< const uint8_t, 16 > in)
static SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 mul2_32 (SIMD_2x64 x, SIMD_2x64 y)
static SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 splat (uint64_t v)
static void BOTAN_FN_ISA_SIMD_2X64 twist (SIMD_2x64 &B0, SIMD_2x64 &B1, SIMD_2x64 &C0, SIMD_2x64 &C1, SIMD_2x64 &D0, SIMD_2x64 &D1)
static void BOTAN_FN_ISA_SIMD_2X64 untwist (SIMD_2x64 &B0, SIMD_2x64 &B1, SIMD_2x64 &C0, SIMD_2x64 &C1, SIMD_2x64 &D0, SIMD_2x64 &D1)

Detailed Description

Definition at line 31 of file simd_2x64.h.

Constructor & Destructor Documentation

◆ SIMD_2x64() [1/5]

◆ SIMD_2x64() [2/5]

Botan::SIMD_2x64::SIMD_2x64 ( SIMD_2x64 && other)
default

References SIMD_2x64().

◆ ~SIMD_2x64()

Botan::SIMD_2x64::~SIMD_2x64 ( )
default

◆ SIMD_2x64() [3/5]

BOTAN_FN_ISA_SIMD_2X64 Botan::SIMD_2x64::SIMD_2x64 ( )
inline

Definition at line 48 of file simd_2x64.h.

48 :
49#if defined(BOTAN_SIMD_USE_SSSE3)
50 m_simd(_mm_setzero_si128())
51#elif defined(BOTAN_SIMD_USE_SIMD128)
52 m_simd(wasm_u64x2_const_splat(0))
53#endif
54 {
55 }

Referenced by alignr8(), all_ones(), andc(), bswap(), interleave_high(), interleave_low(), load_le(), mul2_32(), reverse_all_bytes(), rotr(), shl(), shr(), splat(), and swap_lanes().

◆ SIMD_2x64() [4/5]

BOTAN_FN_ISA_SIMD_2X64 Botan::SIMD_2x64::SIMD_2x64 ( uint64_t low,
uint64_t high )
inline

Definition at line 73 of file simd_2x64.h.

73 :
74#if defined(BOTAN_SIMD_USE_SSSE3)
75 m_simd(_mm_set_epi64x(high, low))
76#elif defined(BOTAN_SIMD_USE_SIMD128)
77 m_simd(wasm_u64x2_make(low, high))
78#endif
79 {
80 }

◆ SIMD_2x64() [5/5]

BOTAN_FN_ISA_SIMD_2X64 Botan::SIMD_2x64::SIMD_2x64 ( native_simd_type x)
inlineexplicit

Definition at line 316 of file simd_2x64.h.

316: m_simd(x) {}

Member Function Documentation

◆ alignr8()

SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 Botan::SIMD_2x64::alignr8 ( const SIMD_2x64 & a,
const SIMD_2x64 & b )
inlinestatic

Definition at line 240 of file simd_2x64.h.

240 {
241#if defined(BOTAN_SIMD_USE_SSSE3)
242 return SIMD_2x64(_mm_alignr_epi8(a.m_simd, b.m_simd, 8));
243#elif defined(BOTAN_SIMD_USE_SIMD128)
244 return SIMD_2x64(
245 wasm_i8x16_shuffle(b.m_simd, a.m_simd, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23));
246#endif
247 }
BOTAN_FN_ISA_SIMD_2X64 SIMD_2x64()
Definition simd_2x64.h:48

References SIMD_2x64(), and SIMD_2x64().

Referenced by twist(), and untwist().

◆ all_ones()

SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 Botan::SIMD_2x64::all_ones ( )
inlinestatic

Definition at line 65 of file simd_2x64.h.

65 {
66#if defined(BOTAN_SIMD_USE_SSSE3)
67 return SIMD_2x64(_mm_set1_epi8(-1));
68#elif defined(BOTAN_SIMD_USE_SIMD128)
69 return SIMD_2x64(wasm_i8x16_splat(0xFF));
70#endif
71 }

References SIMD_2x64(), and SIMD_2x64().

◆ andc()

SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 Botan::SIMD_2x64::andc ( const SIMD_2x64 & other) const
inlinenoexcept

Definition at line 172 of file simd_2x64.h.

172 {
173#if defined(BOTAN_SIMD_USE_SSSE3)
174 return SIMD_2x64(_mm_andnot_si128(m_simd, other.m_simd));
175#elif defined(BOTAN_SIMD_USE_SIMD128)
176 // SIMD128 is a & ~b
177 return SIMD_2x64(wasm_v128_andnot(other.m_simd, m_simd));
178#endif
179 }

References SIMD_2x64(), and SIMD_2x64().

◆ bswap()

SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 Botan::SIMD_2x64::bswap ( ) const
inline

Definition at line 100 of file simd_2x64.h.

100 {
101#if defined(BOTAN_SIMD_USE_SSSE3)
102 const auto idx = _mm_set_epi8(8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7);
103 return SIMD_2x64(_mm_shuffle_epi8(m_simd, idx));
104#elif defined(BOTAN_SIMD_USE_SIMD128)
105 return SIMD_2x64(wasm_i8x16_shuffle(m_simd, m_simd, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8));
106#endif
107 }

References SIMD_2x64(), and SIMD_2x64().

Referenced by load_be(), and store_be().

◆ interleave_high()

SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 Botan::SIMD_2x64::interleave_high ( const SIMD_2x64 & a,
const SIMD_2x64 & b )
inlinestatic

Definition at line 257 of file simd_2x64.h.

257 {
258#if defined(BOTAN_SIMD_USE_SSSE3)
259 return SIMD_2x64(_mm_unpackhi_epi64(a.m_simd, b.m_simd));
260#elif defined(BOTAN_SIMD_USE_SIMD128)
261 return SIMD_2x64(wasm_u64x2_extract_lane(a.m_simd, 1), wasm_u64x2_extract_lane(b.m_simd, 1));
262#endif
263 }

References SIMD_2x64(), and SIMD_2x64().

◆ interleave_low()

SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 Botan::SIMD_2x64::interleave_low ( const SIMD_2x64 & a,
const SIMD_2x64 & b )
inlinestatic

Definition at line 249 of file simd_2x64.h.

249 {
250#if defined(BOTAN_SIMD_USE_SSSE3)
251 return SIMD_2x64(_mm_unpacklo_epi64(a.m_simd, b.m_simd));
252#elif defined(BOTAN_SIMD_USE_SIMD128)
253 return SIMD_2x64(wasm_u64x2_extract_lane(a.m_simd, 0), wasm_u64x2_extract_lane(b.m_simd, 0));
254#endif
255 }

References SIMD_2x64(), and SIMD_2x64().

◆ load_be() [1/2]

SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 Botan::SIMD_2x64::load_be ( const void * in)
inlinestatic

Definition at line 90 of file simd_2x64.h.

90{ return SIMD_2x64::load_le(in).bswap(); }
static SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 load_le(const void *in)
Definition simd_2x64.h:82
SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 bswap() const
Definition simd_2x64.h:100

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

Referenced by load_be().

◆ load_be() [2/2]

SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 Botan::SIMD_2x64::load_be ( std::span< const uint8_t, 16 > in)
inlinestatic

Definition at line 96 of file simd_2x64.h.

96 {
97 return SIMD_2x64::load_be(in.data());
98 }
static SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 load_be(const void *in)
Definition simd_2x64.h:90

References load_be(), and SIMD_2x64().

◆ load_le() [1/2]

SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 Botan::SIMD_2x64::load_le ( const void * in)
inlinestatic

Definition at line 82 of file simd_2x64.h.

82 {
83#if defined(BOTAN_SIMD_USE_SSSE3)
84 return SIMD_2x64(_mm_loadu_si128(reinterpret_cast<const __m128i*>(in)));
85#elif defined(BOTAN_SIMD_USE_SIMD128)
86 return SIMD_2x64(wasm_v128_load(in));
87#endif
88 }

References SIMD_2x64(), and SIMD_2x64().

Referenced by load_be(), and load_le().

◆ load_le() [2/2]

SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 Botan::SIMD_2x64::load_le ( std::span< const uint8_t, 16 > in)
inlinestatic

Definition at line 92 of file simd_2x64.h.

92 {
93 return SIMD_2x64::load_le(in.data());
94 }

References load_le(), and SIMD_2x64().

◆ mul2_32()

SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 Botan::SIMD_2x64::mul2_32 ( SIMD_2x64 x,
SIMD_2x64 y )
inlinestatic

Definition at line 302 of file simd_2x64.h.

302 {
303#if defined(BOTAN_SIMD_USE_SSSE3)
304 const __m128i m = _mm_mul_epu32(x.m_simd, y.m_simd);
305 return SIMD_2x64(_mm_add_epi64(m, m));
306#elif defined(BOTAN_SIMD_USE_SIMD128)
307 const auto m = wasm_u64x2_extmul_low_u32x4(wasm_i32x4_shuffle(x.m_simd, x.m_simd, 0, 2, 0, 2),
308 wasm_i32x4_shuffle(y.m_simd, y.m_simd, 0, 2, 0, 2));
309
310 return SIMD_2x64(wasm_i64x2_add(m, m));
311#endif
312 }

References SIMD_2x64(), and SIMD_2x64().

◆ operator+()

SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 Botan::SIMD_2x64::operator+ ( const SIMD_2x64 & other) const
inline

Definition at line 144 of file simd_2x64.h.

144 {
145 SIMD_2x64 retval(*this);
146 retval += other;
147 return retval;
148 }
SIMD_2x64(const SIMD_2x64 &other)=default

References SIMD_2x64().

◆ operator+=()

void BOTAN_FN_ISA_SIMD_2X64 Botan::SIMD_2x64::operator+= ( const SIMD_2x64 & other)
inline

Definition at line 156 of file simd_2x64.h.

156 {
157#if defined(BOTAN_SIMD_USE_SSSE3)
158 m_simd = _mm_add_epi64(m_simd, other.m_simd);
159#elif defined(BOTAN_SIMD_USE_SIMD128)
160 m_simd = wasm_i64x2_add(m_simd, other.m_simd);
161#endif
162 }

References SIMD_2x64().

◆ operator=() [1/2]

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

References SIMD_2x64().

◆ operator=() [2/2]

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

References SIMD_2x64().

◆ operator^()

SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 Botan::SIMD_2x64::operator^ ( const SIMD_2x64 & other) const
inline

Definition at line 150 of file simd_2x64.h.

150 {
151 SIMD_2x64 retval(*this);
152 retval ^= other;
153 return retval;
154 }

References SIMD_2x64().

◆ operator^=()

void BOTAN_FN_ISA_SIMD_2X64 Botan::SIMD_2x64::operator^= ( const SIMD_2x64 & other)
inline

Definition at line 164 of file simd_2x64.h.

164 {
165#if defined(BOTAN_SIMD_USE_SSSE3)
166 m_simd = _mm_xor_si128(m_simd, other.m_simd);
167#elif defined(BOTAN_SIMD_USE_SIMD128)
168 m_simd = wasm_v128_xor(m_simd, other.m_simd);
169#endif
170 }

References SIMD_2x64().

◆ raw()

native_simd_type BOTAN_FN_ISA_SIMD_2X64 Botan::SIMD_2x64::raw ( ) const
inlinenoexcept

Definition at line 314 of file simd_2x64.h.

314{ return m_simd; }

◆ reverse_all_bytes()

SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 Botan::SIMD_2x64::reverse_all_bytes ( ) const
inline

Definition at line 117 of file simd_2x64.h.

117 {
118#if defined(BOTAN_SIMD_USE_SSSE3)
119 const auto idx = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
120 return SIMD_2x64(_mm_shuffle_epi8(m_simd, idx));
121#elif defined(BOTAN_SIMD_USE_SIMD128)
122 return SIMD_2x64(wasm_i8x16_shuffle(m_simd, m_simd, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0));
123#endif
124 }

References SIMD_2x64(), and SIMD_2x64().

◆ rotl()

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

Definition at line 218 of file simd_2x64.h.

218 {
219 return this->rotr<64 - ROT>();
220 }
BOTAN_FN_ISA_SIMD_2X64 SIMD_2x64 rotr() const
Definition simd_2x64.h:182

References rotr(), and SIMD_2x64().

◆ rotr()

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

Definition at line 182 of file simd_2x64.h.

184 {
185#if defined(BOTAN_SIMD_USE_SSSE3)
186 if constexpr(ROT == 8) {
187 auto tab = _mm_setr_epi8(1, 2, 3, 4, 5, 6, 7, 0, 9, 10, 11, 12, 13, 14, 15, 8);
188 return SIMD_2x64(_mm_shuffle_epi8(m_simd, tab));
189 } else if constexpr(ROT == 16) {
190 auto tab = _mm_setr_epi8(2, 3, 4, 5, 6, 7, 0, 1, 10, 11, 12, 13, 14, 15, 8, 9);
191 return SIMD_2x64(_mm_shuffle_epi8(m_simd, tab));
192 } else if constexpr(ROT == 24) {
193 auto tab = _mm_setr_epi8(3, 4, 5, 6, 7, 0, 1, 2, 11, 12, 13, 14, 15, 8, 9, 10);
194 return SIMD_2x64(_mm_shuffle_epi8(m_simd, tab));
195 } else if constexpr(ROT == 32) {
196 auto tab = _mm_setr_epi8(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15, 8, 9, 10, 11);
197 return SIMD_2x64(_mm_shuffle_epi8(m_simd, tab));
198 } else {
199 return SIMD_2x64(_mm_or_si128(_mm_srli_epi64(m_simd, static_cast<int>(ROT)),
200 _mm_slli_epi64(m_simd, static_cast<int>(64 - ROT))));
201 }
202#elif defined(BOTAN_SIMD_USE_SIMD128)
203 if constexpr(ROT == 8) {
204 return SIMD_2x64(wasm_i8x16_shuffle(m_simd, m_simd, 1, 2, 3, 4, 5, 6, 7, 0, 9, 10, 11, 12, 13, 14, 15, 8));
205 } else if constexpr(ROT == 16) {
206 return SIMD_2x64(wasm_i8x16_shuffle(m_simd, m_simd, 2, 3, 4, 5, 6, 7, 0, 1, 10, 11, 12, 13, 14, 15, 8, 9));
207 } else if constexpr(ROT == 24) {
208 return SIMD_2x64(wasm_i8x16_shuffle(m_simd, m_simd, 3, 4, 5, 6, 7, 0, 1, 2, 11, 12, 13, 14, 15, 8, 9, 10));
209 } else if constexpr(ROT == 32) {
210 return SIMD_2x64(wasm_i8x16_shuffle(m_simd, m_simd, 4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15, 8, 9, 10, 11));
211 } else {
212 return SIMD_2x64(wasm_v128_or(wasm_u64x2_shr(m_simd, ROT), wasm_i64x2_shl(m_simd, 64 - ROT)));
213 }
214#endif
215 }

References SIMD_2x64(), and SIMD_2x64().

Referenced by rotl().

◆ shl()

template<int SHIFT>
SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 Botan::SIMD_2x64::shl ( ) const
inlinenoexcept

Definition at line 232 of file simd_2x64.h.

232 {
233#if defined(BOTAN_SIMD_USE_SSSE3)
234 return SIMD_2x64(_mm_slli_epi64(m_simd, SHIFT));
235#elif defined(BOTAN_SIMD_USE_SIMD128)
236 return SIMD_2x64(wasm_i64x2_shl(m_simd, SHIFT));
237#endif
238 }

References SIMD_2x64(), and SIMD_2x64().

◆ shr()

template<int SHIFT>
SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 Botan::SIMD_2x64::shr ( ) const
inlinenoexcept

Definition at line 223 of file simd_2x64.h.

223 {
224#if defined(BOTAN_SIMD_USE_SSSE3)
225 return SIMD_2x64(_mm_srli_epi64(m_simd, SHIFT));
226#elif defined(BOTAN_SIMD_USE_SIMD128)
227 return SIMD_2x64(wasm_u64x2_shr(m_simd, SHIFT));
228#endif
229 }

References SIMD_2x64(), and SIMD_2x64().

◆ splat()

SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 Botan::SIMD_2x64::splat ( uint64_t v)
inlinestatic

Definition at line 57 of file simd_2x64.h.

57 {
58#if defined(BOTAN_SIMD_USE_SSSE3)
59 return SIMD_2x64(_mm_set1_epi64x(v));
60#elif defined(BOTAN_SIMD_USE_SIMD128)
61 return SIMD_2x64(wasm_u64x2_splat(v));
62#endif
63 }

References SIMD_2x64(), and SIMD_2x64().

◆ store_be() [1/3]

void BOTAN_FN_ISA_SIMD_2X64 Botan::SIMD_2x64::store_be ( std::span< uint8_t, 16 > out) const
inline

Definition at line 140 of file simd_2x64.h.

140{ this->store_be(out.data()); }
void BOTAN_FN_ISA_SIMD_2X64 store_be(uint64_t out[2]) const
Definition simd_2x64.h:136

References store_be().

Referenced by store_be().

◆ store_be() [2/3]

void BOTAN_FN_ISA_SIMD_2X64 Botan::SIMD_2x64::store_be ( uint64_t out[2]) const
inline

Definition at line 136 of file simd_2x64.h.

136{ this->store_be(reinterpret_cast<uint8_t*>(out)); }

References store_be().

Referenced by store_be().

◆ store_be() [3/3]

void BOTAN_FN_ISA_SIMD_2X64 Botan::SIMD_2x64::store_be ( uint8_t out[]) const
inline

Definition at line 138 of file simd_2x64.h.

138{ bswap().store_le(out); }
void BOTAN_FN_ISA_SIMD_2X64 store_le(uint64_t out[2]) const
Definition simd_2x64.h:126

References bswap(), and store_le().

◆ store_le() [1/3]

void BOTAN_FN_ISA_SIMD_2X64 Botan::SIMD_2x64::store_le ( std::span< uint8_t, 16 > out) const
inline

Definition at line 142 of file simd_2x64.h.

142{ this->store_le(out.data()); }

References store_le().

Referenced by store_le().

◆ store_le() [2/3]

void BOTAN_FN_ISA_SIMD_2X64 Botan::SIMD_2x64::store_le ( uint64_t out[2]) const
inline

Definition at line 126 of file simd_2x64.h.

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

References store_le().

Referenced by store_be(), and store_le().

◆ store_le() [3/3]

void BOTAN_FN_ISA_SIMD_2X64 Botan::SIMD_2x64::store_le ( uint8_t out[]) const
inline

Definition at line 128 of file simd_2x64.h.

128 {
129#if defined(BOTAN_SIMD_USE_SSSE3)
130 _mm_storeu_si128(reinterpret_cast<__m128i*>(out), m_simd);
131#elif defined(BOTAN_SIMD_USE_SIMD128)
132 wasm_v128_store(out, m_simd);
133#endif
134 }

◆ swap_lanes()

SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 Botan::SIMD_2x64::swap_lanes ( ) const
inline

Definition at line 109 of file simd_2x64.h.

109 {
110#if defined(BOTAN_SIMD_USE_SSSE3)
111 return SIMD_2x64(_mm_shuffle_epi32(m_simd, _MM_SHUFFLE(1, 0, 3, 2)));
112#elif defined(BOTAN_SIMD_USE_SIMD128)
113 return SIMD_2x64(wasm_i64x2_shuffle(m_simd, m_simd, 1, 0));
114#endif
115 }

References SIMD_2x64(), and SIMD_2x64().

◆ twist()

void BOTAN_FN_ISA_SIMD_2X64 Botan::SIMD_2x64::twist ( SIMD_2x64 & B0,
SIMD_2x64 & B1,
SIMD_2x64 & C0,
SIMD_2x64 & C1,
SIMD_2x64 & D0,
SIMD_2x64 & D1 )
inlinestatic

Definition at line 267 of file simd_2x64.h.

267 {
268 auto T0 = SIMD_2x64::alignr8(B1, B0);
269 auto T1 = SIMD_2x64::alignr8(B0, B1);
270 B0 = T0;
271 B1 = T1;
272
273 T0 = C0;
274 C0 = C1;
275 C1 = T0;
276
277 T0 = SIMD_2x64::alignr8(D0, D1);
278 T1 = SIMD_2x64::alignr8(D1, D0);
279 D0 = T0;
280 D1 = T1;
281 }
static SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 alignr8(const SIMD_2x64 &a, const SIMD_2x64 &b)
Definition simd_2x64.h:240

References alignr8(), and SIMD_2x64().

◆ untwist()

void BOTAN_FN_ISA_SIMD_2X64 Botan::SIMD_2x64::untwist ( SIMD_2x64 & B0,
SIMD_2x64 & B1,
SIMD_2x64 & C0,
SIMD_2x64 & C1,
SIMD_2x64 & D0,
SIMD_2x64 & D1 )
inlinestatic

Definition at line 285 of file simd_2x64.h.

285 {
286 auto T0 = SIMD_2x64::alignr8(B0, B1);
287 auto T1 = SIMD_2x64::alignr8(B1, B0);
288 B0 = T0;
289 B1 = T1;
290
291 T0 = C0;
292 C0 = C1;
293 C1 = T0;
294
295 T0 = SIMD_2x64::alignr8(D1, D0);
296 T1 = SIMD_2x64::alignr8(D0, D1);
297 D0 = T0;
298 D1 = T1;
299 }

References alignr8(), and SIMD_2x64().


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