Commit Graph

18 Commits

Author SHA1 Message Date
Tomasz Kantecki
6ef2abe80e igzip: fix issues reported by static code analysis
compute_dist_code() and compute_dist_icf_code() in huffman.h:
    Correct `assert(msb >= 1)` to `assert(msb >= 2)`.
    `msb` cannot be lower than 2 as it would result in corrupt computations.

get_dist_code() in huffman.h:
    Remove dead `if` statement at the beginning of the function.
    `dist` must be equal 1 or above in this function.

Signed-off-by: Tomasz Kantecki <tomasz.kantecki@intel.com>
2023-12-19 20:36:39 +00:00
Ilya Leoshkevich
d3cfb2fb77 Fix s390 build
The goal of this patch is to make isa-l testsuite pass on s390 with
minimal changes to the library. The one and only reason isa-l does not
work on s390 at the moment is that s390 is big-endian, and isa-l
assumes little-endian at a lot of places.

There are two flavors of this: loading/storing integers from/to
memory, and overlapping structs. Loads/stores are already helpfully
wrapped by unaligned.h header, so replace the functions there with
endianness-aware variants. Solve struct member overlap by reversing
their order on big-endian.

Also, fix a couple of usages of uninitialized memory in the testsuite
(found with MemorySanitizer).

Fixes s390x part of #188.

Change-Id: Iaf14a113bd266900192cc8b44212f8a47a8c7753
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
2022-01-04 11:06:17 -07:00
Greg Tucker
e2997062fb igzip: Optimize routine to find msb
Change-Id: I40e7898e2139c04f261980ca10886debc917842a
Signed-off-by: Greg Tucker <greg.b.tucker@intel.com>
2019-08-12 14:28:33 -07:00
Roy Oursler
5be1ba2215 igzip: Remove undefined unaligned loads
Change-Id: I02591d958f8691d07b261218cf5ab361e8ad36c9
Signed-off-by: Roy Oursler <roy.j.oursler@intel.com>
2019-03-07 09:27:50 -07:00
Roy Oursler
ba1a000680 igzip: Implement set_long_icf to compare more than 258
Change-Id: Ia8813d176da6bfcd3c6ef441eca1c59ac99db7f2
Signed-off-by: Roy Oursler <roy.j.oursler@intel.com>
2018-12-04 10:41:40 -07:00
Roy Oursler
8387b65800 igzip: Modify hash table size based on input size
Change-Id: Ieeddb36ef8cd9615011876e4d8dc941a06622d1b
Signed-off-by: Roy Oursler <roy.j.oursler@intel.com>
2018-09-20 11:12:02 -07:00
Roy Oursler
7faedc71bd igzip: Rename tzcnt to more accurate tzbytecnt
Change-Id: Ifc0b828f50e4c1feaf141e0164749eca3b227996
Signed-off-by: Roy Oursler <roy.j.oursler@intel.com>
2018-06-14 15:30:14 -07:00
Konstantine Kharlamov
19f2c46d1b igzip: fix build failure for CPUs with BMI capability
…also makes use of an optimized algorithm for x86_64 CPUs without the BMI.

v2: use "defined()" macro

igzip: s/__bsfq/__builtin_ctzll

Per discussion at https://github.com/01org/isa-l/pull/38 __bsfq isn't
defined on clang, but __builtin_ctzll should work same way.

Also, refactor the code a bit.

Change-Id: I1a251abe1fab1be1cbdc2c042298d0b500068c68
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
2018-05-25 10:27:50 -07:00
Daniel Verkamp
f9a61187c5 igzip: remove stray duplicate semicolon
Change-Id: I0df14600e2f49dd04d3e94bdfe2c155faa9ac2ee
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-03-29 09:31:40 -07:00
Jean-Yves VET
52bb322912 build: fix compilation with CPU not supporting SSE
This patch makes the project compile and run (tests and
performance tests as well) with CPUs which are not
supporting SSE instructions.

Signed-off-by: Jean-Yves Vet <jyvet@ddn.com>
2018-02-23 06:13:10 -05:00
Roy Oursler
4ae2d1be29 igzip: Implement optimized level 2 compression
Change-Id: I8cf5bcd56f290d17205ac36dc2828c8acfc66947
Signed-off-by: Roy Oursler <roy.j.oursler@intel.com>
2017-12-15 14:27:14 -07:00
Roy Oursler
01dfbcc484 igzip: implement igzip two pass
Change-Id: I9564b2da251a02197b39cab5f141e7aff1ae8439
Signed-off-by: Roy Oursler <roy.j.oursler@intel.com>
2017-03-30 16:50:48 -07:00
Roy Oursler
4ea4f81138 igzip: Make gzip format a run time option.
Change-Id: Ia986d378763146b33c733751652bff788ec3cb9d
Signed-off-by: Roy Oursler <roy.j.oursler@intel.com>
2016-12-06 11:16:07 -07:00
Roy Oursler
d941b66162 igzip: Improve igzip stateful on large buffers
Change-Id: I3e9e56958e8ea3e636df3369b29c3d4b94dce9d8
Signed-off-by: Roy Oursler <roy.j.oursler@intel.com>
2016-12-06 10:59:52 -07:00
Roy Oursler
88f95d8594 igzip: Merge inflate.h and igzip_lib.h and fix external naming
Merge inflate.h and igzip_lib.h and rename many defines to avoid conflicts,
along with general cleanup of the new header.

Signed-off-by: Roy Oursler <roy.j.oursler@intel.com>
Reviewed-by: Greg Tucker <greg.b.tucker@intel.com>
2016-12-05 16:40:43 -07:00
Roy Oursler
bbc886cf01 igzip: Modify igzip to ignore matches which are shorter than 4
Signed-off-by: Roy Oursler <roy.j.oursler@intel.com>
Reviewed-by: Greg Tucker <greg.b.tucker@intel.com>
2016-12-02 17:07:45 -07:00
Greg Tucker
45311ea249 Change common and igzip multibinary check from sse4.1 to sse4.2
SSE optimized compression function is using crc32 instruction that is in SSE 4.2
not SSE4.1 as stated.  Fixes incorect choice on core 2 duo that is SSE 4.1 only.

Signed-off-by: Greg Tucker <greg.b.tucker@intel.com>
2016-12-02 17:05:23 -07:00
Greg Tucker
660f49b02d Add data compression unit
Include fast DEFLATE compatable compression functions.

Signed-off-by: Greg Tucker <greg.b.tucker@intel.com>
2016-06-10 17:03:38 -07:00