Commit 0435a231 authored by dave.r.yeo's avatar dave.r.yeo Committed by Erik de Castro Lopo
Browse files

Make AVX and AVX2 instructions a configure option



Handy for toolchains or operating systems that don't support AVX or AVX2
like OS/2.
Signed-off-by: dave.r.yeo's avatarDave Yeo <dave.r.yeo@gmail.com>
Signed-off-by: Erik de Castro Lopo's avatarErik de Castro Lopo <erikd@mega-nerd.com>
parent d40a6bc6
......@@ -238,6 +238,19 @@ AC_DEFINE(FLAC__USE_ALTIVEC)
AH_TEMPLATE(FLAC__USE_ALTIVEC, [define to enable use of Altivec instructions])
fi
AC_ARG_ENABLE(avx,
AC_HELP_STRING([--disable-avx], [Disable AVX, AVX2 optimizations]),
[case "${enableval}" in
yes) use_avx=true ;;
no) use_avx=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-avx) ;;
esac],[use_avx=true])
AM_CONDITIONAL(FLaC__USE_AVX, test "x$use_avx" = xtrue)
if test "x$use_avx" = xtrue ; then
AC_DEFINE(FLAC__USE_AVX)
AH_TEMPLATE(FLAC__USE_AVX, [define to enable use of AVX instructions])
fi
AC_ARG_ENABLE(thorough-tests,
AC_HELP_STRING([--disable-thorough-tests], [Disable thorough (long) testing, do only basic tests]),
[case "${enableval}" in
......
......@@ -78,9 +78,11 @@
#define FLAC__SSE2_SUPPORTED 1
#define FLAC__SSSE3_SUPPORTED 1
#define FLAC__SSE4_1_SUPPORTED 1
#ifdef FLAC__USE_AVX
#define FLAC__AVX_SUPPORTED 1
#define FLAC__AVX2_SUPPORTED 1
#define FLAC__FMA_SUPPORTED 1
#endif
#else /* for GCC older than 4.9 */
#define FLAC__SSE_TARGET(x)
#ifdef __SSE__
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment