mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-03-03 07:29:23 +00:00
Add missing Intel SSE2 intrinsics needed for Argon2
This commit is contained in:
parent
42aafc847e
commit
2e4b40042a
4 changed files with 50 additions and 2 deletions
|
@ -218,6 +218,54 @@ struct thatispacked mayalias __usi128ma {
|
|||
#define _mm_cmpunord_sd(M128D_0, M128D_1) \
|
||||
__builtin_ia32_cmpunordsd((__v2df)(M128D_0), (__v2df)(M128D_1))
|
||||
|
||||
#define _mm_mul_epu32(A, B) \
|
||||
({ \
|
||||
__m128i R = A; \
|
||||
asm("pmuludq %1, %0" \
|
||||
: "+x"(R) : "xm"(B)); \
|
||||
R; \
|
||||
})
|
||||
|
||||
#define _mm_add_epi64(A, B) \
|
||||
({ \
|
||||
__m128i R = A; \
|
||||
asm("paddq %1, %0" \
|
||||
: "+x"(R) : "xm"(B)); \
|
||||
R; \
|
||||
})
|
||||
|
||||
#define _mm_srli_epi64(A, B) \
|
||||
({ \
|
||||
__m128i R = A; \
|
||||
asm("psrlq %1, %0" \
|
||||
: "+x"(R) : "xm"(B)); \
|
||||
R; \
|
||||
})
|
||||
|
||||
#define _mm_slli_epi64(A, B) \
|
||||
({ \
|
||||
__m128i R = A; \
|
||||
asm("psllq %1, %0" \
|
||||
: "+x"(R) : "xm"(B)); \
|
||||
R; \
|
||||
})
|
||||
|
||||
#define _mm_unpacklo_epi64(A, B) \
|
||||
({ \
|
||||
__m128i R = A; \
|
||||
asm("punpcklqdq %1, %0" \
|
||||
: "+x"(R) : "xm"(B)); \
|
||||
R; \
|
||||
})
|
||||
|
||||
#define _mm_unpackhi_epi64(A, B) \
|
||||
({ \
|
||||
__m128i R = A; \
|
||||
asm("punpckhqdq %1, %0" \
|
||||
: "+x"(R) : "xm"(B)); \
|
||||
R; \
|
||||
})
|
||||
|
||||
/*───────────────────────────────────────────────────────────────────────────│─╗
|
||||
│ cosmopolitan § it's a trap! » sse2 » miscellaneous ─╬─│┼
|
||||
╚────────────────────────────────────────────────────────────────────────────│*/
|
||||
|
|
1
third_party/argon2/argon2.mk
vendored
1
third_party/argon2/argon2.mk
vendored
|
@ -19,6 +19,7 @@ THIRD_PARTY_ARGON2_A_DIRECTDEPS = \
|
|||
LIBC_CALLS \
|
||||
LIBC_FMT \
|
||||
LIBC_INTRIN \
|
||||
LIBC_BITS \
|
||||
LIBC_NEXGEN32E \
|
||||
LIBC_MEM \
|
||||
LIBC_SYSV \
|
||||
|
|
2
third_party/argon2/blake2-impl.h
vendored
2
third_party/argon2/blake2-impl.h
vendored
|
@ -151,6 +151,4 @@ static BLAKE2_INLINE uint64_t rotr64(const uint64_t w, const unsigned c) {
|
|||
return (w >> c) | (w << (64 - c));
|
||||
}
|
||||
|
||||
void clear_internal_memory(void *v, size_t n);
|
||||
|
||||
#endif
|
||||
|
|
1
third_party/argon2/blake2b.c
vendored
1
third_party/argon2/blake2b.c
vendored
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include "third_party/argon2/blake2.h"
|
||||
#include "third_party/argon2/blake2-impl.h"
|
||||
#include "third_party/argon2/core.h" // for clear_internal_memory
|
||||
|
||||
static const uint64_t blake2b_IV[8] = {
|
||||
UINT64_C(0x6a09e667f3bcc908), UINT64_C(0xbb67ae8584caa73b),
|
||||
|
|
Loading…
Add table
Reference in a new issue