#include "src/core/SkChecksum.h"
#include <cstring>
Go to the source code of this file.
|
static void | _wymum (uint64_t *A, uint64_t *B) |
|
static uint64_t | _wymix (uint64_t A, uint64_t B) |
|
static uint64_t | _wyr8 (const uint8_t *p) |
|
static uint64_t | _wyr4 (const uint8_t *p) |
|
static uint64_t | _wyr3 (const uint8_t *p, size_t k) |
|
static uint64_t | wyhash (const void *key, size_t len, uint64_t seed, const uint64_t *secret) |
|
uint32_t | SkChecksum::Hash32 (const void *data, size_t bytes, uint32_t seed) |
|
uint64_t | SkChecksum::Hash64 (const void *data, size_t bytes, uint64_t seed) |
|
|
static const uint64_t | _wyp [4] |
|
◆ _likely_
#define _likely_ |
( |
|
x | ) |
(x) |
◆ _unlikely_
#define _unlikely_ |
( |
|
x | ) |
(x) |
◆ _wymix()
static uint64_t _wymix |
( |
uint64_t |
A, |
|
|
uint64_t |
B |
|
) |
| |
|
inlinestatic |
Definition at line 44 of file SkChecksum.cpp.
44 {
47}
static void _wymum(uint64_t *A, uint64_t *B)
◆ _wymum()
static void _wymum |
( |
uint64_t * |
A, |
|
|
uint64_t * |
B |
|
) |
| |
|
inlinestatic |
Definition at line 23 of file SkChecksum.cpp.
23 {
24#if defined(__SIZEOF_INT128__)
28 *
B = (uint64_t)(r >> 64);
29#elif defined(_MSC_VER) && defined(_M_X64)
30 *
A = _umul128(*
A, *
B,
B);
31#else
32 uint64_t ha = *
A >> 32, hb = *
B >> 32, la = (uint32_t)*
A, lb = (uint32_t)*
B, hi, lo;
33 uint64_t rh = ha * hb, rm0 = ha * lb, rm1 = hb * la, rl = la * lb, t = rl + (rm0 << 32),
34 c = t < rl;
35 lo = t + (rm1 << 32);
36 c += lo < t;
37 hi = rh + (rm0 >> 32) + (rm1 >> 32) + c;
40#endif
41}
◆ _wyr3()
static uint64_t _wyr3 |
( |
const uint8_t * |
p, |
|
|
size_t |
k |
|
) |
| |
|
inlinestatic |
Definition at line 62 of file SkChecksum.cpp.
62 {
63 return (((uint64_t)
p[0]) << 16) | (((uint64_t)
p[k >> 1]) << 8) |
p[k - 1];
64}
◆ _wyr4()
static uint64_t _wyr4 |
( |
const uint8_t * |
p | ) |
|
|
inlinestatic |
Definition at line 56 of file SkChecksum.cpp.
56 {
57 uint32_t v;
59 return v;
60}
◆ _wyr8()
static uint64_t _wyr8 |
( |
const uint8_t * |
p | ) |
|
|
inlinestatic |
Definition at line 50 of file SkChecksum.cpp.
50 {
51 uint64_t v;
53 return v;
54}
◆ wyhash()
static uint64_t wyhash |
( |
const void * |
key, |
|
|
size_t |
len, |
|
|
uint64_t |
seed, |
|
|
const uint64_t * |
secret |
|
) |
| |
|
inlinestatic |
Definition at line 67 of file SkChecksum.cpp.
67 {
68 const uint8_t*
p = (
const uint8_t*)
key;
69 seed ^=
_wymix(seed ^ secret[0], secret[1]);
78 } else
80 } else {
83 uint64_t see1 = seed, see2 = seed;
84 do {
91 seed ^= see1 ^ see2;
92 }
97 }
100 }
105}
static uint64_t _wyr4(const uint8_t *p)
static uint64_t _wyr3(const uint8_t *p, size_t k)
static uint64_t _wymix(uint64_t A, uint64_t B)
static uint64_t _wyr8(const uint8_t *p)
◆ _wyp
Initial value:= {
0xa0761d6478bd642full, 0xe7037ed1a0b428dbull, 0x8ebc6af09c88c6e3ull, 0x589965cc75374cc3ull}
Definition at line 108 of file SkChecksum.cpp.