mirror of
https://github.com/FEX-Emu/xxHash.git
synced 2024-11-24 06:59:40 +00:00
Merge branch 'dev' into typo-hunt-ch2
This commit is contained in:
commit
9ea4471de8
29
CHANGELOG
Normal file
29
CHANGELOG
Normal file
@ -0,0 +1,29 @@
|
||||
v0.7.3
|
||||
- Perf: improved speed for large inputs (~+20%)
|
||||
- Perf: improved latency for small inputs (~10%)
|
||||
- Perf : s390x Vectorial code, by @easyaspi314
|
||||
- API : `xxhash.h` can now be included in any order, with and without `XXH_STATIC_LINKING_ONLY` and `XXH_INLINE_ALL`
|
||||
- build : xxhash implementation transferred into `xxhash.h`. There is no more need to have `xxhash.c` in the `/includes` directory for `XXH_INLINE_ALL` to work
|
||||
- build : VCpkg installation instructions, by @LilyWangL
|
||||
- doc : highly improved code documentation, by @easyaspi314
|
||||
- misc : New test tool in `/tests/collisions` : brute force collision tester for 64-bit hashes
|
||||
|
||||
v0.7.2
|
||||
- Fixed collision ratio of `XXH128` for some specific input lengths, reported by @svpv
|
||||
- Improved `VSX` and `NEON` variants, by @easyaspi314
|
||||
- Improved performance of scalar code path (`XXH_VECTOR=0`), by @easyaspi314
|
||||
- `xxhsum` : can generate 128-bit hash with command `-H2` (note : for experimental purposes only ! `XXH128` is not yet frozen)
|
||||
- `xxhsum` : option `-q` removes status notifications
|
||||
|
||||
v0.7.1
|
||||
- Secret first : the algorithm computation can be altered by providing a "secret", which is any blob of bytes, of size >= `XXH3_SECRET_SIZE_MIN`.
|
||||
- `seed` is still available, and acts as a secret generator
|
||||
- updated `ARM NEON` variant by @easyaspi314
|
||||
- Streaming implementation is available
|
||||
- Improve compatibility and performance with Visual Studio, with help from @aras-p
|
||||
- Better integration when using `XXH_INLINE_ALL` : do not pollute host namespace, use its own macros, such as `XXH_ASSERT()`, `XXH_ALIGN`, etc.
|
||||
- 128-bits variant provide helper function, for comparison of hashes.
|
||||
- Better `clang` generation of `rotl` instruction, thanks to @easyaspi314
|
||||
- `XXH_REROLL` build macro, to reduce binary size, by @easyaspi314
|
||||
- Improved `cmake` script, by @Mezozoysky
|
||||
- Full benchmark program provided in `/tests/bench`
|
23
xxh3.h
23
xxh3.h
@ -34,9 +34,10 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Note:
|
||||
* This file is separated for development purposes.
|
||||
* Note: This file is separated for development purposes.
|
||||
* It will be integrated into `xxhash.h` when development stage is completed.
|
||||
*
|
||||
* Credit: most of the work on vectorial and asm variants comes from @easyaspi314
|
||||
*/
|
||||
|
||||
#ifndef XXH3_H_1397135465
|
||||
@ -713,15 +714,15 @@ XXH3_len_4to8_64b(const xxh_u8* input, size_t len, const xxh_u8* secret, XXH64_h
|
||||
seed ^= (xxh_u64)XXH_swap32((xxh_u32)seed) << 32;
|
||||
{ xxh_u32 const input1 = XXH_readLE32(input);
|
||||
xxh_u32 const input2 = XXH_readLE32(input + len - 4);
|
||||
xxh_u32 const bitflip1 = (XXH_readLE32(secret+8) ^ XXH_readLE32(secret+12)) + (xxh_u32)(seed >> 32);
|
||||
xxh_u32 const bitflip2 = (XXH_readLE32(secret+16) ^ XXH_readLE32(secret+20)) - (xxh_u32)seed;
|
||||
xxh_u32 const key1 = XXH_swap32(input1) ^ bitflip1;
|
||||
xxh_u32 const key2 = input2 ^ bitflip2;
|
||||
xxh_u64 const mix = XXH_mult32to64(key1, key2)
|
||||
+ ((xxh_u64)input1 << 32)
|
||||
+ ((xxh_u64)(XXH_rotl32(input2,23)) << 32)
|
||||
+ len;
|
||||
return XXH3_avalanche(XXH_xorshift64(mix, 59));
|
||||
xxh_u64 const bitflip = (XXH_readLE64(secret+8) ^ XXH_readLE64(secret+16)) - seed;
|
||||
xxh_u64 const input64 = input2 + (((xxh_u64)input1) << 32);
|
||||
xxh_u64 x = input64 ^ bitflip;
|
||||
/* this mix is inspired by Pelle Evensen's rrmxmx */
|
||||
x ^= XXH_rotl64(x, 49) ^ XXH_rotl64(x, 24);
|
||||
x *= 0x9FB21C651E98DF25ULL;
|
||||
x ^= (x >> 35) + len ;
|
||||
x *= 0x9FB21C651E98DF25ULL;
|
||||
return XXH_xorshift64(x, 28);
|
||||
}
|
||||
}
|
||||
|
||||
|
6
xxhsum.c
6
xxhsum.c
@ -905,8 +905,8 @@ static void BMK_sanityCheck(void)
|
||||
BMK_testXXH3(NULL, 0, prime64, 0x6AFCE90814C488CBULL);
|
||||
BMK_testXXH3(sanityBuffer, 1, 0, 0xB936EBAE24CB01C5ULL); /* 1 - 3 */
|
||||
BMK_testXXH3(sanityBuffer, 1, prime64, 0xF541B1905037FC39ULL); /* 1 - 3 */
|
||||
BMK_testXXH3(sanityBuffer, 6, 0, 0x5AD7EA2EF78ED766ULL); /* 4 - 8 */
|
||||
BMK_testXXH3(sanityBuffer, 6, prime64, 0x006191EDA5230C98ULL); /* 4 - 8 */
|
||||
BMK_testXXH3(sanityBuffer, 6, 0, 0x27B56A84CD2D7325ULL); /* 4 - 8 */
|
||||
BMK_testXXH3(sanityBuffer, 6, prime64, 0x84589C116AB59AB9ULL); /* 4 - 8 */
|
||||
BMK_testXXH3(sanityBuffer, 12, 0, 0xA713DAF0DFBB77E7ULL); /* 9 - 16 */
|
||||
BMK_testXXH3(sanityBuffer, 12, prime64, 0xE7303E1B2336DE0EULL); /* 9 - 16 */
|
||||
BMK_testXXH3(sanityBuffer, 24, 0, 0xA3FE70BF9D3510EBULL); /* 17 - 32 */
|
||||
@ -934,7 +934,7 @@ static void BMK_sanityCheck(void)
|
||||
assert(sizeof(sanityBuffer) >= XXH3_SECRET_SIZE_MIN + 7 + 11);
|
||||
BMK_testXXH3_withSecret(NULL, 0, secret, secretSize, 0x6775FD10343C92C3ULL); /* empty string */
|
||||
BMK_testXXH3_withSecret(sanityBuffer, 1, secret, secretSize, 0xC3382C326E24E3CDULL); /* 1 - 3 */
|
||||
BMK_testXXH3_withSecret(sanityBuffer, 6, secret, secretSize, 0x6726BBF76FB142FAULL); /* 4 - 8 */
|
||||
BMK_testXXH3_withSecret(sanityBuffer, 6, secret, secretSize, 0x82C90AB0519369ADULL); /* 4 - 8 */
|
||||
BMK_testXXH3_withSecret(sanityBuffer, 12, secret, secretSize, 0x14631E773B78EC57ULL); /* 9 - 16 */
|
||||
BMK_testXXH3_withSecret(sanityBuffer, 24, secret, secretSize, 0xCDD5542E4A9D9FE8ULL); /* 17 - 32 */
|
||||
BMK_testXXH3_withSecret(sanityBuffer, 48, secret, secretSize, 0x33ABD54D094B2534ULL); /* 33 - 64 */
|
||||
|
Loading…
Reference in New Issue
Block a user