Bug 763378 - arm detection should have correct define when -mfpu=neon on gcc or on MSVC. r=tterribe
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Tue, 19 Jun 2012 12:17:43 +0900
changeset 101792 63a91a66c14c3a492e5a415bda6596aecbf60e23
parent 101791 e2578b5c2968c004d4980801240d84af3173b548
child 101793 87e09d2f6098a2b353547619918097070d2ab9b1
push id1316
push userakeybl@mozilla.com
push dateMon, 27 Aug 2012 22:37:00 +0000
treeherdermozilla-beta@db4b09302ee2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstterribe
bugs763378
milestone16.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 763378 - arm detection should have correct define when -mfpu=neon on gcc or on MSVC. r=tterribe
xpcom/glue/arm.h
--- a/xpcom/glue/arm.h
+++ b/xpcom/glue/arm.h
@@ -68,27 +68,32 @@
   // in 4.3). The Maemo version 5 SDK shipped with the CodeSourcery 4.2.1
   // release, which we need to work.
 #  if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)
 #    if defined(HAVE_ARM_NEON)
 #      define MOZILLA_MAY_SUPPORT_NEON 1
 #    endif
 #  endif
 
+  // When using -mfpu=neon, gcc generates neon instructions.
+
+#  if defined(__ARM_NEON__)
+#    define MOZILLA_PRESUME_NEON 1
+#  endif
+
   // Currently we only have CPU detection for Linux via /proc/cpuinfo
 #  if defined(__linux__) || defined(ANDROID)
 #    define MOZILLA_ARM_HAVE_CPUID_DETECTION 1
 #  endif
 
 #elif defined(_MSC_VER) && defined(_M_ARM)
 
 #  define MOZILLA_ARM_HAVE_CPUID_DETECTION 1
-  // I don't know how to do arch detection at compile time for MSVC, so assume
-  // the worst for now.
-#  define MOZILLA_ARM_ARCH 3
+  // _M_ARM on MSVC has current cpu architecture.
+#  define MOZILLA_ARM_ARCH _M_ARM
 
   // MSVC only allows external asm for ARM, so we don't have to rely on
   // compiler support.
 #  define MOZILLA_MAY_SUPPORT_EDSP 1
 #  if defined(HAVE_ARM_SIMD)
 #    define MOZILLA_MAY_SUPPORT_ARMV6 1
 #  endif
 #  if defined(HAVE_ARM_NEON)