Bug 593629: Only check for ARM SIMD and NEON when the CPU_ARCH is ARM. r=ted
authorKyle Huey <khuey@kylehuey.com>
Wed, 13 Apr 2011 19:41:33 -0700
changeset 68094 8a7dadcb59f5e9ec4ac81e7f1dc54a9c2c1ce575
parent 68093 14a336205f226bdf614f0bb737e90d460af680db
child 68095 07e66863b615cfd174462b51d47f9e5e7846a2c9
push id19507
push userkhuey@kylehuey.com
push dateThu, 14 Apr 2011 02:48:21 +0000
treeherdermozilla-central@aa200a803e07 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs593629
milestone6.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 593629: Only check for ARM SIMD and NEON when the CPU_ARCH is ARM. r=ted
configure.in
js/src/configure.in
--- a/configure.in
+++ b/configure.in
@@ -3584,46 +3584,49 @@ fi # $no_x
 
 AC_SUBST(XCFLAGS)
 AC_SUBST(XLDFLAGS)
 AC_SUBST(XLIBS)
 AC_SUBST(XEXT_LIBS)
 AC_SUBST(XT_LIBS)
 AC_SUBST(XSS_LIBS)
 
-AC_MSG_CHECKING(for ARM SIMD support in compiler)
-# We try to link so that this also fails when
-# building with LTO.
-AC_TRY_LINK([],
-               [asm("uqadd8 r1, r1, r2");],
-               result="yes", result="no")
-AC_MSG_RESULT("$result")
-if test "$result" = "yes"; then
-    AC_DEFINE(HAVE_ARM_SIMD)
-    HAVE_ARM_SIMD=1
-fi
+if test "$CPU_ARCH" = "arm"; then
+  AC_MSG_CHECKING(for ARM SIMD support in compiler)
+  # We try to link so that this also fails when
+  # building with LTO.
+  AC_TRY_LINK([],
+                 [asm("uqadd8 r1, r1, r2");],
+                 result="yes", result="no")
+  AC_MSG_RESULT("$result")
+  if test "$result" = "yes"; then
+      AC_DEFINE(HAVE_ARM_SIMD)
+      HAVE_ARM_SIMD=1
+  fi
+
+  AC_MSG_CHECKING(for ARM NEON support in compiler)
+  _SAVE_CFLAGS="$CFLAGS"
+  if test "$GNU_CC"; then
+    # gcc needs -mfpu=neon to recognize NEON instructions
+    CFLAGS="$CFLAGS -mfpu=neon -mfloat-abi=softfp"
+  fi
+  # We try to link so that this also fails when
+  # building with LTO.
+  AC_TRY_LINK([],
+                 [asm("vadd.i8 d0, d0, d0");],
+                 result="yes", result="no")
+  AC_MSG_RESULT("$result")
+  if test "$result" = "yes"; then
+      AC_DEFINE(HAVE_ARM_NEON)
+      HAVE_ARM_NEON=1
+  fi
+  CFLAGS="$_SAVE_CFLAGS"
+fi # CPU_ARCH = arm
+
 AC_SUBST(HAVE_ARM_SIMD)
-
-AC_MSG_CHECKING(for ARM NEON support in compiler)
-_SAVE_CFLAGS="$CFLAGS"
-if test "$GNU_CC"; then
-  # gcc needs -mfpu=neon to recognize NEON instructions
-  CFLAGS="$CFLAGS -mfpu=neon -mfloat-abi=softfp"
-fi
-# We try to link so that this also fails when
-# building with LTO.
-AC_TRY_LINK([],
-               [asm("vadd.i8 d0, d0, d0");],
-               result="yes", result="no")
-AC_MSG_RESULT("$result")
-if test "$result" = "yes"; then
-    AC_DEFINE(HAVE_ARM_NEON)
-    HAVE_ARM_NEON=1
-fi
-CFLAGS="$_SAVE_CFLAGS"
 AC_SUBST(HAVE_ARM_NEON)
 
 dnl ========================================================
 dnl = pthread support
 dnl = Start by checking whether the system support pthreads
 dnl ========================================================
 case "$target_os" in
 darwin*)
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -1,10 +1,10 @@
 dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; -*-
-dnl vi: set tabstop=4 shiftwidth=4 expandtab:
+dnl vi: set tabstop=4 shiftwidth=4 expandtab syntax=m4:
 dnl ***** BEGIN LICENSE BLOCK *****
 dnl Version: MPL 1.1/GPL 2.0/LGPL 2.1
 dnl
 dnl The contents of this file are subject to the Mozilla Public License Version
 dnl 1.1 (the "License"); you may not use this file except in compliance with
 dnl the License. You may obtain a copy of the License at
 dnl http://www.mozilla.org/MPL/
 dnl
@@ -3450,42 +3450,45 @@ fi
 dnl OS/2 has socket in libc.
 case $target in
 *-os2*)
     ;;
 *)
     AC_CHECK_LIB(socket, socket)
 esac
 
-AC_MSG_CHECKING(for ARM SIMD support in compiler)
-AC_TRY_COMPILE([],
-               [asm("uqadd8 r1, r1, r2");],
-               result="yes", result="no")
-AC_MSG_RESULT("$result")
-if test "$result" = "yes"; then
-    AC_DEFINE(HAVE_ARM_SIMD)
-    HAVE_ARM_SIMD=1
+if test "$CPU_ARCH" = "arm"; then
+  AC_MSG_CHECKING(for ARM SIMD support in compiler)
+  AC_TRY_COMPILE([],
+                 [asm("uqadd8 r1, r1, r2");],
+                 result="yes", result="no")
+  AC_MSG_RESULT("$result")
+  if test "$result" = "yes"; then
+      AC_DEFINE(HAVE_ARM_SIMD)
+      HAVE_ARM_SIMD=1
+  fi
+
+  AC_MSG_CHECKING(for ARM NEON support in compiler)
+  _SAVE_CFLAGS="$CFLAGS"
+  if test "$GNU_CC"; then
+    # gcc needs -mfpu=neon to recognize NEON instructions
+    CFLAGS="$CFLAGS -mfpu=neon -mfloat-abi=softfp"
+  fi
+  AC_TRY_COMPILE([],
+                 [asm("vadd.i8 d0, d0, d0");],
+                 result="yes", result="no")
+  AC_MSG_RESULT("$result")
+  if test "$result" = "yes"; then
+      AC_DEFINE(HAVE_ARM_NEON)
+      HAVE_ARM_NEON=1
+  fi
+  CFLAGS="$_SAVE_CFLAGS"
 fi
+
 AC_SUBST(HAVE_ARM_SIMD)
-
-AC_MSG_CHECKING(for ARM NEON support in compiler)
-_SAVE_CFLAGS="$CFLAGS"
-if test "$GNU_CC"; then
-  # gcc needs -mfpu=neon to recognize NEON instructions
-  CFLAGS="$CFLAGS -mfpu=neon -mfloat-abi=softfp"
-fi
-AC_TRY_COMPILE([],
-               [asm("vadd.i8 d0, d0, d0");],
-               result="yes", result="no")
-AC_MSG_RESULT("$result")
-if test "$result" = "yes"; then
-    AC_DEFINE(HAVE_ARM_NEON)
-    HAVE_ARM_NEON=1
-fi
-CFLAGS="$_SAVE_CFLAGS"
 AC_SUBST(HAVE_ARM_NEON)
 
 dnl ========================================================
 dnl = pthread support
 dnl = Start by checking whether the system support pthreads
 dnl ========================================================
 case "$target_os" in
 darwin*)