Skip to content

Commit fbdda85

Browse files
committed
Test for more avx512 functions
Some compiler installations (notably xcode for MacOS El Capitan) are missing some of the avx512f intrinsics. As these were not specifically checked for in configure, it enabled avx512 but builds failed due to the missing symbols. Fix by adding some extra lines to the avx512f configure test so it can turn avx512 off on these platforms.
1 parent a7ce404 commit fbdda85

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

configure.ac

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,9 @@ HTS_CHECK_COMPILE_FLAGS_NEEDED([avx512f], [-mavx512f -mpopcnt], [AC_LANG_PROGRAM
188188
#ifdef __x86_64__
189189
__m512i a = _mm512_set1_epi32(1);
190190
__m512i b = _mm512_add_epi32(a, a);
191-
return _mm_popcnt_u32(*((char *) &b));
191+
__m256i c = _mm512_castsi512_si256(b);
192+
__m256i d = _mm512_extracti64x4_epi64(a, 1);
193+
return _mm_popcnt_u32(*((char *) &c)) + (*(char *) &d);
192194
#endif
193195
]])], [
194196
MAVX512="$flags_needed"

0 commit comments

Comments
 (0)