10#elif defined(__GNUC__)
13#error "Unimplemented!"
17#define MAYBE_UNUSED(x) (void)((x))
25 __asm__ __volatile__(
"xgetbv\n" :
"=a"(eax),
"=d"(edx) :
"c"(0));
32 __cpuid((
int *)out,
id);
33#elif defined(__i386__) || defined(_M_IX86)
34 __asm__ __volatile__(
"movl %%ebx, %1\n"
37 :
"=a"(out[0]),
"=r"(out[1]),
"=c"(out[2]),
"=d"(out[3])
40 __asm__ __volatile__(
"cpuid\n"
41 :
"=a"(out[0]),
"=b"(out[1]),
"=c"(out[2]),
"=d"(out[3])
48 __cpuidex((
int *)out,
id, sid);
49#elif defined(__i386__) || defined(_M_IX86)
50 __asm__ __volatile__(
"movl %%ebx, %1\n"
53 :
"=a"(out[0]),
"=r"(out[1]),
"=c"(out[2]),
"=d"(out[3])
56 __asm__ __volatile__(
"cpuid\n"
57 :
"=a"(out[0]),
"=b"(out[1]),
"=c"(out[2]),
"=d"(out[3])
76#if !defined(BLAKE3_TESTING)
82#if !defined(BLAKE3_TESTING)
93 uint32_t *eax = ®s[0], *ebx = ®s[1], *ecx = ®s[2], *edx = ®s[3];
97 const int max_id = *eax;
99#if defined(__amd64__) || defined(_M_X64)
102 if (*edx & (1UL << 26))
105 if (*ecx & (1UL << 0))
107 if (*ecx & (1UL << 19))
110 if (*ecx & (1UL << 27)) {
112 if ((mask & 6) == 6) {
113 if (*ecx & (1UL << 28))
117 if (*ebx & (1UL << 5))
119 if ((mask & 224) == 224) {
120 if (*ebx & (1UL << 31))
122 if (*ebx & (1UL << 16))
139 uint8_t block_len,
uint64_t counter,
144#if !defined(BLAKE3_NO_AVX512)
150#if !defined(BLAKE3_NO_SSE41)
151 if (features &
SSE41) {
156#if !defined(BLAKE3_NO_SSE2)
157 if (features &
SSE2) {
168 uint8_t block_len,
uint64_t counter, uint8_t flags,
173#if !defined(BLAKE3_NO_AVX512)
179#if !defined(BLAKE3_NO_SSE41)
180 if (features &
SSE41) {
185#if !defined(BLAKE3_NO_SSE2)
186 if (features &
SSE2) {
197 bool increment_counter, uint8_t flags,
198 uint8_t flags_start, uint8_t flags_end, uint8_t *out) {
202#if !defined(BLAKE3_NO_AVX512)
205 increment_counter, flags, flags_start, flags_end,
210#if !defined(BLAKE3_NO_AVX2)
211 if (features &
AVX2) {
213 increment_counter, flags, flags_start, flags_end,
218#if !defined(BLAKE3_NO_SSE41)
219 if (features &
SSE41) {
221 increment_counter, flags, flags_start, flags_end,
226#if !defined(BLAKE3_NO_SSE2)
227 if (features &
SSE2) {
229 increment_counter, flags, flags_start, flags_end,
236#if BLAKE3_USE_NEON == 1
238 increment_counter, flags, flags_start, flags_end, out);
243 increment_counter, flags, flags_start, flags_end,
252#if !defined(BLAKE3_NO_AVX512)
257#if !defined(BLAKE3_NO_AVX2)
258 if (features &
AVX2) {
262#if !defined(BLAKE3_NO_SSE41)
263 if (features &
SSE41) {
267#if !defined(BLAKE3_NO_SSE2)
268 if (features &
SSE2) {
273#if BLAKE3_USE_NEON == 1
bbsections Prepares for basic block by splitting functions into clusters of basic blocks
#define LLVM_ATTRIBUTE_USED
unify loop Fixup each natural loop to have a single exit block
size_t blake3_simd_degree(void)
static enum cpu_feature g_cpu_features
static LLVM_ATTRIBUTE_USED enum cpu_feature get_cpu_features(void)
#define blake3_compress_in_place_sse41
#define blake3_hash_many_neon
#define blake3_hash_many_avx512
#define blake3_hash_many_avx2
#define blake3_compress_xof_sse2
#define blake3_hash_many_sse41
#define blake3_compress_xof
#define blake3_compress_xof_sse41
#define blake3_compress_in_place_sse2
#define blake3_compress_in_place
#define blake3_compress_xof_avx512
#define blake3_compress_xof_portable
#define blake3_hash_many_portable
#define blake3_hash_many_sse2
#define blake3_compress_in_place_portable
#define blake3_compress_in_place_avx512