Skip to content

Commit

Permalink
Backport htscodecs improvement: Check for HWCAP_ASIMD
Browse files Browse the repository at this point in the history
Apply part of PR samtools/htscodecs#91. The manylinux2014_aarch64 image
is based on CentOS 7 and uses glibc 2.17, while these aarch64 capability
bits were added in v2.24. We'll build aarch64 wheels on manylinux_2_28
but might as well ensure manylinux2014 builds too.
  • Loading branch information
jmarshall committed Sep 3, 2023
1 parent ce2074a commit f386240
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions htslib/htscodecs/htscodecs/rANS_static4x16pr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1018,15 +1018,15 @@ unsigned char *(*rans_dec_func(int do_simd, int order))
static inline int have_neon() {
#if defined(__linux__) && defined(__arm__)
return (getauxval(AT_HWCAP) & HWCAP_NEON) != 0;
#elif defined(__linux__) && defined(__aarch64__)
#elif defined(__linux__) && defined(__aarch64__) && defined(HWCAP_ASIMD)
return (getauxval(AT_HWCAP) & HWCAP_ASIMD) != 0;
#elif defined(__APPLE__)
return 1;
#elif defined(__FreeBSD__) && defined(__arm__)
u_long cap;
if (elf_aux_info(AT_HWCAP, &cap, sizeof cap) != 0) return 0;
return (cap & HWCAP_NEON) != 0;
#elif defined(__FreeBSD__) && defined(__aarch64__)
#elif defined(__FreeBSD__) && defined(__aarch64__) && defined(HWCAP_ASIMD)
u_long cap;
if (elf_aux_info(AT_HWCAP, &cap, sizeof cap) != 0) return 0;
return (cap & HWCAP_ASIMD) != 0;
Expand Down

0 comments on commit f386240

Please sign in to comment.