From 18f0de452dc7e12e4cb544d761a626d5c6031663 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lo=C3=AFc=20Minier?= Date: Tue, 9 Mar 2010 20:57:34 +0100 Subject: [PATCH] ARM: SIMD: Try without any CFLAGS before forcing -mcpu= http://bugs.launchpad.net/bugs/535183 --- configure.ac | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index dcfbfa9..fed97b1 100644 --- a/configure.ac +++ b/configure.ac @@ -363,18 +363,28 @@ AM_CONDITIONAL(USE_VMX, test $have_vmx_intrinsics = yes) dnl =========================================================================== dnl Check for ARM SIMD instructions -ARM_SIMD_CFLAGS="-mcpu=arm1136j-s" +ARM_SIMD_CFLAGS="" have_arm_simd=no AC_MSG_CHECKING(whether to use ARM SIMD assembler) -xserver_save_CFLAGS=$CFLAGS -CFLAGS="$ARM_SIMD_CFLAGS $CFLAGS" +# check with default CFLAGS in case the toolchain turns on a sufficiently recent -mcpu= AC_COMPILE_IFELSE([ int main () { asm("uqadd8 r1, r1, r2"); return 0; -}], have_arm_simd=yes) -CFLAGS=$xserver_save_CFLAGS +}], have_arm_simd=yes, + # check again with an explicit -mcpu= in case the toolchain defaults to an + # older one; note that uqadd8 isn't available in Thumb mode on arm1136j-s + # so we force ARM mode + ARM_SIMD_CFLAGS="-mcpu=arm1136j-s -marm" + xserver_save_CFLAGS=$CFLAGS + CFLAGS="$ARM_SIMD_CFLAGS $CFLAGS" + AC_COMPILE_IFELSE([ + int main () { + asm("uqadd8 r1, r1, r2"); + return 0; + }], have_arm_simd=yes) + CFLAGS=$xserver_save_CFLAGS) AC_ARG_ENABLE(arm-simd, [AC_HELP_STRING([--disable-arm-simd], -- 2.7.4