]> git.ipfire.org Git - thirdparty/zstd.git/log
thirdparty/zstd.git
3 years agouse ZSTD_memcpy(), for proper redirection within Linux Kernel 2962/head
Yann Collet [Wed, 29 Dec 2021 01:41:47 +0000 (17:41 -0800)] 
use ZSTD_memcpy(), for proper redirection within Linux Kernel

3 years agofound a few more places which were dependent on seqStore offcode sumtype numeric...
Yann Collet [Wed, 29 Dec 2021 00:18:44 +0000 (16:18 -0800)] 
found a few more places which were dependent on seqStore offcode sumtype numeric representation

3 years agoregroup all mentions of ZSTD_REP_MOVE within zstd_compress_internal.h
Yann Collet [Tue, 28 Dec 2021 21:47:57 +0000 (13:47 -0800)] 
regroup all mentions of ZSTD_REP_MOVE within zstd_compress_internal.h

3 years agofixed minor conversion warnings
Yann Collet [Tue, 28 Dec 2021 21:21:22 +0000 (13:21 -0800)] 
fixed minor conversion warnings

3 years agoabstracted storeSeq() sumtype numeric representation from zstd_lazy.c
Yann Collet [Tue, 28 Dec 2021 20:23:39 +0000 (12:23 -0800)] 
abstracted storeSeq() sumtype numeric representation from zstd_lazy.c

3 years agoabstracted storeSeq() sumtype numeric representation from zstd_opt.c
Yann Collet [Tue, 28 Dec 2021 20:13:58 +0000 (12:13 -0800)] 
abstracted storeSeq() sumtype numeric representation from zstd_opt.c

3 years agoabstracted storeSeq() sumtype numeric representation from decodecorpus.c
Yann Collet [Tue, 28 Dec 2021 19:58:33 +0000 (11:58 -0800)] 
abstracted storeSeq() sumtype numeric representation from decodecorpus.c

3 years agoseparate newRep() from updateRep()
Yann Collet [Tue, 28 Dec 2021 19:46:15 +0000 (11:46 -0800)] 
separate newRep() from updateRep()

the new contracts seems to make more sense :
updateRep() updates an array of repeat offsets _in place_,
while newRep() generates a new structure with the updated repeat-offset array.

Most callers are actually expecting the in-place variant,
and a limited sub-section, in `zstd_opt.c` mainly, prefer `newRep()`.

3 years agofixed minor typecast warnings
Yann Collet [Tue, 28 Dec 2021 19:38:21 +0000 (11:38 -0800)] 
fixed minor typecast warnings

3 years agoabstracted usage of offBase sumtype within zstd_lazy.c
Yann Collet [Tue, 28 Dec 2021 18:59:47 +0000 (10:59 -0800)] 
abstracted usage of offBase sumtype within zstd_lazy.c

3 years agofixed regression test assert
Yann Collet [Tue, 28 Dec 2021 17:55:31 +0000 (09:55 -0800)] 
fixed regression test assert

optLdm->offset might be == 0 in invalid case.
Only use STORE_OFFSET() after validating it's a correct case.

3 years agocreated STORED_*() macros
Yann Collet [Tue, 28 Dec 2021 14:59:07 +0000 (06:59 -0800)] 
created STORED_*() macros

to act on values stored / expressed in the sumtype numeric representation required by `storedSeq()`.

This makes it possible to abstract away this representation by using the macros to extract these values.

First user : ZSTD_updateRep() .

3 years agointroduce macros STORE_OFFSET() and STORE_REPCODE()
Yann Collet [Fri, 24 Dec 2021 05:58:08 +0000 (21:58 -0800)] 
introduce macros STORE_OFFSET() and STORE_REPCODE()

this meant to abstract the sumtype representation required
to transfert `offcode` to `ZSTD_storeSeq()`.

Unfortunately, the sumtype numeric representation is currently a leaky abstraction
that has permeated many other parts of the code,
especially within `zstd_lazy.c` and also within `zstd_opt.c` and `zstd_compress.c`.

While this PR makes a good job a transfering a large nb of call sites
to using the new macros, there are still a few sites where this transformation is more complex,
or where the numeric representation itself it used "as is".

One of the problematics area is the decision to use the numeric format of the sumtype
within the match finders of `zstd_lazy`.

This commit doesn't change the behavior, it only introduces and employes the macros,
but eventually the resulting code remains identical.

At target, if the numeric representation of the sumtype can be completely abstracted
and no other part of the code depends on it,
it will be possible to move it towards something slightly more efficient.

3 years agoMerge branch 'dev' into seqStore_off
Yann Collet [Fri, 24 Dec 2021 02:03:17 +0000 (18:03 -0800)] 
Merge branch 'dev' into seqStore_off

3 years agochange seqDef.offset into seqDef.offBase
Yann Collet [Fri, 24 Dec 2021 01:56:08 +0000 (17:56 -0800)] 
change seqDef.offset into seqDef.offBase

to better reflect the value stored in this field.

3 years agolibrary optimization flag can be selected on command line again
Yann Collet [Fri, 24 Dec 2021 01:43:12 +0000 (17:43 -0800)] 
library optimization flag can be selected on command line again

`CFLAGS=-O0 make`
will now use `-O0` instead of enforcing `-O3`
which used to be the behavior before introduction of `libzstd.mk`.

This should result in faster tests,
since a few tests depend on this capability for faster roundtrips.

3 years agochanged seqDef.matchLength into seqDef.mlBase 2954/head
Yann Collet [Thu, 23 Dec 2021 21:39:46 +0000 (13:39 -0800)] 
changed seqDef.matchLength into seqDef.mlBase

since this is effectively what is stored in this field (== matchLength - MINMATCH).
This makes it clearer what needs to be done when reading from / writing to this field.

3 years agochange ZSTD_storeSeq() interface to accept matchLength
Yann Collet [Thu, 23 Dec 2021 20:03:33 +0000 (12:03 -0800)] 
change ZSTD_storeSeq() interface to accept matchLength

instead of mlBase.

This removes the need to do `- MINMATCH` at every call site.

The new interface contract is checked with an `assert()`.

3 years agoMerge pull request #2947 from MehdiChinoune/patch-1
Yann Collet [Wed, 22 Dec 2021 19:13:40 +0000 (11:13 -0800)] 
Merge pull request #2947 from MehdiChinoune/patch-1

Fix zstd-static output name with MINGW/Clang

3 years agoFix zstd-static output name with MINGW/Clang 2947/head
مهدي شينون (Mehdi Chinoune) [Wed, 22 Dec 2021 09:08:49 +0000 (10:08 +0100)] 
Fix zstd-static output name with MINGW/Clang

3 years agoupdated manual
Yann Collet [Tue, 21 Dec 2021 16:52:50 +0000 (08:52 -0800)] 
updated manual

3 years agoupdate man pages 2942/head
Yann Collet [Mon, 20 Dec 2021 22:24:06 +0000 (14:24 -0800)] 
update man pages

3 years agoupdated changelog for v1.5.1 2941/head
Yann Collet [Mon, 20 Dec 2021 20:28:27 +0000 (12:28 -0800)] 
updated changelog for v1.5.1

3 years agoMerge pull request #2940 from facebook/revert-2885-limit-level-32bit-systems
Yann Collet [Mon, 20 Dec 2021 20:27:28 +0000 (12:27 -0800)] 
Merge pull request #2940 from facebook/revert-2885-limit-level-32bit-systems

Revert "Limit `ZSTD_maxCLevel` to 21 for 32-bit binaries."

3 years agoRevert "Limit `ZSTD_maxCLevel` to 21 for 32-bit binaries." 2940/head
Yann Collet [Mon, 20 Dec 2021 19:43:14 +0000 (11:43 -0800)] 
Revert "Limit `ZSTD_maxCLevel` to 21 for 32-bit binaries."

3 years agoMerge pull request #2934 from facebook/lazy_rebalance
Yann Collet [Mon, 20 Dec 2021 19:37:44 +0000 (11:37 -0800)] 
Merge pull request #2934 from facebook/lazy_rebalance

rebalance lazy compression levels

3 years agoMerge branch 'dev' into lazy_rebalance 2934/head
Yann Collet [Mon, 20 Dec 2021 16:28:21 +0000 (08:28 -0800)] 
Merge branch 'dev' into lazy_rebalance

3 years agoupdate regression results
Yann Collet [Mon, 20 Dec 2021 15:54:57 +0000 (07:54 -0800)] 
update regression results

3 years agoadded target update_regressionResults
Yann Collet [Fri, 17 Dec 2021 05:01:10 +0000 (21:01 -0800)] 
added target update_regressionResults

to automate the creation of updated tests/regression/results.csv

3 years agoupdate regression results
Yann Collet [Fri, 17 Dec 2021 04:43:23 +0000 (20:43 -0800)] 
update regression results

3 years agoupdate regression results
Yann Collet [Fri, 17 Dec 2021 00:07:54 +0000 (16:07 -0800)] 
update regression results

3 years agoMerge branch 'dev' into lazy_rebalance
Yann Collet [Thu, 16 Dec 2021 22:46:21 +0000 (14:46 -0800)] 
Merge branch 'dev' into lazy_rebalance

3 years agoupdated regression results.csv
Yann Collet [Thu, 16 Dec 2021 22:39:30 +0000 (14:39 -0800)] 
updated regression results.csv

3 years agofixed version number for fast modes
Yann Collet [Thu, 16 Dec 2021 19:52:43 +0000 (11:52 -0800)] 
fixed version number for fast modes

3 years agoforgot the chainlog is effectively a "fake" value with rowHash
Yann Collet [Thu, 16 Dec 2021 19:37:40 +0000 (11:37 -0800)] 
forgot the chainlog is effectively a "fake" value with rowHash

the only value which makes sense is `hashlog-1`
as it mimics the real memory usage.

3 years agoMerge pull request #2931 from facebook/fix_rowlog
Yann Collet [Thu, 16 Dec 2021 17:48:12 +0000 (09:48 -0800)] 
Merge pull request #2931 from facebook/fix_rowlog

fixed incorrect rowlog initialization

3 years agoupdated benchmark for v1.5.1
Yann Collet [Thu, 16 Dec 2021 12:46:21 +0000 (04:46 -0800)] 
updated benchmark for v1.5.1

answers #2764

3 years agominor changelog update
Yann Collet [Thu, 16 Dec 2021 09:07:15 +0000 (01:07 -0800)] 
minor changelog update

3 years agominor changelog update
Yann Collet [Thu, 16 Dec 2021 05:45:30 +0000 (21:45 -0800)] 
minor changelog update

3 years agorebalance lazy compression levels
Yann Collet [Thu, 16 Dec 2021 05:33:31 +0000 (21:33 -0800)] 
rebalance lazy compression levels

3 years agofixed incorrect rowlog initialization 2931/head
Yann Collet [Wed, 15 Dec 2021 22:37:05 +0000 (14:37 -0800)] 
fixed incorrect rowlog initialization

the variable has only very limited usage,
being only used once at the beginning of the block for prefetching only,
hence the error had no impact on compression ratio.

3 years agoMerge pull request #2925 from embg/dict_training_sample_limit_size
Elliot Gorokhovsky [Wed, 15 Dec 2021 20:58:17 +0000 (15:58 -0500)] 
Merge pull request #2925 from embg/dict_training_sample_limit_size

Allow user to specify memory limit for dictionary training

3 years agominor changelog update, for clarity
Yann Collet [Wed, 15 Dec 2021 19:56:11 +0000 (11:56 -0800)] 
minor changelog update, for clarity

3 years agoMerge pull request #2929 from facebook/sse_row_lazy
Yann Collet [Wed, 15 Dec 2021 19:47:15 +0000 (11:47 -0800)] 
Merge pull request #2929 from facebook/sse_row_lazy

simplify SSE implementation of row_lazy match finder

3 years agoMerge pull request #2930 from nolange/reduce_tables_to_8bit
Felix Handte [Wed, 15 Dec 2021 17:43:25 +0000 (12:43 -0500)] 
Merge pull request #2930 from nolange/reduce_tables_to_8bit

Reduce tables to 8bit

3 years agoReduce bit tables to 8bit 2930/head
Norbert Lange [Tue, 14 Dec 2021 21:33:49 +0000 (22:33 +0100)] 
Reduce bit tables to 8bit

This saves some 1.7Kb in rodata section (x86_64, zstd tool),
while assembler code stays the same except
the type of a few load/extend instructions.

Should not have negative performance implications.

3 years agoAdd typedefs for 8bit (un)signed
Norbert Lange [Tue, 14 Dec 2021 21:33:39 +0000 (22:33 +0100)] 
Add typedefs for 8bit (un)signed

To make code more expressive, add U8 and S8 typedefs

3 years agoFix performance degradation with -m32 (#2926)
binhdvo [Tue, 14 Dec 2021 20:53:50 +0000 (15:53 -0500)] 
Fix performance degradation with -m32 (#2926)

3 years agoAllow user to specify memory limit for dictionary training 2925/head
Elliot Gorokhovsky [Fri, 10 Dec 2021 21:19:40 +0000 (16:19 -0500)] 
Allow user to specify memory limit for dictionary training

3 years agoMerge pull request #2921 from felixhandte/neg-lvl-stagger-step
Felix Handte [Tue, 14 Dec 2021 19:13:57 +0000 (14:13 -0500)] 
Merge pull request #2921 from felixhandte/neg-lvl-stagger-step

Stagger Stepping in Negative Levels

3 years agoroll SSE implementation of row_lazy match finder 2929/head
Yann Collet [Tue, 14 Dec 2021 10:12:09 +0000 (02:12 -0800)] 
roll SSE implementation of row_lazy match finder

mostly for maintenance convenience.

Performance wise, there is very little change,
slightly faster for slog 3 & 4,
neutral or very slightly negative for slot 5 & 6.

3 years agoUpdate Regression Tests w/ New Sizes 2921/head
W. Felix Handte [Mon, 13 Dec 2021 22:29:32 +0000 (17:29 -0500)] 
Update Regression Tests w/ New Sizes

3 years agoIncrement Step by 1 not 2
W. Felix Handte [Mon, 13 Dec 2021 20:46:41 +0000 (15:46 -0500)] 
Increment Step by 1 not 2

I couldn't find a good way to spread `ip0` and `ip1` apart when we accelerate
due to incompressible inputs. (The methods I tried slowed things down quite a
bit.)

Since we aren't splaying ip0 and ip1 apart (which would be like `0_1_2_3_`, as
opposed to the `01__23__` we were actually doing), it's a big ambitious to
increment `step` by 2. Instead, let's increment it by 1, which has the benefit
sliiightly improving compression. Speed remains pretty much unchanged.

3 years agoMerge pull request #2905 from 15596858998/dev_1205
Nick Terrell [Mon, 13 Dec 2021 21:45:23 +0000 (13:45 -0800)] 
Merge pull request #2905 from 15596858998/dev_1205

add test case

3 years agoRewrite `step` to Track Increment Between Pairs of Positions
W. Felix Handte [Mon, 13 Dec 2021 19:48:26 +0000 (14:48 -0500)] 
Rewrite `step` to Track Increment Between Pairs of Positions

The position updates are rewritten from `ip[N] = ip[N-1] + step` to be
`ip[N] = ip[N-2] + step`. This lets us only deal with the asymmetric spacing
of gaps at setup and then we only have to keep a single `step` variable.

This seems to work quite well on GCC and Clang!

3 years agoAllow Templating `ZSTD_fast` Matchfinders on Acceleration (Lvl < -1)
W. Felix Handte [Mon, 13 Dec 2021 19:46:57 +0000 (14:46 -0500)] 
Allow Templating `ZSTD_fast` Matchfinders on Acceleration (Lvl < -1)

3 years agoMerge pull request #2923 from IAL32/patch-1
Felix Handte [Mon, 13 Dec 2021 18:15:21 +0000 (13:15 -0500)] 
Merge pull request #2923 from IAL32/patch-1

typo: Small spelling mistake in example

3 years agoUpdate playTests.sh 2905/head
zx123123 [Mon, 13 Dec 2021 00:58:42 +0000 (08:58 +0800)] 
Update playTests.sh

3 years agotypo: Small spelling mistake in example 2923/head
Adrian Castro [Sat, 11 Dec 2021 11:02:23 +0000 (12:02 +0100)] 
typo: Small spelling mistake in example

Just a couple of characters:
`main` -> `may`

3 years agoMerge pull request #2922 from facebook/x32
Yann Collet [Sat, 11 Dec 2021 08:12:10 +0000 (00:12 -0800)] 
Merge pull request #2922 from facebook/x32

x32 compatibility

3 years agofixed x32 compatibility 2922/head
Yann Collet [Sat, 11 Dec 2021 05:02:17 +0000 (21:02 -0800)] 
fixed x32 compatibility

3 years agoadded x32 compatibility test
Yann Collet [Sat, 11 Dec 2021 04:56:20 +0000 (20:56 -0800)] 
added x32 compatibility test

3 years agoDecompose `step` into Two Variables
W. Felix Handte [Fri, 10 Dec 2021 20:52:30 +0000 (15:52 -0500)] 
Decompose `step` into Two Variables

This avoids an additional addition, at the cost of an additional variable.

3 years agoStagger Application of `stepSize` in ZSTD_fast
W. Felix Handte [Fri, 10 Dec 2021 20:44:39 +0000 (15:44 -0500)] 
Stagger Application of `stepSize` in ZSTD_fast

This replicates the behavior of @terrelln's `ZSTD_fast` implementation. That
is, it always looks at adjacent pairs of positions, and only applies the
acceleration every other position. This produces a more fine-grained
acceleration.

3 years agocomplete changelog with #2885
Yann Collet [Thu, 9 Dec 2021 17:53:45 +0000 (09:53 -0800)] 
complete changelog with #2885

3 years agoMerge pull request #2917 from facebook/change151
Yann Collet [Thu, 9 Dec 2021 16:45:34 +0000 (08:45 -0800)] 
Merge pull request #2917 from facebook/change151

Update changelog for v1.5.1

3 years agoMerge pull request #2910 from felixhandte/reject-irregular-dicts
Felix Handte [Thu, 9 Dec 2021 16:44:37 +0000 (11:44 -0500)] 
Merge pull request #2910 from felixhandte/reject-irregular-dicts

Reject Irregular Dictionary Files

3 years agoUpdate changelog for v1.5.1 2917/head
Yann Collet [Thu, 9 Dec 2021 00:55:38 +0000 (16:55 -0800)] 
Update changelog for v1.5.1

3 years agoMerge pull request #2914 from facebook/xxhash081
Yann Collet [Thu, 9 Dec 2021 00:48:46 +0000 (16:48 -0800)] 
Merge pull request #2914 from facebook/xxhash081

updated xxHash to latest v0.8.1

3 years agoremove offending static assert lines 2914/head
Yann Collet [Wed, 8 Dec 2021 23:05:17 +0000 (15:05 -0800)] 
remove offending static assert lines

no idea why visual + clang-cl + appveyor don't like them,
I've not been able to reproduce the issue locally,
but these static assert are very unlikely to deliver a useful signal,
I can't imagine a situation where they will be wrong,
and if they are, then a ton of other things will be broken way before reaching that point.

3 years agoMerge pull request #2916 from terrelln/issue-2906
Nick Terrell [Wed, 8 Dec 2021 21:51:10 +0000 (16:51 -0500)] 
Merge pull request #2916 from terrelln/issue-2906

Remove possible NULL pointer addition

3 years agoaltered copyright title
Yann Collet [Wed, 8 Dec 2021 21:15:45 +0000 (13:15 -0800)] 
altered copyright title

3 years agoReject Irregular Dictionary Files 2910/head
W. Felix Handte [Mon, 6 Dec 2021 18:47:18 +0000 (13:47 -0500)] 
Reject Irregular Dictionary Files

I hadn't seen #2890, so I wrote my own version. I like this approach a little
better, since it does an explicit check for a regular file, rather than
passing a magic value.

Addresses #2874.

3 years agoremoved declarations of XXH3 symbols when XXH_NO_XXH3 is defined
Yann Collet [Wed, 8 Dec 2021 20:56:16 +0000 (12:56 -0800)] 
removed declarations of XXH3 symbols when XXH_NO_XXH3 is defined

on top of implementations, which were already scoped out.

3 years agoreplaces malloc / free / memcpy by Zstandard's version
Yann Collet [Wed, 8 Dec 2021 20:51:04 +0000 (12:51 -0800)] 
replaces malloc / free / memcpy by Zstandard's version

3 years agoRemove possible NULL pointer addition 2916/head
Nick Terrell [Wed, 8 Dec 2021 18:57:30 +0000 (10:57 -0800)] 
Remove possible NULL pointer addition

Refactor `ZSTDMT_isOverlapped()` to do NULL checks before computing the
end pointer.

Fixes #2906.

3 years agoMerge pull request #2915 from terrelln/oss-fuzz-build-fix
Nick Terrell [Wed, 8 Dec 2021 20:32:49 +0000 (15:32 -0500)] 
Merge pull request #2915 from terrelln/oss-fuzz-build-fix

Fix oss-fuzz build

3 years agoMerge pull request #2912 from felixhandte/pkg-config-fix
Felix Handte [Wed, 8 Dec 2021 20:22:56 +0000 (15:22 -0500)] 
Merge pull request #2912 from felixhandte/pkg-config-fix

Fix Up #2659; Build libzstd.pc Whenever Building the Lib on Unix

3 years agoFix oss-fuzz build 2915/head
Nick Terrell [Wed, 8 Dec 2021 18:31:40 +0000 (10:31 -0800)] 
Fix oss-fuzz build

Disable assembly when dataflow sanitizer is enabled.

This regressed in PR #2893, which accidentally removed the check for
dataflow sanitizer.

3 years agofixed very minor cast warning under cygwin
Yann Collet [Wed, 8 Dec 2021 17:17:06 +0000 (09:17 -0800)] 
fixed very minor cast warning under cygwin

3 years agoFix Up #2659; Build libzstd.pc Whenever Building the Lib on Unix 2912/head
W. Felix Handte [Tue, 7 Dec 2021 19:22:36 +0000 (14:22 -0500)] 
Fix Up #2659; Build libzstd.pc Whenever Building the Lib on Unix

3 years agoupdated xxHash to latest v0.8.1
Yann Collet [Wed, 8 Dec 2021 05:14:52 +0000 (21:14 -0800)] 
updated xxHash to latest v0.8.1

with minor modifications directly embedded in source :
- does not compile XXH3
- namespace emulation (ZSTD_ prefix)

Incidentally fix #2824

3 years agoImply -q when stderr is not a tty (#2884)
binhdvo [Tue, 7 Dec 2021 21:56:19 +0000 (16:56 -0500)] 
Imply -q when stderr is not a tty (#2884)

* Imply -q when stderr is not a tty

3 years agoMerge pull request #2659 from ericonr/pc
Felix Handte [Tue, 7 Dec 2021 19:18:38 +0000 (14:18 -0500)] 
Merge pull request #2659 from ericonr/pc

[lib] Fix libzstd.pc for lib-mt builds

3 years agoMerge pull request #2907 from Hello71/armv6-fix-legacy
Nick Terrell [Mon, 6 Dec 2021 20:41:22 +0000 (15:41 -0500)] 
Merge pull request #2907 from Hello71/armv6-fix-legacy

Apply FORCE_MEMORY_ACCESS=1 to legacy

3 years agoMerge pull request #2890 from 15596858998/dec_1201
Nick Terrell [Mon, 6 Dec 2021 18:18:15 +0000 (13:18 -0500)] 
Merge pull request #2890 from 15596858998/dec_1201

fixbug CLI's -D fails when the argument is not a regular file

3 years agoApply FORCE_MEMORY_ACCESS=1 to legacy 2907/head
Alex Xu (Hello71) [Mon, 6 Dec 2021 03:51:44 +0000 (22:51 -0500)] 
Apply FORCE_MEMORY_ACCESS=1 to legacy

See #2633, #2881.

3 years agoadd test case
15596858998 [Sun, 5 Dec 2021 11:12:52 +0000 (19:12 +0800)] 
add test case

3 years agoMerge pull request #2893 from terrelln/issue-2789
Nick Terrell [Fri, 3 Dec 2021 19:07:30 +0000 (14:07 -0500)] 
Merge pull request #2893 from terrelln/issue-2789

[asm] Share portability macros and restrict ASM further

3 years agoMerge pull request #2897 from felixhandte/zstd-deprecated-avoid-deprecated
Felix Handte [Fri, 3 Dec 2021 17:09:58 +0000 (12:09 -0500)] 
Merge pull request #2897 from felixhandte/zstd-deprecated-avoid-deprecated

Avoid Using Deprecated Functions in Deprecated Code

3 years agoMerge pull request #2899 from felixhandte/cmake-disable-multithreading-android
Felix Handte [Fri, 3 Dec 2021 17:09:39 +0000 (12:09 -0500)] 
Merge pull request #2899 from felixhandte/cmake-disable-multithreading-android

Disable Multithreading in CMake Builds for Android

3 years ago[asm] Share portability macros and restrict ASM further 2893/head
Nick Terrell [Wed, 1 Dec 2021 20:52:23 +0000 (12:52 -0800)] 
[asm] Share portability macros and restrict ASM further

Move portability macros to `lib/common/portability_macros.h`. This file
only contains platform/feature detection (e.g. 0/1 macros). This file is
shared between C and ASM code, so it cannot include any C code.

Rename `HUF_` ASM macros to be `ZSTD_` prefixed, and move to the new
header.

Restrict `ZSTD_ASM_SUPPORTED` to `__GNUC__`, because we need the GAS
assembler.

Finally, only include the ASM code if we are actually going to use it.
This disables it on all Windows platforms, which should resolve the
problem brought up in Issue #2789.

3 years agoMerge pull request #2900 from terrelln/issue-2893-test
Nick Terrell [Fri, 3 Dec 2021 00:51:33 +0000 (19:51 -0500)] 
Merge pull request #2900 from terrelln/issue-2893-test

[CI] Add cmake windows build

3 years agoMerge pull request #2898 from terrelln/issue-2862
Nick Terrell [Fri, 3 Dec 2021 00:49:43 +0000 (19:49 -0500)] 
Merge pull request #2898 from terrelln/issue-2862

Improve zstd_opt build speed and size

3 years ago[CI] Add cmake windows build 2900/head
Nick Terrell [Thu, 2 Dec 2021 22:42:17 +0000 (14:42 -0800)] 
[CI] Add cmake windows build

Build on windows with cmake to ensure everything compiles.

3 years agoMerge pull request #2896 from facebook/m68k
Yann Collet [Thu, 2 Dec 2021 22:25:45 +0000 (14:25 -0800)] 
Merge pull request #2896 from facebook/m68k

Zstandard compiles and run on m68k cpus

3 years agoDisable Multithreading in CMake Builds for Android 2899/head
W. Felix Handte [Thu, 2 Dec 2021 22:23:42 +0000 (17:23 -0500)] 
Disable Multithreading in CMake Builds for Android

3 years agoImprove zstd_opt build speed and size 2898/head
Nick Terrell [Thu, 2 Dec 2021 21:32:53 +0000 (13:32 -0800)] 
Improve zstd_opt build speed and size

Use the same trick as we did for zstd_lazy in PR #2828:
* Create one search function specialization for each (dictMode, mls).
* Select the search function pointer at the top of the match finder.

Additionally, we no longer inline `ZSTD_compressBlock_opt_generic` into
every function, since `dictMode` is no longer used as a template. Create
two specializations, for opt levels 0 and 2, and call one of the two
specializations.

Lastly, remove the hack that disabled inlining for zstd_opt for the
Linux Kernel, as we've gotten most of the benefit already.

Compilation time sees a ~4x reduction:

| Compiler | Flags                            | Dev Time (s) | PR Time (s) | Delta |
|----------|----------------------------------|--------------|-------------|-------|
| gcc      | -O3                              |         10.1 |         2.3 |  -77% |
| gcc      | -O3 -fsanitize=address,undefined |         61.1 |        10.2 |  -83% |
| clang    | -O3                              |          9.0 |         2.1 |  -76% |
| clang    | -O3 -fsanitize=address,undefined |         33.5 |         5.1 |  -84% |

Build size is reduced by 150KB - 200KB:

| Compiler | Dev libzstd.a Size (B) | PR libzstd.a Size (B) | Delta |
|----------|------------------------|-----------------------|-------|
| gcc      |                1327476 |               1177108 |  -11% |
| clang    |                1378324 |               1167780 |  -15% |

There is a <2% speed loss in all cases:

| Compiler | Level | Dev Speed (MB/s) | PR Speed (MB/s) | Delta  |
|----------|-------|------------------|-----------------|--------|
| gcc      |    16 |             4.78 |            4.72 | -1.25% |
| gcc      |    17 |             3.49 |            3.46 | -0.85% |
| gcc      |    18 |             2.92 |            2.86 | -2.04% |
| gcc      |    19 |             2.61 |            2.61 |  0.00% |
| clang    |    16 |             4.69 |            4.80 |  2.34% |
| clang    |    17 |             3.53 |            3.49 | -1.13% |
| clang    |    18 |             2.86 |            2.85 | -0.34% |
| clang    |    19 |             2.61 |            2.61 |  0.00% |

Fixes Issue #2862.

3 years agoFix Include Path 2897/head
W. Felix Handte [Thu, 2 Dec 2021 21:53:52 +0000 (16:53 -0500)] 
Fix Include Path

3 years agoMerge pull request #2892 from terrelln/issue-2785
Nick Terrell [Thu, 2 Dec 2021 21:20:56 +0000 (16:20 -0500)] 
Merge pull request #2892 from terrelln/issue-2785

[CircleCI] Fix short-tests-0