LLVM: lib/Support/BLAKE3/blake3_dispatch.c File Reference (original) (raw)

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include "[blake3_impl.h](blake3%5F%5Fimpl%5F8h%5Fsource.html)"

Go to the source code of this file.

Macros
#define BLAKE3_ATOMICS 0
#define ATOMIC_INT int
#define ATOMIC_LOAD(x)
#define ATOMIC_STORE(x, y)
#define MAYBE_UNUSED(x)
Enumerations
enum cpu_feature { SSE2 = 1 << 0 , SSSE3 = 1 << 1 , SSE41 = 1 << 2 , AVX = 1 << 3 , AVX2 = 1 << 4 , AVX512F = 1 << 5 , AVX512VL = 1 << 6 , UNDEFINED = 1 << 30 }
Functions
static LLVM_ATTRIBUTE_USED enum cpu_feature get_cpu_features (void)
void blake3_compress_in_place (uint32_t cv[8], const uint8_t block[BLAKE3_BLOCK_LEN], uint8_t block_len, uint64_t counter, uint8_t flags)
void blake3_compress_xof (const uint32_t cv[8], const uint8_t block[BLAKE3_BLOCK_LEN], uint8_t block_len, uint64_t counter, uint8_t flags, uint8_t out[64])
void blake3_xof_many (const uint32_t cv[8], const uint8_t block[BLAKE3_BLOCK_LEN], uint8_t block_len, uint64_t counter, uint8_t flags, uint8_t out[64], size_t outblocks)
void blake3_hash_many (const uint8_t *const *inputs, size_t num_inputs, size_t blocks, const uint32_t key[8], uint64_t counter, bool increment_counter, uint8_t flags, uint8_t flags_start, uint8_t flags_end, uint8_t *out)
size_t blake3_simd_degree (void)
Variables
static ATOMIC_INT g_cpu_features = UNDEFINED

ATOMIC_INT

ATOMIC_LOAD

ATOMIC_STORE

#define ATOMIC_STORE ( x,
y )

BLAKE3_ATOMICS

MAYBE_UNUSED

#define MAYBE_UNUSED ( x )

cpu_feature

Enumerator
SSE2
SSSE3
SSE41
AVX
AVX2
AVX512F
AVX512VL
UNDEFINED

Definition at line 94 of file blake3_dispatch.c.

blake3_compress_in_place()

Definition at line 169 of file blake3_dispatch.c.

References AVX512VL, BLAKE3_BLOCK_LEN, blake3_compress_in_place_avx512, blake3_compress_in_place_portable, blake3_compress_in_place_sse2, blake3_compress_in_place_sse41, block, get_cpu_features(), MAYBE_UNUSED, SSE2, and SSE41.

blake3_compress_xof()

Definition at line 198 of file blake3_dispatch.c.

References AVX512VL, BLAKE3_BLOCK_LEN, blake3_compress_xof_avx512, blake3_compress_xof_portable, blake3_compress_xof_sse2, blake3_compress_xof_sse41, block, get_cpu_features(), MAYBE_UNUSED, SSE2, and SSE41.

blake3_hash_many()

Definition at line 251 of file blake3_dispatch.c.

References AVX2, AVX512F, AVX512VL, blake3_hash_many_avx2, blake3_hash_many_avx512, blake3_hash_many_neon, blake3_hash_many_portable, blake3_hash_many_sse2, blake3_hash_many_sse41, blocks, get_cpu_features(), MAYBE_UNUSED, SSE2, and SSE41.

blake3_simd_degree()

size_t blake3_simd_degree ( void )

blake3_xof_many()

get_cpu_features()

Definition at line 116 of file blake3_dispatch.c.

References ATOMIC_LOAD, ATOMIC_STORE, AVX, AVX2, AVX512F, AVX512VL, g_cpu_features, mask(), SSE2, SSE41, SSSE3, and UNDEFINED.

Referenced by blake3_compress_in_place(), blake3_compress_xof(), blake3_hash_many(), blake3_simd_degree(), and blake3_xof_many().

g_cpu_features

ATOMIC_INT g_cpu_features = UNDEFINED static