LLVM 19.0.0git
Functions | Variables
xxhash.cpp File Reference
#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.

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)
 

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
 

Function Documentation

◆ mergeRound()

static uint64_t mergeRound ( uint64_t  Acc,
uint64_t  Val 
)
static

Definition at line 71 of file xxhash.cpp.

References PRIME64_1, PRIME64_4, and round().

Referenced by llvm::xxHash64().

◆ rotl64()

static uint64_t rotl64 ( uint64_t  X,
size_t  R 
)
static

Definition at line 50 of file xxhash.cpp.

References X.

Referenced by round(), XXH3_len_4to8_64b(), and llvm::xxHash64().

◆ round()

static uint64_t round ( uint64_t  Acc,
uint64_t  Input 
)
static

◆ XXH3_accumulate_512_scalar()

static LLVM_ATTRIBUTE_ALWAYS_INLINE void XXH3_accumulate_512_scalar ( uint64_t acc,
const uint8_t *  input,
const uint8_t *  secret 
)
static

Definition at line 324 of file xxhash.cpp.

References llvm::support::endian::read64le(), and XXH_ACC_NB.

Referenced by XXH3_accumulate_scalar(), and XXH3_hashLong_64b().

◆ XXH3_accumulate_scalar()

static LLVM_ATTRIBUTE_ALWAYS_INLINE void XXH3_accumulate_scalar ( uint64_t acc,
const uint8_t *  input,
const uint8_t *  secret,
size_t  nbStripes 
)
static

Definition at line 335 of file xxhash.cpp.

References XXH3_accumulate_512_scalar(), XXH_SECRET_CONSUME_RATE, and XXH_STRIPE_LEN.

Referenced by XXH3_hashLong_64b().

◆ XXH3_avalanche()

static uint64_t XXH3_avalanche ( uint64_t  hash)
static

Definition at line 202 of file xxhash.cpp.

References PRIME_MX1.

Referenced by XXH3_len_129to240_64b(), XXH3_len_17to128_64b(), XXH3_len_9to16_64b(), and XXH3_mergeAccs().

◆ XXH3_hashLong_64b()

static LLVM_ATTRIBUTE_NOINLINE uint64_t XXH3_hashLong_64b ( const uint8_t *  input,
size_t  len,
const uint8_t *  secret,
size_t  secretSize 
)
static

◆ XXH3_len_0to16_64b()

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

◆ XXH3_len_129to240_64b()

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

Definition at line 302 of file xxhash.cpp.

References PRIME64_1, XXH3_avalanche(), XXH3_mix16B(), and XXH3_SECRETSIZE_MIN.

Referenced by llvm::xxh3_64bits().

◆ XXH3_len_17to128_64b()

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

Definition at line 278 of file xxhash.cpp.

References PRIME64_1, XXH3_avalanche(), and XXH3_mix16B().

Referenced by llvm::xxh3_64bits().

◆ XXH3_len_1to3_64b()

static uint64_t XXH3_len_1to3_64b ( const uint8_t *  input,
size_t  len,
const uint8_t *  secret,
uint64_t  seed 
)
static

Definition at line 209 of file xxhash.cpp.

References llvm::support::endian::read32le(), and XXH64_avalanche().

Referenced by XXH3_len_0to16_64b().

◆ XXH3_len_4to8_64b()

static uint64_t XXH3_len_4to8_64b ( const uint8_t *  input,
size_t  len,
const uint8_t *  secret,
uint64_t  seed 
)
static

◆ XXH3_len_9to16_64b()

static uint64_t XXH3_len_9to16_64b ( const uint8_t *  input,
size_t  len,
const uint8_t *  secret,
uint64_t const  seed 
)
static

◆ XXH3_mergeAccs()

static uint64_t XXH3_mergeAccs ( const uint64_t acc,
const uint8_t *  key,
uint64_t  start 
)
static

Definition at line 355 of file xxhash.cpp.

References XXH3_avalanche(), and XXH3_mix2Accs().

Referenced by XXH3_hashLong_64b().

◆ XXH3_mix16B()

static uint64_t XXH3_mix16B ( const uint8_t *  input,
uint8_t const secret,
uint64_t  seed 
)
static

◆ XXH3_mix2Accs()

static uint64_t XXH3_mix2Accs ( const uint64_t acc,
const uint8_t *  secret 
)
static

Definition at line 350 of file xxhash.cpp.

References llvm::support::endian::read64le(), and XXH3_mul128_fold64().

Referenced by XXH3_mergeAccs().

◆ XXH3_mul128_fold64()

static uint64_t XXH3_mul128_fold64 ( uint64_t  lhs,
uint64_t  rhs 
)
static

Definition at line 176 of file xxhash.cpp.

Referenced by XXH3_len_9to16_64b(), XXH3_mix16B(), and XXH3_mix2Accs().

◆ XXH3_scrambleAcc()

static void XXH3_scrambleAcc ( uint64_t acc,
const uint8_t *  secret 
)
static

Definition at line 342 of file xxhash.cpp.

References PRIME32_1, llvm::support::endian::read64le(), and XXH_ACC_NB.

Referenced by XXH3_hashLong_64b().

◆ XXH64_avalanche()

static uint64_t XXH64_avalanche ( uint64_t  hash)
static

Definition at line 78 of file xxhash.cpp.

References PRIME64_2, and PRIME64_3.

Referenced by XXH3_len_0to16_64b(), XXH3_len_1to3_64b(), and llvm::xxHash64().

Variable Documentation

◆ kSecret

constexpr uint8_t kSecret[XXH_SECRET_DEFAULT_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0x95, 0x16, 0x04, 0x28, 0xaf, 0xd7, 0xfb, 0xca, 0xbb, 0x4b, 0x40, 0x7e,
}

Definition at line 156 of file xxhash.cpp.

Referenced by llvm::xxh3_64bits().

◆ PRIME32_1

constexpr uint32_t PRIME32_1 = 0x9E3779B1
constexpr

Definition at line 54 of file xxhash.cpp.

Referenced by XXH3_hashLong_64b(), and XXH3_scrambleAcc().

◆ PRIME32_2

constexpr uint32_t PRIME32_2 = 0x85EBCA77
constexpr

Definition at line 55 of file xxhash.cpp.

Referenced by XXH3_hashLong_64b().

◆ PRIME32_3

constexpr uint32_t PRIME32_3 = 0xC2B2AE3D
constexpr

Definition at line 56 of file xxhash.cpp.

Referenced by XXH3_hashLong_64b().

◆ PRIME64_1

const uint64_t PRIME64_1 = 11400714785074694791ULL
static

◆ PRIME64_2

const uint64_t PRIME64_2 = 14029467366897019727ULL
static

Definition at line 59 of file xxhash.cpp.

Referenced by round(), XXH3_hashLong_64b(), XXH64_avalanche(), and llvm::xxHash64().

◆ PRIME64_3

const uint64_t PRIME64_3 = 1609587929392839161ULL
static

Definition at line 60 of file xxhash.cpp.

Referenced by XXH3_hashLong_64b(), XXH64_avalanche(), and llvm::xxHash64().

◆ PRIME64_4

const uint64_t PRIME64_4 = 9650029242287828579ULL
static

Definition at line 61 of file xxhash.cpp.

Referenced by mergeRound(), XXH3_hashLong_64b(), and llvm::xxHash64().

◆ PRIME64_5

const uint64_t PRIME64_5 = 2870177450012600261ULL
static

Definition at line 62 of file xxhash.cpp.

Referenced by XXH3_hashLong_64b(), and llvm::xxHash64().

◆ PRIME_MX1

constexpr uint64_t PRIME_MX1 = 0x165667919E3779F9
constexpr

Definition at line 172 of file xxhash.cpp.

Referenced by XXH3_avalanche().

◆ PRIME_MX2

constexpr uint64_t PRIME_MX2 = 0x9FB21C651E98DF25
constexpr

Definition at line 173 of file xxhash.cpp.

Referenced by XXH3_len_4to8_64b().

◆ XXH3_MIDSIZE_MAX

constexpr size_t XXH3_MIDSIZE_MAX = 240
constexpr

Definition at line 299 of file xxhash.cpp.

Referenced by llvm::xxh3_64bits().

◆ XXH3_SECRETSIZE_MIN

constexpr size_t XXH3_SECRETSIZE_MIN = 136
constexpr

Definition at line 151 of file xxhash.cpp.

Referenced by XXH3_len_129to240_64b().

◆ XXH_ACC_NB

constexpr size_t XXH_ACC_NB = XXH_STRIPE_LEN / sizeof(uint64_t)
constexpr

Definition at line 200 of file xxhash.cpp.

Referenced by XXH3_accumulate_512_scalar(), XXH3_hashLong_64b(), and XXH3_scrambleAcc().

◆ XXH_SECRET_CONSUME_RATE

constexpr size_t XXH_SECRET_CONSUME_RATE = 8
constexpr

Definition at line 199 of file xxhash.cpp.

Referenced by XXH3_accumulate_scalar(), and XXH3_hashLong_64b().

◆ XXH_SECRET_DEFAULT_SIZE

constexpr size_t XXH_SECRET_DEFAULT_SIZE = 192
constexpr

Definition at line 152 of file xxhash.cpp.

◆ XXH_STRIPE_LEN

constexpr size_t XXH_STRIPE_LEN = 64
constexpr

Definition at line 198 of file xxhash.cpp.

Referenced by XXH3_accumulate_scalar(), and XXH3_hashLong_64b().