Botan 3.11.0
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 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(), 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 65 of file simd_2x64.h.

65 :
66#if defined(BOTAN_SIMD_USE_SSSE3)
67 m_simd(_mm_set_epi64x(high, low))
68#elif defined(BOTAN_SIMD_USE_SIMD128)
69 m_simd(wasm_u64x2_make(low, high))
70#endif
71 {
72 }

◆ SIMD_2x64() [5/5]

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

Definition at line 308 of file simd_2x64.h.

308: 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 232 of file simd_2x64.h.

232 {
233#if defined(BOTAN_SIMD_USE_SSSE3)
234 return SIMD_2x64(_mm_alignr_epi8(a.m_simd, b.m_simd, 8));
235#elif defined(BOTAN_SIMD_USE_SIMD128)
236 return SIMD_2x64(
237 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));
238#endif
239 }
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 57 of file simd_2x64.h.

57 {
58#if defined(BOTAN_SIMD_USE_SSSE3)
59 return SIMD_2x64(_mm_set1_epi8(-1));
60#elif defined(BOTAN_SIMD_USE_SIMD128)
61 return SIMD_2x64(wasm_i8x16_splat(0xFF));
62#endif
63 }

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 164 of file simd_2x64.h.

164 {
165#if defined(BOTAN_SIMD_USE_SSSE3)
166 return SIMD_2x64(_mm_andnot_si128(m_simd, other.m_simd));
167#elif defined(BOTAN_SIMD_USE_SIMD128)
168 // SIMD128 is a & ~b
169 return SIMD_2x64(wasm_v128_andnot(other.m_simd, m_simd));
170#endif
171 }

References SIMD_2x64(), and SIMD_2x64().

◆ bswap()

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

Definition at line 92 of file simd_2x64.h.

92 {
93#if defined(BOTAN_SIMD_USE_SSSE3)
94 const auto idx = _mm_set_epi8(8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7);
95 return SIMD_2x64(_mm_shuffle_epi8(m_simd, idx));
96#elif defined(BOTAN_SIMD_USE_SIMD128)
97 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));
98#endif
99 }

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 249 of file simd_2x64.h.

249 {
250#if defined(BOTAN_SIMD_USE_SSSE3)
251 return SIMD_2x64(_mm_unpackhi_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, 1), wasm_u64x2_extract_lane(b.m_simd, 1));
254#endif
255 }

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 241 of file simd_2x64.h.

241 {
242#if defined(BOTAN_SIMD_USE_SSSE3)
243 return SIMD_2x64(_mm_unpacklo_epi64(a.m_simd, b.m_simd));
244#elif defined(BOTAN_SIMD_USE_SIMD128)
245 return SIMD_2x64(wasm_u64x2_extract_lane(a.m_simd, 0), wasm_u64x2_extract_lane(b.m_simd, 0));
246#endif
247 }

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 82 of file simd_2x64.h.

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

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 88 of file simd_2x64.h.

88 {
89 return SIMD_2x64::load_be(in.data());
90 }
static SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 load_be(const void *in)
Definition simd_2x64.h:82

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 74 of file simd_2x64.h.

74 {
75#if defined(BOTAN_SIMD_USE_SSSE3)
76 return SIMD_2x64(_mm_loadu_si128(reinterpret_cast<const __m128i*>(in)));
77#elif defined(BOTAN_SIMD_USE_SIMD128)
78 return SIMD_2x64(wasm_v128_load(in));
79#endif
80 }

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 84 of file simd_2x64.h.

84 {
85 return SIMD_2x64::load_le(in.data());
86 }

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 294 of file simd_2x64.h.

294 {
295#if defined(BOTAN_SIMD_USE_SSSE3)
296 const __m128i m = _mm_mul_epu32(x.m_simd, y.m_simd);
297 return SIMD_2x64(_mm_add_epi64(m, m));
298#elif defined(BOTAN_SIMD_USE_SIMD128)
299 const auto m = wasm_u64x2_extmul_low_u32x4(wasm_i32x4_shuffle(x.m_simd, x.m_simd, 0, 2, 0, 2),
300 wasm_i32x4_shuffle(y.m_simd, y.m_simd, 0, 2, 0, 2));
301
302 return SIMD_2x64(wasm_i64x2_add(m, m));
303#endif
304 }

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 136 of file simd_2x64.h.

136 {
137 SIMD_2x64 retval(*this);
138 retval += other;
139 return retval;
140 }
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 148 of file simd_2x64.h.

148 {
149#if defined(BOTAN_SIMD_USE_SSSE3)
150 m_simd = _mm_add_epi64(m_simd, other.m_simd);
151#elif defined(BOTAN_SIMD_USE_SIMD128)
152 m_simd = wasm_i64x2_add(m_simd, other.m_simd);
153#endif
154 }

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 142 of file simd_2x64.h.

142 {
143 SIMD_2x64 retval(*this);
144 retval ^= other;
145 return retval;
146 }

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_xor_si128(m_simd, other.m_simd);
159#elif defined(BOTAN_SIMD_USE_SIMD128)
160 m_simd = wasm_v128_xor(m_simd, other.m_simd);
161#endif
162 }

References SIMD_2x64().

◆ raw()

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

Definition at line 306 of file simd_2x64.h.

306{ return m_simd; }

◆ reverse_all_bytes()

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

Definition at line 109 of file simd_2x64.h.

109 {
110#if defined(BOTAN_SIMD_USE_SSSE3)
111 const auto idx = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
112 return SIMD_2x64(_mm_shuffle_epi8(m_simd, idx));
113#elif defined(BOTAN_SIMD_USE_SIMD128)
114 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));
115#endif
116 }

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 210 of file simd_2x64.h.

210 {
211 return this->rotr<64 - ROT>();
212 }
BOTAN_FN_ISA_SIMD_2X64 SIMD_2x64 rotr() const
Definition simd_2x64.h:174

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 174 of file simd_2x64.h.

176 {
177#if defined(BOTAN_SIMD_USE_SSSE3)
178 if constexpr(ROT == 8) {
179 auto tab = _mm_setr_epi8(1, 2, 3, 4, 5, 6, 7, 0, 9, 10, 11, 12, 13, 14, 15, 8);
180 return SIMD_2x64(_mm_shuffle_epi8(m_simd, tab));
181 } else if constexpr(ROT == 16) {
182 auto tab = _mm_setr_epi8(2, 3, 4, 5, 6, 7, 0, 1, 10, 11, 12, 13, 14, 15, 8, 9);
183 return SIMD_2x64(_mm_shuffle_epi8(m_simd, tab));
184 } else if constexpr(ROT == 24) {
185 auto tab = _mm_setr_epi8(3, 4, 5, 6, 7, 0, 1, 2, 11, 12, 13, 14, 15, 8, 9, 10);
186 return SIMD_2x64(_mm_shuffle_epi8(m_simd, tab));
187 } else if constexpr(ROT == 32) {
188 auto tab = _mm_setr_epi8(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15, 8, 9, 10, 11);
189 return SIMD_2x64(_mm_shuffle_epi8(m_simd, tab));
190 } else {
191 return SIMD_2x64(_mm_or_si128(_mm_srli_epi64(m_simd, static_cast<int>(ROT)),
192 _mm_slli_epi64(m_simd, static_cast<int>(64 - ROT))));
193 }
194#elif defined(BOTAN_SIMD_USE_SIMD128)
195 if constexpr(ROT == 8) {
196 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));
197 } else if constexpr(ROT == 16) {
198 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));
199 } else if constexpr(ROT == 24) {
200 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));
201 } else if constexpr(ROT == 32) {
202 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));
203 } else {
204 return SIMD_2x64(wasm_v128_or(wasm_u64x2_shr(m_simd, ROT), wasm_i64x2_shl(m_simd, 64 - ROT)));
205 }
206#endif
207 }

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 224 of file simd_2x64.h.

224 {
225#if defined(BOTAN_SIMD_USE_SSSE3)
226 return SIMD_2x64(_mm_slli_epi64(m_simd, SHIFT));
227#elif defined(BOTAN_SIMD_USE_SIMD128)
228 return SIMD_2x64(wasm_i64x2_shl(m_simd, SHIFT));
229#endif
230 }

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 215 of file simd_2x64.h.

215 {
216#if defined(BOTAN_SIMD_USE_SSSE3)
217 return SIMD_2x64(_mm_srli_epi64(m_simd, SHIFT));
218#elif defined(BOTAN_SIMD_USE_SIMD128)
219 return SIMD_2x64(wasm_u64x2_shr(m_simd, SHIFT));
220#endif
221 }

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 132 of file simd_2x64.h.

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

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 128 of file simd_2x64.h.

128{ 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 130 of file simd_2x64.h.

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

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 134 of file simd_2x64.h.

134{ 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 118 of file simd_2x64.h.

118{ 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 120 of file simd_2x64.h.

120 {
121#if defined(BOTAN_SIMD_USE_SSSE3)
122 _mm_storeu_si128(reinterpret_cast<__m128i*>(out), m_simd);
123#elif defined(BOTAN_SIMD_USE_SIMD128)
124 wasm_v128_store(out, m_simd);
125#endif
126 }

◆ swap_lanes()

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

Definition at line 101 of file simd_2x64.h.

101 {
102#if defined(BOTAN_SIMD_USE_SSSE3)
103 return SIMD_2x64(_mm_shuffle_epi32(m_simd, _MM_SHUFFLE(1, 0, 3, 2)));
104#elif defined(BOTAN_SIMD_USE_SIMD128)
105 return SIMD_2x64(wasm_i64x2_shuffle(m_simd, m_simd, 1, 0));
106#endif
107 }

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 259 of file simd_2x64.h.

259 {
260 auto T0 = SIMD_2x64::alignr8(B1, B0);
261 auto T1 = SIMD_2x64::alignr8(B0, B1);
262 B0 = T0;
263 B1 = T1;
264
265 T0 = C0;
266 C0 = C1;
267 C1 = T0;
268
269 T0 = SIMD_2x64::alignr8(D0, D1);
270 T1 = SIMD_2x64::alignr8(D1, D0);
271 D0 = T0;
272 D1 = T1;
273 }
static SIMD_2x64 BOTAN_FN_ISA_SIMD_2X64 alignr8(const SIMD_2x64 &a, const SIMD_2x64 &b)
Definition simd_2x64.h:232

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 277 of file simd_2x64.h.

277 {
278 auto T0 = SIMD_2x64::alignr8(B0, B1);
279 auto T1 = SIMD_2x64::alignr8(B1, B0);
280 B0 = T0;
281 B1 = T1;
282
283 T0 = C0;
284 C0 = C1;
285 C1 = T0;
286
287 T0 = SIMD_2x64::alignr8(D1, D0);
288 T1 = SIMD_2x64::alignr8(D0, D1);
289 D0 = T0;
290 D1 = T1;
291 }

References alignr8(), and SIMD_2x64().


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