diff options
author | Martijn van Beurden <mvanb1@gmail.com> | 2021-06-30 08:12:52 +0200 |
---|---|---|
committer | Martijn van Beurden <mvanb1@gmail.com> | 2022-04-25 20:13:36 +0200 |
commit | d15bcf80a06bd5300e33d5f5c94d69fbf879f45a (patch) | |
tree | e96f2a7143d64083368acbb8c11900d991b7a493 /configure.ac | |
parent | a4156cd78b8925ea1f2607b2da830cb4f03687cb (diff) | |
download | flac-d15bcf80a06bd5300e33d5f5c94d69fbf879f45a.tar.gz |
Add check for certain POWER8/9 intrinsic in altivec.h to configure
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index fafd0bbc..dc302735 100644 --- a/configure.ac +++ b/configure.ac @@ -182,6 +182,16 @@ if test x"$have_cpu_power9" = xyes ; then AH_TEMPLATE(FLAC__HAS_TARGET_POWER9, [define if compiler has __attribute__((target("cpu=power9"))) support]) fi +if test x"$have_cpu_power8" = xyes || test x"$have_cpu_power9" = xyes ; then + AC_MSG_CHECKING([whether altivec.h has vec_doubleh()]) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include <altivec.h>]], + [[vector float d = {0.0f,0.0f,0.0f,0.0f}; vec_doubleh(d);]])], + [AC_MSG_RESULT([yes]) + has_vec_doubleh=true], + [AC_MSG_RESULT([no])]) +fi + fi case "$host" in @@ -257,7 +267,7 @@ AS_HELP_STRING([--disable-vsx],[Disable VSX optimizations]), *) AC_MSG_ERROR(bad value ${enableval} for --enable-vsx) ;; esac],[use_vsx=true]) AM_CONDITIONAL(FLaC__USE_VSX, test "x$use_vsx" = xtrue) -if test "x$use_vsx" = xtrue ; then +if test "x$use_vsx$has_vec_doubleh" = xtruetrue ; then AC_DEFINE(FLAC__USE_VSX) AH_TEMPLATE(FLAC__USE_VSX, [define to enable use of VSX instructions]) fi |