bitshuffle_hperf is an x86-only implementation - its entire vector body sits behind __i386__/__x86_64__, so on aarch64 every entry point compiles down to the scalar fallback. Measured against its own SIMD path that costs 8.3x on encode and 3.8x on decode, and it is the transform behind every compressed image the writer produces and every one the reader, preview and XDS plugin take apart again. The classic bitshuffle vendored beside it does have an aarch64 NEON path, and is already compiled into the same target, so this costs nothing new. BitShuffleBlock.h picks bshuf_trans_bit_elem/bshuf_untrans_bit_elem there and keeps bitshuf_encode_block / bitshuf_decode_block everywhere else, where hperf is about twice classic SSE2 and remains the better choice. The expected aarch64 gain is ~2.5x encode / ~1.7x decode: classic NEON is 128-bit and carries an extra pass, so it recovers part of the gap rather than all of it. The condition mirrors USEARMNEON in bitshuffle_core.c exactly, because with NEON off the classic scalar path is slower than hperf's and must not be selected. Swapping implementations is only safe while the two agree bit for bit - otherwise an ARM build would write files an x86 build could not read. They do: verified byte-identical output and mutual cross-decoding for elem_size 1/2/4/8 over block sizes from 8 to 65536 elements. Both are always compiled in, so the new test holds them to it on every architecture, not just the one that would notice. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
23 lines
801 B
CMake
23 lines
801 B
CMake
ADD_LIBRARY(Compression STATIC
|
|
lz4/lz4.c
|
|
lz4/lz4.h
|
|
bitshuffle/bitshuffle.c
|
|
bitshuffle/bitshuffle_core.c
|
|
bitshuffle/iochain.c
|
|
bitshuffle_hperf/bitshuffle.c
|
|
bitshuffle_hperf/bitshuffle.h
|
|
JFJochZstdCompressor.cpp
|
|
JFJochZstdCompressor.h
|
|
JFJochZstdHuffCompressor.cpp
|
|
JFJochZstdHuffCompressor.h
|
|
JFJochCompressor.cpp
|
|
JFJochCompressor.h
|
|
JFJochDecompress.h
|
|
BitShuffleBlock.h
|
|
MaxCompressedSize.cpp
|
|
MaxCompressedSize.h)
|
|
set_target_properties(Compression PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
|
TARGET_COMPILE_DEFINITIONS(Compression PUBLIC -DZSTD_SUPPORT -DUSE_ZSTD)
|
|
TARGET_LINK_LIBRARIES(Compression libzstd_static)
|
|
TARGET_INCLUDE_DIRECTORIES(Compression PUBLIC . zstd/lib)
|