[Pixman] [PATCH] SIMD: Try without any CFLAGS before forcing -mcpu=

lool at dooz.org lool at dooz.org
Tue Mar 9 11:57:34 PST 2010


From: Loïc Minier <loic.minier at ubuntu.com>

http://bugs.launchpad.net/bugs/535183
---
 configure.ac |   20 +++++++++++++++-----
 1 files 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],
-- 
1.7.0



More information about the Pixman mailing list