Commit Graph

169 Commits

Author SHA1 Message Date
easyaspi314 (Devin)
1367385768 Fix mixed declaration
I need to stop coding before my coffee. :/
2019-10-02 13:01:51 -04:00
easyaspi314 (Devin)
425dbd8d86 Try to improve some variable names.
It's a start, but an improvement. I still have more things I would like
to change but it is good for now.
2019-10-02 12:28:01 -04:00
easyaspi314 (Devin)
cb4adfcc10 Typo 2019-10-01 19:00:28 -04:00
easyaspi314 (Devin)
f90b0aba40 Reduce void pointers and evil casts. 2019-10-01 18:52:21 -04:00
Yann Collet
c8f3fb514c factorized mix32B
changing xxh128 results for len within 129-240.
2019-09-30 22:36:07 -07:00
Yann Collet
9d79fd7bc1 factor mix32 2019-09-30 17:55:46 -07:00
Yann Collet
43b5c76b4c fixed mistake in last ingested segment 2019-09-30 17:33:38 -07:00
Yann Collet
6896c5798f fix input distribution over 128-bit state
for mid-size length 17+
2019-09-30 17:13:59 -07:00
Yann Collet
cd0f5c2209 slightly updated xxh128 at len 1-3
for a slightly better bias
2019-09-28 20:02:55 -07:00
Yann Collet
e098fffe0a fix #259
fix collisions for xxh128 in 9-16 bytes range
2019-09-27 17:55:33 -07:00
Yann Collet
af010ba987 added xxh128sum
== xxhsum -H2
2019-09-27 17:40:36 -07:00
easyaspi314 (Devin)
6a768abdba Remove extra blank line 2019-09-16 10:12:04 -04:00
easyaspi314 (Devin)
1a5663552b Fix typo 2019-09-16 10:10:46 -04:00
easyaspi314 (Devin)
c94e68d705 Better 128-bit multiply, multiple bugfixes.
Sorry about the disorganized commit. :(

Yet again, I had to fix ARMv6. Clang went from ldm to ldrd which
also bus errors.

Therefore, I decided to fix the root problem and remove the
XXH_FORCE_DIRECT_MEMORY_ACCESS hack, using only memcpy.

This will kill alignment memes for good, and besides, it didn't
seem to make much of a difference.

Additionally, I added my better 128-bit long multiply
and applied DRY to XXH3_mul128_fold64. This also removes
the cryptic inline assembly hack.

Each method was documented, too (we need more comments).

Also, I added a warning for users who are compiling Thumb-1
code for a target supporting ARM instructions.

While all versions of ARM and Thumb-2 meet XXH3's base requirements,
Thumb-1 does not.

First of all, UMULL is inaccessible in the 16-bit subset. This means
that every XXH_mult32to64 means a call to __aeabi_lmul.

Since everything operation in XXH3 needs to happen in the Lo registers
plus having to setup r0-r3 many times for __aeabi_lmul, the output
resembles a game of Rush Hour:

 $ clang -O3 -S --target=arm-none-eabi -march=armv4t -mthumb xxhash.c
 $ grep -c mov xxhash.s
 5472
 $ clang -O3 -S --target=arm-none-eabi -march=armv4t xxhash.c
 $ grep -c mov xxhash.s
 2071

It is much more practical to compile xxHash with the wider instruction
sets, as these restrictions do not apply.

This doesn't warn if ARMv6-M is targeted; Thumb-1 is unavoidable.

Lastly, I removed the pragma clang loop hack which didn't work anymore
since the number of iterations can't be constant evaluated. Now, we
don't have 20 warnings when compiling for x86.
2019-09-16 10:09:00 -04:00
Yann Collet
e18a23a582 Visual Studio tests on Appveyor
now generate errors when there is a compiler warning
fix #249

Also fix a few corresponding minor warnings on Visual.
2019-09-06 16:05:44 -07:00
easyaspi314 (Devin)
512b883665 [PPC64] Fix VSX, POWER8 support, and disable POWER7.
The VSX codepath is now working on POWER8 and is fully enabled.

The little endian code has been verified on POWER8E, although
a big endian machine was not available.

This uses vpermxor from POWER8 to shuffle on big endian.

There are a few other fixes as well to unify endian memes.
2019-08-20 21:06:11 -04:00
Yann Collet
dfd1bf117c added comments on VSX code path
which is still disabled for now.
2019-08-15 15:35:53 +02:00
Yann Collet
1c9f6ef789 introduced XXH_ASSERT()
avoid impacting prior `assert()` settings (with or without NDEBUG)
2019-08-05 16:44:18 +02:00
Yann Collet
b6210fe0de disable __uint128_t for 128-bit multiply in emscripten
as suggested by @easyaspi314
2019-07-26 16:16:01 -07:00
Yann Collet
9e8d37b9df blind-fixed alignment assert in 32-bit mode 2019-07-25 15:55:03 -07:00
Yann Collet
ea71708285 fixed assert()
control their activity with DEBUGLEVEL=#,
automatically test assert() as part of `make test`
2019-07-25 15:37:46 -07:00
Yann Collet
091bf37296 fixed (hopefully) ARM NEON code path 2019-07-25 13:10:04 -07:00
Yann Collet
ac8211770c fix NEON path for ARM64
still not fixed for regulat ARMv7+NEON
2019-07-25 13:03:10 -07:00
Yann Collet
5adc627386 disabled VSX code path 2019-07-24 17:33:52 -07:00
Yann Collet
401c7d152d xxh128: fix incorrect swap 2019-07-23 16:23:38 -07:00
Yann Collet
32030d0033 add functions for 128-bit canonical representation 2019-07-23 15:49:54 -07:00
Yann Collet
e961044f73 fixed xxh128 utility functions 2019-07-23 15:33:58 -07:00
Yann Collet
b5cd9ab494 fixed mid-size formula for xxh128 2019-07-22 17:39:21 -07:00
Yann Collet
da9fd1df10 aligned streaming implementation of 128bits with 64bits
also : added XXH128() to benchmark program
2019-07-19 17:28:09 -07:00
Yann Collet
43a4a01bde mid-size mode for 128 bits 2019-07-19 16:44:53 -07:00
Yann Collet
6a52dd28da simple cross-pollenization
input impacts 128-bit of accumulator (in 128-bit mode)
2019-07-19 16:21:17 -07:00
Yann Collet
66ca7d4227 fixed namespace emulation 2019-07-18 15:29:22 -07:00
Yann Collet
06036d88c4 Updated xxh128, to follow same design as XXH3_64b
Still to do :
- 128bits cross pollenization
- mid-size special case (129-240)
2019-07-18 15:14:44 -07:00
Yann Collet
81410ce843 minor refactoring, for clarity 2019-07-17 17:53:10 -07:00
Yann Collet
e0bfe4440f fix potential issue with mid-size inputs associated with minimum size custom secret 2019-07-17 15:46:16 -07:00
Yann Collet
7641c4dd28 define XXH_restrict
only use `restrict` keyword in C99+.
Fix #226
2019-07-09 15:39:04 -07:00
Yann Collet
41ebe39b03
Merge pull request #224 from Cyan4973/visual_arm
Fix Visual compilation for ARM target
2019-07-03 15:38:52 -07:00
Yann Collet
7179700f91 fix #222 : __emulu is not defined for ARM 2019-07-03 15:04:03 -07:00
Yann Collet
fcc977ba19
Merge pull request #223 from aras-p/xxh3stream128
Initial attempt at 128-bit XXH3 streaming variant
2019-07-03 14:38:00 -07:00
Yann Collet
e12f785151 init to 0 is enough 2019-07-03 14:25:05 -07:00
Yann Collet
d5e9850cef Merge branch 'dev' into fix222 2019-07-03 14:24:54 -07:00
Yann Collet
d9b65e78e1 added test case for #222
and a simpler fix : just init bufferedSize to 0 after consumption.
2019-07-03 14:23:43 -07:00
Aras Pranckevicius
56adc2af0b Trying to fix gcc build 2019-07-03 19:00:52 +03:00
Aras Pranckevicius
d74ab00f94 Initial attempt at 128-bit XXH3 streaming variant:
- seems to produce same results as non-streaming functions,
- the 128-bit non-streaming ones don't support "custom secret", so
  neither does the streaming variant
- the 64-bit functions seem to do something more clever in order to
  avoid leaking the key/secret, which none of current 128-bit functions
  do
- the naming of the streaming functions is a bit weird now, since
  most of the ones with "64" in the name are what should be used in
  128 bit case too
2019-07-03 18:53:41 +03:00
Aras Pranckevičius
86f067eee7
Fix XXH3 streaming result when update block size happens to land exactly on buffer size
I was testing the non-streaming XXH3 on 512 byte block, and a streaming API that happened to do a "3 bytes update, then 509 bytes update", and the result was different. Looks like `bufferedSize` was not properly updated if the incoming block size landed exactly on multiple of the internal buffer size. With this proposed fix it seems to be better
2019-07-03 18:41:16 +03:00
Yann Collet
e6ec5c0eb5 xxh3: updated formula for len 1-8
guarantee of no collision for 2 different inputs of same len.
2019-06-18 11:07:06 -07:00
Yann Collet
35d1e2fd7e completed midsize (129-240)
including streaming and self-tests
2019-06-17 14:16:52 -07:00
Yann Collet
93f114c261 try to factorize small sizes
measure performance impact
2019-06-17 14:00:57 -07:00
Yann Collet
593c514654 first midsize version
just for test with benchHash
2019-06-17 12:38:49 -07:00
Yann Collet
60c7cc70fa disable clang unroll statement on emscripten
recommended by @aras-p.

I could not reproduce the issue,
but removing the unroll statement doesn't hurt wasm anyway,
so let's remove it for emscripten.
2019-06-17 12:01:50 -07:00