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>
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>
…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>
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>
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>
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>