Detect ARM Neon support and only build appropriate SIMD object files #1451
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add test compilations to detect ARM Neon support to configure.ac and hts_probe_cc.sh. If compiler support is present, add rANS_static32x16pr_neon.c to
$(HTSCODECS_SOURCES)
in htscodecs_bundled.mk. Fixes #1450.Similarly only add rANS_static32x16pr_avx2.c et al to
$(HTSCODECS_SOURCES)
if the respective AVX2, AVX512, SSE4 support is present. As building these files already uses GNU Make-specific constructs (namely target-specific variables in Makefile) and the$(HTS_CFLAGS_AVX2)
Make variables already exist and are either empty or a non-empty option string, this is easily achieved via$(if $(HTS_CFLAGS_AVX2),...)
.There is no compiler flag required for Neon, so invent
HTS_HAVE_NEON
and use it to control building rANS_static32x16pr_neon.c without adding any bespoke compilation options for it.