LLVM 20.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 | LLVM_XXH_USE_NEON 0 |
#define | XXH3_accumulate_512 XXH3_accumulate_512_scalar |
#define | XXH3_scrambleAcc XXH3_scrambleAcc_scalar |
#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)) |
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 |
#define LLVM_XXH_USE_NEON 0 |
Definition at line 55 of file xxhash.cpp.
#define XXH3_accumulate_512 XXH3_accumulate_512_scalar |
Definition at line 474 of file xxhash.cpp.
#define XXH3_scrambleAcc XXH3_scrambleAcc_scalar |
Definition at line 475 of file xxhash.cpp.
Definition at line 609 of file xxhash.cpp.
#define XXH_rotl32 | ( | x, | |
r | |||
) | (((x) << (r)) | ((x) >> (32 - (r)))) |
Definition at line 605 of file xxhash.cpp.
#define XXH_rotl64 | ( | x, | |
r | |||
) | (((x) << (r)) | ((x) >> (64 - (r)))) |
Definition at line 606 of file xxhash.cpp.
Definition at line 87 of file xxhash.cpp.
References PRIME64_1, PRIME64_4, and round().
Referenced by llvm::xxHash64().
Definition at line 66 of file xxhash.cpp.
References X.
Referenced by round(), XXH3_len_4to8_64b(), and llvm::xxHash64().
Definition at line 80 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 900 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 499 of file xxhash.cpp.
References XXH3_accumulate_512, XXH_SECRET_CONSUME_RATE, and XXH_STRIPE_LEN.
Referenced by XXH3_hashLong_128b(), and XXH3_hashLong_64b().
|
static |
Definition at line 478 of file xxhash.cpp.
References llvm::support::endian::read64le(), and XXH_ACC_NB.
Definition at line 218 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 984 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(), XXH3_accumulate_512, XXH3_mergeAccs(), XXH3_scrambleAcc, XXH_ACC_NB, XXH_SECRET_CONSUME_RATE, and XXH_STRIPE_LEN.
Referenced by llvm::xxh3_128bits().
|
static |
Definition at line 521 of file xxhash.cpp.
References assert(), PRIME32_1, PRIME32_2, PRIME32_3, PRIME64_1, PRIME64_2, PRIME64_3, PRIME64_4, PRIME64_5, XXH3_accumulate(), XXH3_accumulate_512, XXH3_mergeAccs(), XXH3_scrambleAcc, XXH_ACC_NB, XXH_SECRET_CONSUME_RATE, and XXH_STRIPE_LEN.
Referenced by llvm::xxh3_64bits().
|
static |
Definition at line 878 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 269 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 939 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 320 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 910 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 294 of file xxhash.cpp.
References PRIME64_1, XXH3_avalanche(), and XXH3_mix16B().
Referenced by llvm::xxh3_64bits().
|
static |
Definition at line 750 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 225 of file xxhash.cpp.
References llvm::support::endian::read32le(), and XXH64_avalanche().
Referenced by XXH3_len_0to16_64b().
|
static |
Definition at line 777 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 238 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 802 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 255 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 512 of file xxhash.cpp.
References XXH3_avalanche(), and XXH3_mix2Accs().
Referenced by XXH3_hashLong_128b(), and XXH3_hashLong_64b().
Definition at line 281 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 507 of file xxhash.cpp.
References llvm::support::endian::read64le(), and XXH3_mul128_fold64().
Referenced by XXH3_mergeAccs().
Definition at line 192 of file xxhash.cpp.
Referenced by XXH3_len_9to16_64b(), XXH3_mix16B(), and XXH3_mix2Accs().
|
static |
Definition at line 489 of file xxhash.cpp.
References PRIME32_1, llvm::support::endian::read64le(), and XXH_ACC_NB.
Definition at line 94 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 620 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 744 of file xxhash.cpp.
Referenced by XXH3_len_4to8_128b().
|
constexpr |
Definition at line 172 of file xxhash.cpp.
Referenced by llvm::xxh3_128bits(), and llvm::xxh3_64bits().
|
constexpr |
Definition at line 70 of file xxhash.cpp.
Referenced by XXH3_hashLong_128b(), XXH3_hashLong_64b(), and XXH3_scrambleAcc_scalar().
|
constexpr |
Definition at line 71 of file xxhash.cpp.
Referenced by XXH3_hashLong_128b(), XXH3_hashLong_64b(), and XXH3_len_9to16_128b().
|
constexpr |
Definition at line 72 of file xxhash.cpp.
Referenced by XXH3_hashLong_128b(), and XXH3_hashLong_64b().
Definition at line 74 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 75 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 76 of file xxhash.cpp.
Referenced by XXH3_hashLong_128b(), XXH3_hashLong_64b(), XXH64_avalanche(), and llvm::xxHash64().
Definition at line 77 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 78 of file xxhash.cpp.
Referenced by XXH3_hashLong_128b(), XXH3_hashLong_64b(), and llvm::xxHash64().
|
constexpr |
Definition at line 188 of file xxhash.cpp.
Referenced by XXH3_avalanche().
|
constexpr |
Definition at line 189 of file xxhash.cpp.
Referenced by XXH3_len_4to8_128b(), and XXH3_len_4to8_64b().
|
constexpr |
Definition at line 317 of file xxhash.cpp.
Referenced by XXH3_len_129to240_128b(), and XXH3_len_129to240_64b().
|
constexpr |
Definition at line 315 of file xxhash.cpp.
Referenced by llvm::xxh3_128bits(), and llvm::xxh3_64bits().
|
constexpr |
Definition at line 316 of file xxhash.cpp.
Referenced by XXH3_len_129to240_128b(), and XXH3_len_129to240_64b().
|
constexpr |
Definition at line 167 of file xxhash.cpp.
Referenced by XXH3_len_129to240_128b(), and XXH3_len_129to240_64b().
|
constexpr |
Definition at line 216 of file xxhash.cpp.
Referenced by XXH3_accumulate_512_scalar(), XXH3_hashLong_128b(), XXH3_hashLong_64b(), and XXH3_scrambleAcc_scalar().
|
constexpr |
Definition at line 215 of file xxhash.cpp.
Referenced by XXH3_accumulate(), XXH3_hashLong_128b(), and XXH3_hashLong_64b().
|
constexpr |
Definition at line 168 of file xxhash.cpp.
|
constexpr |
Definition at line 214 of file xxhash.cpp.
Referenced by XXH3_accumulate(), XXH3_hashLong_128b(), and XXH3_hashLong_64b().