@@ -17552,6 +17552,58 @@ $as_echo "#define HAVE_XSAVE_INTRINSICS 1" >>confdefs.h
1755217552
1755317553fi
1755417554
17555+ # Check for AVX2 target and intrinsic support
17556+ #
17557+ if test x"$host_cpu" = x"x86_64"; then
17558+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AVX2 support" >&5
17559+ $as_echo_n "checking for AVX2 support... " >&6; }
17560+ if ${pgac_cv_avx2_support+:} false; then :
17561+ $as_echo_n "(cached) " >&6
17562+ else
17563+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17564+ /* end confdefs.h. */
17565+ #include <immintrin.h>
17566+ #include <stdint.h>
17567+ #if defined(__has_attribute) && __has_attribute (target)
17568+ __attribute__((target("avx2")))
17569+ #endif
17570+ static int avx2_test(void)
17571+ {
17572+ const char buf[sizeof(__m256i)];
17573+ __m256i accum = _mm256_loadu_si256((const __m256i *) buf);
17574+ accum = _mm256_add_epi32(accum, accum);
17575+ int result = _mm256_extract_epi32(accum, 0);
17576+ return (int) result;
17577+ }
17578+ int
17579+ main ()
17580+ {
17581+ return avx2_test();
17582+ ;
17583+ return 0;
17584+ }
17585+ _ACEOF
17586+ if ac_fn_c_try_link "$LINENO"; then :
17587+ pgac_cv_avx2_support=yes
17588+ else
17589+ pgac_cv_avx2_support=no
17590+ fi
17591+ rm -f core conftest.err conftest.$ac_objext \
17592+ conftest$ac_exeext conftest.$ac_ext
17593+ fi
17594+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_avx2_support" >&5
17595+ $as_echo "$pgac_cv_avx2_support" >&6; }
17596+ if test x"$pgac_cv_avx2_support" = x"yes"; then
17597+ pgac_avx2_support=yes
17598+ fi
17599+
17600+ if test x"$pgac_avx2_support" = x"yes"; then
17601+
17602+ $as_echo "#define USE_AVX2_WITH_RUNTIME_CHECK 1" >>confdefs.h
17603+
17604+ fi
17605+ fi
17606+
1755517607# Check for AVX-512 popcount intrinsics
1755617608#
1755717609if test x"$host_cpu" = x"x86_64"; then
0 commit comments