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
This commit is contained in:
Jan Beich 2018-07-02 22:59:25 +00:00
parent 2f995f4325
commit 4f4bea7496
2 changed files with 6 additions and 0 deletions

View file

@ -45,10 +45,12 @@ AC_SYS_LARGEFILE
LT_INIT([win32-dll]) LT_INIT([win32-dll])
AX_CHECK_COMPILE_FLAG([-maltivec],[flag_altivec="true"])
AX_CHECK_COMPILE_FLAG([-mavx2], [flag_avx2="true"]) AX_CHECK_COMPILE_FLAG([-mavx2], [flag_avx2="true"])
AX_CHECK_COMPILE_FLAG([-msse4.1], [flag_sse4_1="true"]) AX_CHECK_COMPILE_FLAG([-msse4.1], [flag_sse4_1="true"])
AX_CHECK_COMPILE_FLAG([-msse2], [flag_sse2="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_AVX2], [test x"$flag_avx2" = x"true"])
AM_CONDITIONAL([HAVE_SSE4_1], [test x"$flag_sse4_1" = x"true"]) AM_CONDITIONAL([HAVE_SSE4_1], [test x"$flag_sse4_1" = x"true"])
AM_CONDITIONAL([HAVE_SSE2], [test x"$flag_sse2" = x"true"]) AM_CONDITIONAL([HAVE_SSE2], [test x"$flag_sse2" = x"true"])

View file

@ -197,9 +197,13 @@ libsse41_la_SOURCES = \
strategies/sse41/picture-sse41.h strategies/sse41/picture-sse41.h
if HAVE_PPC if HAVE_PPC
if HAVE_ALTIVEC
libaltivec_la_CFLAGS = -maltivec libaltivec_la_CFLAGS = -maltivec
endif endif
endif #HAVE_PPC
if HAVE_X86 if HAVE_X86
if HAVE_AVX2 if HAVE_AVX2