Bug 1360429 - Part 2. Detect __ARM_NEON macro for aarch64. r?glandium draft
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Fri, 28 Apr 2017 13:27:10 +0900
changeset 576785 ec83bdb7a10c9deff600d45512a53cac2ed678ea
parent 569941 49d8ae4a8bd3a6ea3170c110e01edcfe5aefb906
child 628299 bc8f9ef0e025a71759a818bbe77fd79c24ae55eb
push id58471
push userm_kato@ga2.so-net.ne.jp
push dateFri, 12 May 2017 06:42:06 +0000
reviewersglandium
bugs1360429
milestone55.0a1
Bug 1360429 - Part 2. Detect __ARM_NEON macro for aarch64. r?glandium aarch64's gcc and arm's gcc with -mfpu=neon defines __ARM_NEON for NEON, so we should detect it to support NEON code. MozReview-Commit-ID: LRMTQLctuLV
mozglue/build/arm.h
--- a/mozglue/build/arm.h
+++ b/mozglue/build/arm.h
@@ -64,29 +64,29 @@
 #      define MOZILLA_MAY_SUPPORT_NEON 1
 #    endif
 
 #    if defined(HAVE_ARM_SIMD)
 #      define MOZILLA_MAY_SUPPORT_ARMV7 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
 
 #endif
 
+// When using -mfpu=neon on arm gcc, or using default on aarch64,
+// the compiler generates neon instructions.
+#if defined(__ARM_NEON)
+#  define MOZILLA_PRESUME_NEON 1
+#endif
+
 namespace mozilla {
 
   namespace arm_private {
 #if defined(MOZILLA_ARM_HAVE_CPUID_DETECTION)
 #if !defined(MOZILLA_PRESUME_EDSP)
     extern bool MFBT_DATA edsp_enabled;
 #endif
 #if !defined(MOZILLA_PRESUME_ARMV6)