zstd-ruby 1.3.3.0 → 1.3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/README.md +1 -1
- data/ext/zstdruby/libzstd/BUCK +13 -0
- data/ext/zstdruby/libzstd/README.md +32 -25
- data/ext/zstdruby/libzstd/common/bitstream.h +1 -1
- data/ext/zstdruby/libzstd/common/compiler.h +25 -0
- data/ext/zstdruby/libzstd/common/cpu.h +216 -0
- data/ext/zstdruby/libzstd/common/error_private.c +1 -0
- data/ext/zstdruby/libzstd/common/fse.h +1 -1
- data/ext/zstdruby/libzstd/common/fse_decompress.c +2 -2
- data/ext/zstdruby/libzstd/common/huf.h +114 -89
- data/ext/zstdruby/libzstd/common/pool.c +46 -17
- data/ext/zstdruby/libzstd/common/pool.h +18 -9
- data/ext/zstdruby/libzstd/common/threading.h +12 -12
- data/ext/zstdruby/libzstd/common/zstd_errors.h +16 -7
- data/ext/zstdruby/libzstd/common/zstd_internal.h +4 -5
- data/ext/zstdruby/libzstd/compress/fse_compress.c +19 -11
- data/ext/zstdruby/libzstd/compress/huf_compress.c +160 -62
- data/ext/zstdruby/libzstd/compress/zstd_compress.c +973 -644
- data/ext/zstdruby/libzstd/compress/zstd_compress_internal.h +281 -34
- data/ext/zstdruby/libzstd/compress/zstd_double_fast.c +80 -62
- data/ext/zstdruby/libzstd/compress/zstd_double_fast.h +11 -4
- data/ext/zstdruby/libzstd/compress/zstd_fast.c +87 -71
- data/ext/zstdruby/libzstd/compress/zstd_fast.h +10 -6
- data/ext/zstdruby/libzstd/compress/zstd_lazy.c +333 -274
- data/ext/zstdruby/libzstd/compress/zstd_lazy.h +33 -16
- data/ext/zstdruby/libzstd/compress/zstd_ldm.c +305 -359
- data/ext/zstdruby/libzstd/compress/zstd_ldm.h +64 -21
- data/ext/zstdruby/libzstd/compress/zstd_opt.c +194 -56
- data/ext/zstdruby/libzstd/compress/zstd_opt.h +17 -5
- data/ext/zstdruby/libzstd/compress/zstdmt_compress.c +1131 -449
- data/ext/zstdruby/libzstd/compress/zstdmt_compress.h +32 -16
- data/ext/zstdruby/libzstd/decompress/huf_decompress.c +390 -290
- data/ext/zstdruby/libzstd/decompress/zstd_decompress.c +777 -439
- data/ext/zstdruby/libzstd/dictBuilder/cover.c +11 -8
- data/ext/zstdruby/libzstd/dictBuilder/zdict.c +83 -50
- data/ext/zstdruby/libzstd/dictBuilder/zdict.h +44 -43
- data/ext/zstdruby/libzstd/legacy/zstd_legacy.h +2 -0
- data/ext/zstdruby/libzstd/legacy/zstd_v04.c +42 -118
- data/ext/zstdruby/libzstd/legacy/zstd_v06.c +2 -2
- data/ext/zstdruby/libzstd/legacy/zstd_v07.c +2 -2
- data/ext/zstdruby/libzstd/zstd.h +254 -254
- data/lib/zstd-ruby/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 100c4ca359fb8109a629f142d814ecd3fe1ff6854b6dead6c4f90a36f80f51c7
|
4
|
+
data.tar.gz: 5303f715113cae2061b9b837ad7e7b8fd29b31b0b493c856a669327ef17fe773
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56af4d5c91af2fb6e70abdd970b5992751df49c234998ff127595c02c048439a3fccb98222a943581d539b98f98be3cd4804ad5b83bb20b04e4d5cfed2bac855
|
7
|
+
data.tar.gz: b34865a20495d4aa35c0740bf92a340d325ce1829d52d4dca8872243e16681263cb81e6d668431fe3b657d738d7099968ca16ebb399cede9497099bbea3077a2
|
data/README.md
CHANGED
data/ext/zstdruby/libzstd/BUCK
CHANGED
@@ -25,6 +25,9 @@ cxx_library(
|
|
25
25
|
name='decompress',
|
26
26
|
header_namespace='',
|
27
27
|
visibility=['PUBLIC'],
|
28
|
+
headers=subdir_glob([
|
29
|
+
('decompress', '*_impl.h'),
|
30
|
+
]),
|
28
31
|
srcs=glob(['decompress/zstd*.c']),
|
29
32
|
deps=[
|
30
33
|
':common',
|
@@ -80,6 +83,15 @@ cxx_library(
|
|
80
83
|
]),
|
81
84
|
)
|
82
85
|
|
86
|
+
cxx_library(
|
87
|
+
name='cpu',
|
88
|
+
header_namespace='',
|
89
|
+
visibility=['PUBLIC'],
|
90
|
+
exported_headers=subdir_glob([
|
91
|
+
('common', 'cpu.h'),
|
92
|
+
]),
|
93
|
+
)
|
94
|
+
|
83
95
|
cxx_library(
|
84
96
|
name='bitstream',
|
85
97
|
header_namespace='',
|
@@ -196,6 +208,7 @@ cxx_library(
|
|
196
208
|
deps=[
|
197
209
|
':bitstream',
|
198
210
|
':compiler',
|
211
|
+
':cpu',
|
199
212
|
':entropy',
|
200
213
|
':errors',
|
201
214
|
':mem',
|
@@ -2,16 +2,19 @@ Zstandard library files
|
|
2
2
|
================================
|
3
3
|
|
4
4
|
The __lib__ directory is split into several sub-directories,
|
5
|
-
in order to make it easier to select or exclude
|
5
|
+
in order to make it easier to select or exclude features.
|
6
6
|
|
7
7
|
|
8
8
|
#### Building
|
9
9
|
|
10
|
-
`Makefile` script is provided, supporting
|
11
|
-
|
10
|
+
`Makefile` script is provided, supporting all standard [Makefile conventions](https://www.gnu.org/prep/standards/html_node/Makefile-Conventions.html#Makefile-Conventions),
|
11
|
+
including commands variables, staged install, directory variables and standard targets.
|
12
12
|
- `make` : generates both static and dynamic libraries
|
13
13
|
- `make install` : install libraries in default system directories
|
14
14
|
|
15
|
+
`libzstd` default scope includes compression, decompression, dictionary building,
|
16
|
+
and decoding support for legacy formats >= v0.4.0.
|
17
|
+
|
15
18
|
|
16
19
|
#### API
|
17
20
|
|
@@ -27,29 +30,37 @@ Optional advanced features are exposed via :
|
|
27
30
|
- `ZSTD_STATIC_LINKING_ONLY` : if this macro is defined _before_ including `zstd.h`,
|
28
31
|
it unlocks access to advanced experimental API,
|
29
32
|
exposed in second part of `zstd.h`.
|
30
|
-
These APIs
|
31
|
-
|
33
|
+
These APIs are not "stable", their definition may change in the future.
|
34
|
+
As a consequence, it shall ___never be used with dynamic library___ !
|
32
35
|
Only static linking is allowed.
|
33
36
|
|
34
37
|
|
35
38
|
#### Modular build
|
36
39
|
|
40
|
+
It's possible to compile only a limited set of features.
|
41
|
+
|
37
42
|
- Directory `lib/common` is always required, for all variants.
|
38
43
|
- Compression source code lies in `lib/compress`
|
39
44
|
- Decompression source code lies in `lib/decompress`
|
40
45
|
- It's possible to include only `compress` or only `decompress`, they don't depend on each other.
|
41
46
|
- `lib/dictBuilder` : makes it possible to generate dictionaries from a set of samples.
|
42
|
-
|
43
|
-
|
44
|
-
- `lib/legacy` : source code to decompress
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
47
|
+
The API is exposed in `lib/dictBuilder/zdict.h`.
|
48
|
+
This module depends on both `lib/common` and `lib/compress` .
|
49
|
+
- `lib/legacy` : source code to decompress legacy zstd formats, starting from `v0.1.0`.
|
50
|
+
This module depends on `lib/common` and `lib/decompress`.
|
51
|
+
To enable this feature, it's required to define `ZSTD_LEGACY_SUPPORT` during compilation.
|
52
|
+
Typically, with `gcc`, add argument `-DZSTD_LEGACY_SUPPORT=1`.
|
53
|
+
Using higher number limits versions supported.
|
54
|
+
For example, `ZSTD_LEGACY_SUPPORT=2` means : "support legacy formats >= v0.2.0".
|
55
|
+
`ZSTD_LEGACY_SUPPORT=3` means : "support legacy formats >= v0.3.0", and so on.
|
56
|
+
Starting v0.8.0, all versions of `zstd` produce frames compliant with specification.
|
57
|
+
As a consequence, `ZSTD_LEGACY_SUPPORT=8` (or more) doesn't trigger legacy support.
|
58
|
+
Also, `ZSTD_LEGACY_SUPPORT=0` means "do __not__ support legacy formats".
|
59
|
+
Once enabled, this capability is transparently triggered within decompression functions.
|
60
|
+
It's also possible to invoke directly legacy API, as exposed in `lib/legacy/zstd_legacy.h`.
|
61
|
+
Each version also provides an additional dedicated set of advanced API.
|
62
|
+
For example, advanced API for version `v0.4` is exposed in `lib/legacy/zstd_v04.h` .
|
63
|
+
Note : `lib/legacy` only supports _decoding_ legacy formats.
|
53
64
|
|
54
65
|
|
55
66
|
#### Multithreading support
|
@@ -57,19 +68,16 @@ Optional advanced features are exposed via :
|
|
57
68
|
Multithreading is disabled by default when building with `make`.
|
58
69
|
Enabling multithreading requires 2 conditions :
|
59
70
|
- set macro `ZSTD_MULTITHREAD`
|
60
|
-
- on POSIX systems : compile with pthread (`-pthread` compilation flag for `gcc`
|
71
|
+
- on POSIX systems : compile with pthread (`-pthread` compilation flag for `gcc`)
|
61
72
|
|
62
73
|
Both conditions are automatically triggered by invoking `make lib-mt` target.
|
63
74
|
Note that, when linking a POSIX program with a multithreaded version of `libzstd`,
|
64
75
|
it's necessary to trigger `-pthread` flag during link stage.
|
65
76
|
|
66
|
-
Multithreading capabilities are exposed
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
- advanced API `ZSTD_compress_generic()`, defined in `lib/zstd.h`, experimental section.
|
71
|
-
This API is still considered experimental, but is designed to be labelled "stable" at some point in the future.
|
72
|
-
It's the recommended entry point for multi-threading operations.
|
77
|
+
Multithreading capabilities are exposed
|
78
|
+
via [advanced API `ZSTD_compress_generic()` defined in `lib/zstd.h`](https://github.com/facebook/zstd/blob/dev/lib/zstd.h#L919).
|
79
|
+
This API is still considered experimental,
|
80
|
+
but is expected to become "stable" at some point in the future.
|
73
81
|
|
74
82
|
|
75
83
|
#### Windows : using MinGW+MSYS to create DLL
|
@@ -92,7 +100,6 @@ The compiled executable will require ZSTD DLL which is available at `dll\libzstd
|
|
92
100
|
|
93
101
|
Obsolete API on their way out are stored in directory `lib/deprecated`.
|
94
102
|
At this stage, it contains older streaming prototypes, in `lib/deprecated/zbuff.h`.
|
95
|
-
Presence in this directory is temporary.
|
96
103
|
These prototypes will be removed in some future version.
|
97
104
|
Consider migrating code towards supported streaming API exposed in `zstd.h`.
|
98
105
|
|
@@ -426,7 +426,7 @@ MEM_STATIC size_t BIT_readBitsFast(BIT_DStream_t* bitD, U32 nbBits)
|
|
426
426
|
* Refill `bitD` from buffer previously set in BIT_initDStream() .
|
427
427
|
* This function is safe, it guarantees it will not read beyond src buffer.
|
428
428
|
* @return : status of `BIT_DStream_t` internal register.
|
429
|
-
* when status == BIT_DStream_unfinished, internal register is filled with at least 25 or 57
|
429
|
+
* when status == BIT_DStream_unfinished, internal register is filled with at least 25 or 57 bits */
|
430
430
|
MEM_STATIC BIT_DStream_status BIT_reloadDStream(BIT_DStream_t* bitD)
|
431
431
|
{
|
432
432
|
if (bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8)) /* overflow detected, like end of stream */
|
@@ -63,6 +63,31 @@
|
|
63
63
|
# endif
|
64
64
|
#endif
|
65
65
|
|
66
|
+
/* target attribute */
|
67
|
+
#ifndef __has_attribute
|
68
|
+
#define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */
|
69
|
+
#endif
|
70
|
+
#if defined(__GNUC__)
|
71
|
+
# define TARGET_ATTRIBUTE(target) __attribute__((__target__(target)))
|
72
|
+
#else
|
73
|
+
# define TARGET_ATTRIBUTE(target)
|
74
|
+
#endif
|
75
|
+
|
76
|
+
/* Enable runtime BMI2 dispatch based on the CPU.
|
77
|
+
* Enabled for clang & gcc >=4.8 on x86 when BMI2 isn't enabled by default.
|
78
|
+
*/
|
79
|
+
#ifndef DYNAMIC_BMI2
|
80
|
+
#if (defined(__clang__) && __has_attribute(__target__)) \
|
81
|
+
|| (defined(__GNUC__) \
|
82
|
+
&& (__GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8))) \
|
83
|
+
&& (defined(__x86_64__) || defined(_M_X86)) \
|
84
|
+
&& !defined(__BMI2__)
|
85
|
+
# define DYNAMIC_BMI2 1
|
86
|
+
#else
|
87
|
+
# define DYNAMIC_BMI2 0
|
88
|
+
#endif
|
89
|
+
#endif
|
90
|
+
|
66
91
|
/* prefetch */
|
67
92
|
#if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_I86)) /* _mm_prefetch() is not defined outside of x86/x64 */
|
68
93
|
# include <mmintrin.h> /* https://msdn.microsoft.com/fr-fr/library/84szxsww(v=vs.90).aspx */
|
@@ -0,0 +1,216 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (c) 2018-present, Facebook, Inc.
|
3
|
+
* All rights reserved.
|
4
|
+
*
|
5
|
+
* This source code is licensed under both the BSD-style license (found in the
|
6
|
+
* LICENSE file in the root directory of this source tree) and the GPLv2 (found
|
7
|
+
* in the COPYING file in the root directory of this source tree).
|
8
|
+
* You may select, at your option, one of the above-listed licenses.
|
9
|
+
*/
|
10
|
+
|
11
|
+
#ifndef ZSTD_COMMON_CPU_H
|
12
|
+
#define ZSTD_COMMON_CPU_H
|
13
|
+
|
14
|
+
/**
|
15
|
+
* Implementation taken from folly/CpuId.h
|
16
|
+
* https://github.com/facebook/folly/blob/master/folly/CpuId.h
|
17
|
+
*/
|
18
|
+
|
19
|
+
#include <string.h>
|
20
|
+
|
21
|
+
#include "mem.h"
|
22
|
+
|
23
|
+
#ifdef _MSC_VER
|
24
|
+
#include <intrin.h>
|
25
|
+
#endif
|
26
|
+
|
27
|
+
typedef struct {
|
28
|
+
U32 f1c;
|
29
|
+
U32 f1d;
|
30
|
+
U32 f7b;
|
31
|
+
U32 f7c;
|
32
|
+
} ZSTD_cpuid_t;
|
33
|
+
|
34
|
+
MEM_STATIC ZSTD_cpuid_t ZSTD_cpuid(void) {
|
35
|
+
U32 f1c = 0;
|
36
|
+
U32 f1d = 0;
|
37
|
+
U32 f7b = 0;
|
38
|
+
U32 f7c = 0;
|
39
|
+
#ifdef _MSC_VER
|
40
|
+
int reg[4];
|
41
|
+
__cpuid((int*)reg, 0);
|
42
|
+
{
|
43
|
+
int const n = reg[0];
|
44
|
+
if (n >= 1) {
|
45
|
+
__cpuid((int*)reg, 1);
|
46
|
+
f1c = (U32)reg[2];
|
47
|
+
f1d = (U32)reg[3];
|
48
|
+
}
|
49
|
+
if (n >= 7) {
|
50
|
+
__cpuidex((int*)reg, 7, 0);
|
51
|
+
f7b = (U32)reg[1];
|
52
|
+
f7c = (U32)reg[2];
|
53
|
+
}
|
54
|
+
}
|
55
|
+
#elif defined(__i386__) && defined(__PIC__) && !defined(__clang__) && defined(__GNUC__)
|
56
|
+
/* The following block like the normal cpuid branch below, but gcc
|
57
|
+
* reserves ebx for use of its pic register so we must specially
|
58
|
+
* handle the save and restore to avoid clobbering the register
|
59
|
+
*/
|
60
|
+
U32 n;
|
61
|
+
__asm__(
|
62
|
+
"pushl %%ebx\n\t"
|
63
|
+
"cpuid\n\t"
|
64
|
+
"popl %%ebx\n\t"
|
65
|
+
: "=a"(n)
|
66
|
+
: "a"(0)
|
67
|
+
: "ecx", "edx");
|
68
|
+
if (n >= 1) {
|
69
|
+
U32 f1a;
|
70
|
+
__asm__(
|
71
|
+
"pushl %%ebx\n\t"
|
72
|
+
"cpuid\n\t"
|
73
|
+
"popl %%ebx\n\t"
|
74
|
+
: "=a"(f1a), "=c"(f1c), "=d"(f1d)
|
75
|
+
: "a"(1)
|
76
|
+
:);
|
77
|
+
}
|
78
|
+
if (n >= 7) {
|
79
|
+
__asm__(
|
80
|
+
"pushl %%ebx\n\t"
|
81
|
+
"cpuid\n\t"
|
82
|
+
"movl %%ebx, %%eax\n\r"
|
83
|
+
"popl %%ebx"
|
84
|
+
: "=a"(f7b), "=c"(f7c)
|
85
|
+
: "a"(7), "c"(0)
|
86
|
+
: "edx");
|
87
|
+
}
|
88
|
+
#elif defined(__x86_64__) || defined(_M_X64) || defined(__i386__)
|
89
|
+
U32 n;
|
90
|
+
__asm__("cpuid" : "=a"(n) : "a"(0) : "ebx", "ecx", "edx");
|
91
|
+
if (n >= 1) {
|
92
|
+
U32 f1a;
|
93
|
+
__asm__("cpuid" : "=a"(f1a), "=c"(f1c), "=d"(f1d) : "a"(1) : "ebx");
|
94
|
+
}
|
95
|
+
if (n >= 7) {
|
96
|
+
U32 f7a;
|
97
|
+
__asm__("cpuid"
|
98
|
+
: "=a"(f7a), "=b"(f7b), "=c"(f7c)
|
99
|
+
: "a"(7), "c"(0)
|
100
|
+
: "edx");
|
101
|
+
}
|
102
|
+
#endif
|
103
|
+
{
|
104
|
+
ZSTD_cpuid_t cpuid;
|
105
|
+
cpuid.f1c = f1c;
|
106
|
+
cpuid.f1d = f1d;
|
107
|
+
cpuid.f7b = f7b;
|
108
|
+
cpuid.f7c = f7c;
|
109
|
+
return cpuid;
|
110
|
+
}
|
111
|
+
}
|
112
|
+
|
113
|
+
#define X(name, r, bit) \
|
114
|
+
MEM_STATIC int ZSTD_cpuid_##name(ZSTD_cpuid_t const cpuid) { \
|
115
|
+
return ((cpuid.r) & (1U << bit)) != 0; \
|
116
|
+
}
|
117
|
+
|
118
|
+
/* cpuid(1): Processor Info and Feature Bits. */
|
119
|
+
#define C(name, bit) X(name, f1c, bit)
|
120
|
+
C(sse3, 0)
|
121
|
+
C(pclmuldq, 1)
|
122
|
+
C(dtes64, 2)
|
123
|
+
C(monitor, 3)
|
124
|
+
C(dscpl, 4)
|
125
|
+
C(vmx, 5)
|
126
|
+
C(smx, 6)
|
127
|
+
C(eist, 7)
|
128
|
+
C(tm2, 8)
|
129
|
+
C(ssse3, 9)
|
130
|
+
C(cnxtid, 10)
|
131
|
+
C(fma, 12)
|
132
|
+
C(cx16, 13)
|
133
|
+
C(xtpr, 14)
|
134
|
+
C(pdcm, 15)
|
135
|
+
C(pcid, 17)
|
136
|
+
C(dca, 18)
|
137
|
+
C(sse41, 19)
|
138
|
+
C(sse42, 20)
|
139
|
+
C(x2apic, 21)
|
140
|
+
C(movbe, 22)
|
141
|
+
C(popcnt, 23)
|
142
|
+
C(tscdeadline, 24)
|
143
|
+
C(aes, 25)
|
144
|
+
C(xsave, 26)
|
145
|
+
C(osxsave, 27)
|
146
|
+
C(avx, 28)
|
147
|
+
C(f16c, 29)
|
148
|
+
C(rdrand, 30)
|
149
|
+
#undef C
|
150
|
+
#define D(name, bit) X(name, f1d, bit)
|
151
|
+
D(fpu, 0)
|
152
|
+
D(vme, 1)
|
153
|
+
D(de, 2)
|
154
|
+
D(pse, 3)
|
155
|
+
D(tsc, 4)
|
156
|
+
D(msr, 5)
|
157
|
+
D(pae, 6)
|
158
|
+
D(mce, 7)
|
159
|
+
D(cx8, 8)
|
160
|
+
D(apic, 9)
|
161
|
+
D(sep, 11)
|
162
|
+
D(mtrr, 12)
|
163
|
+
D(pge, 13)
|
164
|
+
D(mca, 14)
|
165
|
+
D(cmov, 15)
|
166
|
+
D(pat, 16)
|
167
|
+
D(pse36, 17)
|
168
|
+
D(psn, 18)
|
169
|
+
D(clfsh, 19)
|
170
|
+
D(ds, 21)
|
171
|
+
D(acpi, 22)
|
172
|
+
D(mmx, 23)
|
173
|
+
D(fxsr, 24)
|
174
|
+
D(sse, 25)
|
175
|
+
D(sse2, 26)
|
176
|
+
D(ss, 27)
|
177
|
+
D(htt, 28)
|
178
|
+
D(tm, 29)
|
179
|
+
D(pbe, 31)
|
180
|
+
#undef D
|
181
|
+
|
182
|
+
/* cpuid(7): Extended Features. */
|
183
|
+
#define B(name, bit) X(name, f7b, bit)
|
184
|
+
B(bmi1, 3)
|
185
|
+
B(hle, 4)
|
186
|
+
B(avx2, 5)
|
187
|
+
B(smep, 7)
|
188
|
+
B(bmi2, 8)
|
189
|
+
B(erms, 9)
|
190
|
+
B(invpcid, 10)
|
191
|
+
B(rtm, 11)
|
192
|
+
B(mpx, 14)
|
193
|
+
B(avx512f, 16)
|
194
|
+
B(avx512dq, 17)
|
195
|
+
B(rdseed, 18)
|
196
|
+
B(adx, 19)
|
197
|
+
B(smap, 20)
|
198
|
+
B(avx512ifma, 21)
|
199
|
+
B(pcommit, 22)
|
200
|
+
B(clflushopt, 23)
|
201
|
+
B(clwb, 24)
|
202
|
+
B(avx512pf, 26)
|
203
|
+
B(avx512er, 27)
|
204
|
+
B(avx512cd, 28)
|
205
|
+
B(sha, 29)
|
206
|
+
B(avx512bw, 30)
|
207
|
+
B(avx512vl, 31)
|
208
|
+
#undef B
|
209
|
+
#define C(name, bit) X(name, f7c, bit)
|
210
|
+
C(prefetchwt1, 0)
|
211
|
+
C(avx512vbmi, 1)
|
212
|
+
#undef C
|
213
|
+
|
214
|
+
#undef X
|
215
|
+
|
216
|
+
#endif /* ZSTD_COMMON_CPU_H */
|
@@ -29,6 +29,7 @@ const char* ERR_getErrorString(ERR_enum code)
|
|
29
29
|
case PREFIX(parameter_outOfBound): return "Parameter is out of bound";
|
30
30
|
case PREFIX(init_missing): return "Context should be init first";
|
31
31
|
case PREFIX(memory_allocation): return "Allocation error : not enough memory";
|
32
|
+
case PREFIX(workSpace_tooSmall): return "workSpace buffer is not large enough";
|
32
33
|
case PREFIX(stage_wrong): return "Operation not authorized at current processing stage";
|
33
34
|
case PREFIX(tableLog_tooLarge): return "tableLog requires too much memory : unsupported";
|
34
35
|
case PREFIX(maxSymbolValue_tooLarge): return "Unsupported max Symbol Value : too large";
|
@@ -345,7 +345,7 @@ size_t FSE_countFast(unsigned* count, unsigned* maxSymbolValuePtr, const void* s
|
|
345
345
|
*/
|
346
346
|
size_t FSE_countFast_wksp(unsigned* count, unsigned* maxSymbolValuePtr, const void* src, size_t srcSize, unsigned* workSpace);
|
347
347
|
|
348
|
-
/*! FSE_count_simple
|
348
|
+
/*! FSE_count_simple() :
|
349
349
|
* Same as FSE_countFast(), but does not use any additional memory (not even on stack).
|
350
350
|
* This function is unsafe, and will segfault if any value within `src` is `> *maxSymbolValuePtr` (presuming it's also the size of `count`).
|
351
351
|
*/
|
@@ -139,8 +139,8 @@ size_t FSE_buildDTable(FSE_DTable* dt, const short* normalizedCounter, unsigned
|
|
139
139
|
{ U32 u;
|
140
140
|
for (u=0; u<tableSize; u++) {
|
141
141
|
FSE_FUNCTION_TYPE const symbol = (FSE_FUNCTION_TYPE)(tableDecode[u].symbol);
|
142
|
-
|
143
|
-
tableDecode[u].nbBits = (BYTE) (tableLog - BIT_highbit32
|
142
|
+
U32 const nextState = symbolNext[symbol]++;
|
143
|
+
tableDecode[u].nbBits = (BYTE) (tableLog - BIT_highbit32(nextState) );
|
144
144
|
tableDecode[u].newState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize);
|
145
145
|
} }
|
146
146
|
|