LLVM 19.0.0git
|
#include "llvm/Support/xxhash.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Endian.h"
#include <stdlib.h>
Go to the source code of this file.
Macros | |
#define | XXH_rotl32(x, r) (((x) << (r)) | ((x) >> (32 - (r)))) |
#define | XXH_rotl64(x, r) (((x) << (r)) | ((x) >> (64 - (r)))) |
#define | XXH_mult32to64(x, y) ((uint64_t)(uint32_t)(x) * (uint64_t)(uint32_t)(y)) |
Functions | |
static uint64_t | rotl64 (uint64_t X, size_t R) |
static uint64_t | round (uint64_t Acc, uint64_t Input) |
static uint64_t | mergeRound (uint64_t Acc, uint64_t Val) |
static uint64_t | XXH64_avalanche (uint64_t hash) |
static uint64_t | XXH3_mul128_fold64 (uint64_t lhs, uint64_t rhs) |
static uint64_t | XXH3_avalanche (uint64_t hash) |
static uint64_t | XXH3_len_1to3_64b (const uint8_t *input, size_t len, const uint8_t *secret, uint64_t seed) |
static uint64_t | XXH3_len_4to8_64b (const uint8_t *input, size_t len, const uint8_t *secret, uint64_t seed) |
static uint64_t | XXH3_len_9to16_64b (const uint8_t *input, size_t len, const uint8_t *secret, uint64_t const seed) |
static LLVM_ATTRIBUTE_ALWAYS_INLINE uint64_t | XXH3_len_0to16_64b (const uint8_t *input, size_t len, const uint8_t *secret, uint64_t const seed) |
static uint64_t | XXH3_mix16B (const uint8_t *input, uint8_t const *secret, uint64_t seed) |
static LLVM_ATTRIBUTE_ALWAYS_INLINE uint64_t | XXH3_len_17to128_64b (const uint8_t *input, size_t len, const uint8_t *secret, uint64_t const seed) |
static LLVM_ATTRIBUTE_NOINLINE uint64_t | XXH3_len_129to240_64b (const uint8_t *input, size_t len, const uint8_t *secret, uint64_t seed) |
static LLVM_ATTRIBUTE_ALWAYS_INLINE void | XXH3_accumulate_512_scalar (uint64_t *acc, const uint8_t *input, const uint8_t *secret) |
static LLVM_ATTRIBUTE_ALWAYS_INLINE void | XXH3_accumulate_scalar (uint64_t *acc, const uint8_t *input, const uint8_t *secret, size_t nbStripes) |
static void | XXH3_scrambleAcc (uint64_t *acc, const uint8_t *secret) |
static uint64_t | XXH3_mix2Accs (const uint64_t *acc, const uint8_t *secret) |
static uint64_t | XXH3_mergeAccs (const uint64_t *acc, const uint8_t *key, uint64_t start) |
static LLVM_ATTRIBUTE_NOINLINE uint64_t | XXH3_hashLong_64b (const uint8_t *input, size_t len, const uint8_t *secret, size_t secretSize) |
static XXH128_hash_t | XXH_mult64to128 (uint64_t lhs, uint64_t rhs) |
Calculates a 64->128-bit long multiply. | |
LLVM_ATTRIBUTE_ALWAYS_INLINE constexpr uint64_t | XXH_xorshift64 (uint64_t v64, int shift) |
Seems to produce slightly better code on GCC for some reason. | |
static LLVM_ATTRIBUTE_ALWAYS_INLINE XXH128_hash_t | XXH3_len_1to3_128b (const uint8_t *input, size_t len, const uint8_t *secret, uint64_t seed) |
static LLVM_ATTRIBUTE_ALWAYS_INLINE XXH128_hash_t | XXH3_len_4to8_128b (const uint8_t *input, size_t len, const uint8_t *secret, uint64_t seed) |
static LLVM_ATTRIBUTE_ALWAYS_INLINE XXH128_hash_t | XXH3_len_9to16_128b (const uint8_t *input, size_t len, const uint8_t *secret, uint64_t seed) |
static LLVM_ATTRIBUTE_ALWAYS_INLINE XXH128_hash_t | XXH3_len_0to16_128b (const uint8_t *input, size_t len, const uint8_t *secret, uint64_t seed) |
static LLVM_ATTRIBUTE_ALWAYS_INLINE XXH128_hash_t | XXH128_mix32B (XXH128_hash_t acc, const uint8_t *input_1, const uint8_t *input_2, const uint8_t *secret, uint64_t seed) |
static LLVM_ATTRIBUTE_ALWAYS_INLINE XXH128_hash_t | XXH3_len_17to128_128b (const uint8_t *input, size_t len, const uint8_t *secret, size_t secretSize, uint64_t seed) |
static LLVM_ATTRIBUTE_NOINLINE XXH128_hash_t | XXH3_len_129to240_128b (const uint8_t *input, size_t len, const uint8_t *secret, size_t secretSize, uint64_t seed) |
LLVM_ATTRIBUTE_ALWAYS_INLINE XXH128_hash_t | XXH3_hashLong_128b (const uint8_t *input, size_t len, const uint8_t *secret, size_t secretSize) |
Variables | |
constexpr uint32_t | PRIME32_1 = 0x9E3779B1 |
constexpr uint32_t | PRIME32_2 = 0x85EBCA77 |
constexpr uint32_t | PRIME32_3 = 0xC2B2AE3D |
static const uint64_t | PRIME64_1 = 11400714785074694791ULL |
static const uint64_t | PRIME64_2 = 14029467366897019727ULL |
static const uint64_t | PRIME64_3 = 1609587929392839161ULL |
static const uint64_t | PRIME64_4 = 9650029242287828579ULL |
static const uint64_t | PRIME64_5 = 2870177450012600261ULL |
constexpr size_t | XXH3_SECRETSIZE_MIN = 136 |
constexpr size_t | XXH_SECRET_DEFAULT_SIZE = 192 |
constexpr uint8_t | kSecret [XXH_SECRET_DEFAULT_SIZE] |
constexpr uint64_t | PRIME_MX1 = 0x165667919E3779F9 |
constexpr uint64_t | PRIME_MX2 = 0x9FB21C651E98DF25 |
constexpr size_t | XXH_STRIPE_LEN = 64 |
constexpr size_t | XXH_SECRET_CONSUME_RATE = 8 |
constexpr size_t | XXH_ACC_NB = XXH_STRIPE_LEN / sizeof(uint64_t) |
constexpr size_t | XXH3_MIDSIZE_MAX = 240 |
constexpr size_t | XXH3_MIDSIZE_STARTOFFSET = 3 |
constexpr size_t | XXH3_MIDSIZE_LASTOFFSET = 17 |
Definition at line 456 of file xxhash.cpp.
#define XXH_rotl32 | ( | x, | |
r | |||
) | (((x) << (r)) | ((x) >> (32 - (r)))) |
Definition at line 452 of file xxhash.cpp.
#define XXH_rotl64 | ( | x, | |
r | |||
) | (((x) << (r)) | ((x) >> (64 - (r)))) |
Definition at line 453 of file xxhash.cpp.
Definition at line 74 of file xxhash.cpp.
References PRIME64_1, PRIME64_4, and round().
Referenced by llvm::xxHash64().
Definition at line 53 of file xxhash.cpp.
References X.
Referenced by round(), XXH3_len_4to8_64b(), and llvm::xxHash64().
Definition at line 67 of file xxhash.cpp.
References PRIME64_1, PRIME64_2, and rotl64().
Referenced by llvm::sampleprof::DefaultFunctionPruningStrategy::Erase(), llvm::getHeatColor(), mergeRound(), round_fn(), llvm::APInt::sqrt(), and llvm::xxHash64().
|
static |
Definition at line 747 of file xxhash.cpp.
References llvm::XXH128_hash_t::high64, llvm::XXH128_hash_t::low64, llvm::support::endian::read64le(), and XXH3_mix16B().
Referenced by XXH3_len_129to240_128b(), and XXH3_len_17to128_128b().
|
static |
Definition at line 327 of file xxhash.cpp.
References llvm::support::endian::read64le(), and XXH_ACC_NB.
Referenced by XXH3_accumulate_scalar(), XXH3_hashLong_128b(), and XXH3_hashLong_64b().
|
static |
Definition at line 338 of file xxhash.cpp.
References XXH3_accumulate_512_scalar(), XXH_SECRET_CONSUME_RATE, and XXH_STRIPE_LEN.
Referenced by XXH3_hashLong_128b(), and XXH3_hashLong_64b().
Definition at line 205 of file xxhash.cpp.
References PRIME_MX1.
Referenced by XXH3_len_129to240_128b(), XXH3_len_129to240_64b(), XXH3_len_17to128_128b(), XXH3_len_17to128_64b(), XXH3_len_4to8_128b(), XXH3_len_9to16_128b(), XXH3_len_9to16_64b(), and XXH3_mergeAccs().
LLVM_ATTRIBUTE_ALWAYS_INLINE XXH128_hash_t XXH3_hashLong_128b | ( | const uint8_t * | input, |
size_t | len, | ||
const uint8_t * | secret, | ||
size_t | secretSize | ||
) |
Definition at line 831 of file xxhash.cpp.
References assert(), llvm::XXH128_hash_t::high64, llvm::XXH128_hash_t::low64, PRIME32_1, PRIME32_2, PRIME32_3, PRIME64_1, PRIME64_2, PRIME64_3, PRIME64_4, PRIME64_5, XXH3_accumulate_512_scalar(), XXH3_accumulate_scalar(), XXH3_mergeAccs(), XXH3_scrambleAcc(), XXH_ACC_NB, XXH_SECRET_CONSUME_RATE, and XXH_STRIPE_LEN.
Referenced by llvm::xxh3_128bits().
|
static |
Definition at line 367 of file xxhash.cpp.
References assert(), PRIME32_1, PRIME32_2, PRIME32_3, PRIME64_1, PRIME64_2, PRIME64_3, PRIME64_4, PRIME64_5, XXH3_accumulate_512_scalar(), XXH3_accumulate_scalar(), XXH3_mergeAccs(), XXH3_scrambleAcc(), XXH_ACC_NB, XXH_SECRET_CONSUME_RATE, and XXH_STRIPE_LEN.
Referenced by llvm::xxh3_64bits().
|
static |
Definition at line 725 of file xxhash.cpp.
References llvm::XXH128_hash_t::high64, llvm::XXH128_hash_t::low64, llvm::support::endian::read64le(), XXH3_len_1to3_128b(), XXH3_len_4to8_128b(), XXH3_len_9to16_128b(), and XXH64_avalanche().
Referenced by llvm::xxh3_128bits().
|
static |
Definition at line 256 of file xxhash.cpp.
References LLVM_LIKELY, llvm::support::endian::read64le(), XXH3_len_1to3_64b(), XXH3_len_4to8_64b(), XXH3_len_9to16_64b(), and XXH64_avalanche().
Referenced by llvm::xxh3_64bits().
|
static |
Definition at line 786 of file xxhash.cpp.
References llvm::XXH128_hash_t::high64, llvm::XXH128_hash_t::low64, PRIME64_1, PRIME64_2, PRIME64_4, XXH128_mix32B(), XXH3_avalanche(), XXH3_MIDSIZE_LASTOFFSET, XXH3_MIDSIZE_STARTOFFSET, and XXH3_SECRETSIZE_MIN.
Referenced by llvm::xxh3_128bits().
|
static |
Definition at line 307 of file xxhash.cpp.
References PRIME64_1, XXH3_avalanche(), XXH3_MIDSIZE_LASTOFFSET, XXH3_MIDSIZE_STARTOFFSET, XXH3_mix16B(), and XXH3_SECRETSIZE_MIN.
Referenced by llvm::xxh3_64bits().
|
static |
Definition at line 757 of file xxhash.cpp.
References llvm::XXH128_hash_t::high64, llvm::XXH128_hash_t::low64, PRIME64_1, PRIME64_2, PRIME64_4, XXH128_mix32B(), and XXH3_avalanche().
Referenced by llvm::xxh3_128bits().
|
static |
Definition at line 281 of file xxhash.cpp.
References PRIME64_1, XXH3_avalanche(), and XXH3_mix16B().
Referenced by llvm::xxh3_64bits().
|
static |
Definition at line 597 of file xxhash.cpp.
References llvm::byteswap(), llvm::XXH128_hash_t::high64, llvm::XXH128_hash_t::low64, llvm::support::endian::read32le(), XXH64_avalanche(), and XXH_rotl32.
Referenced by XXH3_len_0to16_128b().
|
static |
Definition at line 212 of file xxhash.cpp.
References llvm::support::endian::read32le(), and XXH64_avalanche().
Referenced by XXH3_len_0to16_64b().
|
static |
Definition at line 624 of file xxhash.cpp.
References llvm::byteswap(), llvm::XXH128_hash_t::high64, llvm::XXH128_hash_t::low64, PRIME64_1, PRIME_MX2, llvm::support::endian::read32le(), llvm::support::endian::read64le(), XXH3_avalanche(), XXH_mult64to128(), and XXH_xorshift64().
Referenced by XXH3_len_0to16_128b().
|
static |
Definition at line 225 of file xxhash.cpp.
References llvm::byteswap(), PRIME_MX2, llvm::support::endian::read32le(), llvm::support::endian::read64le(), and rotl64().
Referenced by XXH3_len_0to16_64b().
|
static |
Definition at line 649 of file xxhash.cpp.
References llvm::byteswap(), llvm::XXH128_hash_t::high64, llvm::XXH128_hash_t::low64, PRIME32_2, PRIME64_1, PRIME64_2, llvm::support::endian::read64le(), XXH3_avalanche(), XXH_mult32to64, and XXH_mult64to128().
Referenced by XXH3_len_0to16_128b().
|
static |
Definition at line 242 of file xxhash.cpp.
References llvm::byteswap(), llvm::support::endian::read64le(), XXH3_avalanche(), and XXH3_mul128_fold64().
Referenced by XXH3_len_0to16_64b().
Definition at line 358 of file xxhash.cpp.
References XXH3_avalanche(), and XXH3_mix2Accs().
Referenced by XXH3_hashLong_128b(), and XXH3_hashLong_64b().
Definition at line 268 of file xxhash.cpp.
References llvm::support::endian::read64le(), and XXH3_mul128_fold64().
Referenced by XXH128_mix32B(), XXH3_len_129to240_64b(), and XXH3_len_17to128_64b().
Definition at line 353 of file xxhash.cpp.
References llvm::support::endian::read64le(), and XXH3_mul128_fold64().
Referenced by XXH3_mergeAccs().
Definition at line 179 of file xxhash.cpp.
Referenced by XXH3_len_9to16_64b(), XXH3_mix16B(), and XXH3_mix2Accs().
Definition at line 345 of file xxhash.cpp.
References PRIME32_1, llvm::support::endian::read64le(), and XXH_ACC_NB.
Referenced by XXH3_hashLong_128b(), and XXH3_hashLong_64b().
Definition at line 81 of file xxhash.cpp.
References PRIME64_2, and PRIME64_3.
Referenced by XXH3_len_0to16_128b(), XXH3_len_0to16_64b(), XXH3_len_1to3_128b(), XXH3_len_1to3_64b(), and llvm::xxHash64().
|
static |
Calculates a 64->128-bit long multiply.
Uses __uint128_t
and _umul128
if available, otherwise uses a scalar version.
lhs,rhs | The 64-bit integers to be multiplied |
Definition at line 467 of file xxhash.cpp.
References llvm::XXH128_hash_t::high64, llvm::XXH128_hash_t::low64, and XXH_mult32to64.
Referenced by XXH3_len_4to8_128b(), and XXH3_len_9to16_128b().
|
constexpr |
Seems to produce slightly better code on GCC for some reason.
Definition at line 591 of file xxhash.cpp.
Referenced by XXH3_len_4to8_128b().
|
constexpr |
Definition at line 159 of file xxhash.cpp.
Referenced by llvm::xxh3_128bits(), and llvm::xxh3_64bits().
|
constexpr |
Definition at line 57 of file xxhash.cpp.
Referenced by XXH3_hashLong_128b(), XXH3_hashLong_64b(), and XXH3_scrambleAcc().
|
constexpr |
Definition at line 58 of file xxhash.cpp.
Referenced by XXH3_hashLong_128b(), XXH3_hashLong_64b(), and XXH3_len_9to16_128b().
|
constexpr |
Definition at line 59 of file xxhash.cpp.
Referenced by XXH3_hashLong_128b(), and XXH3_hashLong_64b().
Definition at line 61 of file xxhash.cpp.
Referenced by mergeRound(), round(), XXH3_hashLong_128b(), XXH3_hashLong_64b(), XXH3_len_129to240_128b(), XXH3_len_129to240_64b(), XXH3_len_17to128_128b(), XXH3_len_17to128_64b(), XXH3_len_4to8_128b(), XXH3_len_9to16_128b(), and llvm::xxHash64().
Definition at line 62 of file xxhash.cpp.
Referenced by round(), XXH3_hashLong_128b(), XXH3_hashLong_64b(), XXH3_len_129to240_128b(), XXH3_len_17to128_128b(), XXH3_len_9to16_128b(), XXH64_avalanche(), and llvm::xxHash64().
Definition at line 63 of file xxhash.cpp.
Referenced by XXH3_hashLong_128b(), XXH3_hashLong_64b(), XXH64_avalanche(), and llvm::xxHash64().
Definition at line 64 of file xxhash.cpp.
Referenced by mergeRound(), XXH3_hashLong_128b(), XXH3_hashLong_64b(), XXH3_len_129to240_128b(), XXH3_len_17to128_128b(), and llvm::xxHash64().
Definition at line 65 of file xxhash.cpp.
Referenced by XXH3_hashLong_128b(), XXH3_hashLong_64b(), and llvm::xxHash64().
|
constexpr |
Definition at line 175 of file xxhash.cpp.
Referenced by XXH3_avalanche().
|
constexpr |
Definition at line 176 of file xxhash.cpp.
Referenced by XXH3_len_4to8_128b(), and XXH3_len_4to8_64b().
|
constexpr |
Definition at line 304 of file xxhash.cpp.
Referenced by XXH3_len_129to240_128b(), and XXH3_len_129to240_64b().
|
constexpr |
Definition at line 302 of file xxhash.cpp.
Referenced by llvm::xxh3_128bits(), and llvm::xxh3_64bits().
|
constexpr |
Definition at line 303 of file xxhash.cpp.
Referenced by XXH3_len_129to240_128b(), and XXH3_len_129to240_64b().
|
constexpr |
Definition at line 154 of file xxhash.cpp.
Referenced by XXH3_len_129to240_128b(), and XXH3_len_129to240_64b().
|
constexpr |
Definition at line 203 of file xxhash.cpp.
Referenced by XXH3_accumulate_512_scalar(), XXH3_hashLong_128b(), XXH3_hashLong_64b(), and XXH3_scrambleAcc().
|
constexpr |
Definition at line 202 of file xxhash.cpp.
Referenced by XXH3_accumulate_scalar(), XXH3_hashLong_128b(), and XXH3_hashLong_64b().
|
constexpr |
Definition at line 155 of file xxhash.cpp.
|
constexpr |
Definition at line 201 of file xxhash.cpp.
Referenced by XXH3_accumulate_scalar(), XXH3_hashLong_128b(), and XXH3_hashLong_64b().