diff mbox

[8/9] Add aarch64 neon support check

Message ID 1386163572-3375-1-git-send-email-ragesh.r@linaro.org
State New
Headers show

Commit Message

Ragesh Radhakrishnan Dec. 4, 2013, 1:26 p.m. UTC
Add small neon code snipet to check the compiler neon support in
acinclude.m4
---
 acinclude.m4 |   33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
diff mbox

Patch

diff --git a/acinclude.m4 b/acinclude.m4
index 70e2555..8ebfbc5 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -180,3 +180,36 @@  AC_DEFUN([AC_CHECK_COMPATIBLE_ARM_ASSEMBLER_IFELSE],[
     $2
   fi
 ])
+
+AC_DEFUN([AC_CHECK_COMPATIBLE_ARM64_ASSEMBLER_IFELSE],[
+  ac_good_gnu_arm_assembler=no
+  ac_save_CC="$CC"
+  ac_save_CFLAGS="$CFLAGS"
+  CFLAGS="$CCASFLAGS -x assembler-with-cpp"
+  CC="$CCAS"
+  AC_COMPILE_IFELSE([[
+    .text
+    movi v0.16b, #100]], ac_good_gnu_arm_assembler=yes)
+
+  ac_use_gas_preprocessor=no
+  if test "x$ac_good_gnu_arm_assembler" = "xno" ; then
+    CC="gas-preprocessor.pl $CCAS"
+    AC_COMPILE_IFELSE([[
+      .text
+      movi v0.16b, #100]], ac_use_gas_preprocessor=yes)
+  fi
+  CFLAGS="$ac_save_CFLAGS"
+  CC="$ac_save_CC"
+
+  if test "x$ac_use_gas_preprocessor" = "xyes" ; then
+    CCAS="gas-preprocessor.pl $CCAS"
+    AC_SUBST([CCAS])
+    ac_good_gnu_arm_assembler=yes
+  fi
+
+  if test "x$ac_good_gnu_arm_assembler" = "xyes" ; then
+    $1
+  else
+    $2
+  fi
+])