From 4f4bea74968033a927793732e4c2ab9eb48f773b Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Mon, 2 Jul 2018 22:59:25 +0000 Subject: [PATCH] Check -maltivec is supported before using PowerPC target may lack or have non-standard FPU: $ cc -dumpmachine powerpcspe-undermydesk-freebsd $ cc -c -maltivec -Isrc src/strategies/altivec/picture-altivec.c src/strategies/altivec/picture-altivec.c:1: error: AltiVec and E500 instructions cannot coexist --- configure.ac | 2 ++ src/Makefile.am | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/configure.ac b/configure.ac index 63ef9a39..c481bb03 100644 --- a/configure.ac +++ b/configure.ac @@ -45,10 +45,12 @@ AC_SYS_LARGEFILE LT_INIT([win32-dll]) +AX_CHECK_COMPILE_FLAG([-maltivec],[flag_altivec="true"]) AX_CHECK_COMPILE_FLAG([-mavx2], [flag_avx2="true"]) AX_CHECK_COMPILE_FLAG([-msse4.1], [flag_sse4_1="true"]) AX_CHECK_COMPILE_FLAG([-msse2], [flag_sse2="true"]) +AM_CONDITIONAL([HAVE_ALTIVEC], [test x"$flag_altivec" = x"true"]) AM_CONDITIONAL([HAVE_AVX2], [test x"$flag_avx2" = x"true"]) AM_CONDITIONAL([HAVE_SSE4_1], [test x"$flag_sse4_1" = x"true"]) AM_CONDITIONAL([HAVE_SSE2], [test x"$flag_sse2" = x"true"]) diff --git a/src/Makefile.am b/src/Makefile.am index 5e884401..55d6d115 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -197,9 +197,13 @@ libsse41_la_SOURCES = \ strategies/sse41/picture-sse41.h if HAVE_PPC + +if HAVE_ALTIVEC libaltivec_la_CFLAGS = -maltivec endif +endif #HAVE_PPC + if HAVE_X86 if HAVE_AVX2