Bug 894941 - Move SSE.{h,cpp} and arm.{h,cpp} to mozglue/build/. r=glandium
authorPaul Adenot <paul@paul.cx>
Fri, 26 Jul 2013 18:46:31 +0200
changeset 140177 f6412c912847
parent 140176 8ad218e441d6
child 140178 f134b528c97d
push id25016
push userryanvm@gmail.com
push date2013-07-27 02:25 +0000
treeherdermozilla-central@fb48c7d58b8b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs894941
milestone25.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 894941 - Move SSE.{h,cpp} and arm.{h,cpp} to mozglue/build/. r=glandium
mozglue/build/SSE.cpp
mozglue/build/SSE.h
mozglue/build/arm.cpp
mozglue/build/arm.h
mozglue/build/moz.build
mozglue/tests/ShowSSEConfig.cpp
mozglue/tests/moz.build
xpcom/glue/SSE.cpp
xpcom/glue/SSE.h
xpcom/glue/arm.cpp
xpcom/glue/arm.h
xpcom/glue/moz.build
xpcom/glue/nomozalloc/Makefile.in
xpcom/glue/objs.mk
xpcom/glue/staticruntime/Makefile.in
xpcom/tests/ShowSSEConfig.cpp
xpcom/tests/moz.build
rename from xpcom/glue/SSE.cpp
rename to mozglue/build/SSE.cpp
rename from xpcom/glue/SSE.h
rename to mozglue/build/SSE.h
--- a/xpcom/glue/SSE.h
+++ b/mozglue/build/SSE.h
@@ -3,18 +3,18 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* compile-time and runtime tests for whether to use SSE instructions */
 
 #ifndef mozilla_SSE_h_
 #define mozilla_SSE_h_
 
-// for definition of NS_COM_GLUE
-#include "nscore.h"
+// for definition of MFBT_DATA
+#include "mozilla/Types.h"
 
 /**
  * The public interface of this header consists of a set of macros and
  * functions for Intel CPU features.
  *
  * DETECTING ISA EXTENSIONS
  * ========================
  *
@@ -171,38 +171,38 @@
 
 #endif
 
 namespace mozilla {
 
   namespace sse_private {
 #if defined(MOZILLA_SSE_HAVE_CPUID_DETECTION)
 #if !defined(MOZILLA_PRESUME_MMX)
-    extern bool NS_COM_GLUE mmx_enabled;
+    extern bool MFBT_DATA mmx_enabled;
 #endif
 #if !defined(MOZILLA_PRESUME_SSE)
-    extern bool NS_COM_GLUE sse_enabled;
+    extern bool MFBT_DATA sse_enabled;
 #endif
 #if !defined(MOZILLA_PRESUME_SSE2)
-    extern bool NS_COM_GLUE sse2_enabled;
+    extern bool MFBT_DATA sse2_enabled;
 #endif
 #if !defined(MOZILLA_PRESUME_SSE3)
-    extern bool NS_COM_GLUE sse3_enabled;
+    extern bool MFBT_DATA sse3_enabled;
 #endif
 #if !defined(MOZILLA_PRESUME_SSSE3)
-    extern bool NS_COM_GLUE ssse3_enabled;
+    extern bool MFBT_DATA ssse3_enabled;
 #endif
 #if !defined(MOZILLA_PRESUME_SSE4A)
-    extern bool NS_COM_GLUE sse4a_enabled;
+    extern bool MFBT_DATA sse4a_enabled;
 #endif
 #if !defined(MOZILLA_PRESUME_SSE4_1)
-    extern bool NS_COM_GLUE sse4_1_enabled;
+    extern bool MFBT_DATA sse4_1_enabled;
 #endif
 #if !defined(MOZILLA_PRESUME_SSE4_2)
-    extern bool NS_COM_GLUE sse4_2_enabled;
+    extern bool MFBT_DATA sse4_2_enabled;
 #endif
 #endif
   }
 
 #if defined(MOZILLA_PRESUME_MMX)
 #define MOZILLA_MAY_SUPPORT_MMX 1
   inline bool supports_mmx() { return true; }
 #elif defined(MOZILLA_SSE_HAVE_CPUID_DETECTION)
rename from xpcom/glue/arm.cpp
rename to mozglue/build/arm.cpp
rename from xpcom/glue/arm.h
rename to mozglue/build/arm.h
--- a/xpcom/glue/arm.h
+++ b/mozglue/build/arm.h
@@ -2,18 +2,18 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* compile-time and runtime tests for whether to use SSE instructions */
 
 #ifndef mozilla_arm_h_
 #define mozilla_arm_h_
 
-// for definition of NS_COM_GLUE
-#include "nscore.h"
+// for definition of MFBT_DATA
+#include "mozilla/Types.h"
 
 /* This is patterned after SSE.h, but provides ARMv5E, ARMv6, and NEON
    detection. For reasons similar to the SSE code, code using NEON (even just
    in inline asm) needs to be in a separate compilation unit from the regular
    code, because it requires an ".fpu neon" directive which can't be undone.
    ARMv5E and ARMv6 code may also require an .arch directive, since by default
    the assembler refuses to generate code for opcodes outside of its current
    .arch setting.
@@ -99,26 +99,26 @@
 
 #endif
 
 namespace mozilla {
 
   namespace arm_private {
 #if defined(MOZILLA_ARM_HAVE_CPUID_DETECTION)
 #if !defined(MOZILLA_PRESUME_EDSP)
-    extern bool NS_COM_GLUE edsp_enabled;
+    extern bool MFBT_DATA edsp_enabled;
 #endif
 #if !defined(MOZILLA_PRESUME_ARMV6)
-    extern bool NS_COM_GLUE armv6_enabled;
+    extern bool MFBT_DATA armv6_enabled;
 #endif
 #if !defined(MOZILLA_PRESUME_ARMV7)
-    extern bool NS_COM_GLUE armv7_enabled;
+    extern bool MFBT_DATA armv7_enabled;
 #endif
 #if !defined(MOZILLA_PRESUME_NEON)
-    extern bool NS_COM_GLUE neon_enabled;
+    extern bool MFBT_DATA neon_enabled;
 #endif
 #endif
   }
 
 #if defined(MOZILLA_PRESUME_EDSP)
 #  define MOZILLA_MAY_SUPPORT_EDSP 1
   inline bool supports_edsp() { return true; }
 #elif defined(MOZILLA_MAY_SUPPORT_EDSP) \
--- a/mozglue/build/moz.build
+++ b/mozglue/build/moz.build
@@ -25,10 +25,27 @@ else:
         'dummy.cpp',
     ]
 
 if CONFIG['OS_TARGET'] == 'Android':
     CPP_SOURCES += [
         'BionicGlue.cpp',
     ]
 
+EXPORTS.mozilla += [
+    'SSE.h',
+    'arm.h',
+]
+
+if CONFIG['CPU_ARCH'].startswith('x86'):
+    CPP_SOURCES += [
+        'SSE.cpp',
+    ]
+
+if CONFIG['CPU_ARCH'] == 'arm':
+    CPP_SOURCES += [
+        'arm.cpp',
+    ]
+
+
+
 LIBRARY_NAME = 'mozglue'
 
rename from xpcom/tests/ShowSSEConfig.cpp
rename to mozglue/tests/ShowSSEConfig.cpp
--- a/mozglue/tests/moz.build
+++ b/mozglue/tests/moz.build
@@ -4,9 +4,10 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 NO_DIST_INSTALL = True
 
 if CONFIG['MOZ_LINKER']:
     CPP_SOURCES += [
         'TestZip.cpp',
+        'ShowSSEConfig.cpp',
     ]
--- a/xpcom/glue/moz.build
+++ b/xpcom/glue/moz.build
@@ -74,18 +74,16 @@ EXPORTS.mozilla += [
     'DeadlockDetector.h',
     'FileUtils.h',
     'GenericFactory.h',
     'IntentionalCrash.h',
     'Monitor.h',
     'Mutex.h',
     'Observer.h',
     'ReentrantMonitor.h',
-    'SSE.h',
-    'arm.h',
     'unused.h',
 ]
 
 EXPORTS.mozilla.threads += [
     'nsThreadIDs.h',
 ]
 
 CPP_SOURCES += [
--- a/xpcom/glue/nomozalloc/Makefile.in
+++ b/xpcom/glue/nomozalloc/Makefile.in
@@ -40,16 +40,16 @@ include $(topsrcdir)/config/rules.mk
 
 ifdef _MSC_VER
 # Don't include directives about which CRT to use
 OS_COMPILE_CXXFLAGS += -Zl
 OS_COMPILE_CFLAGS += -Zl
 DEFINES += -D_USE_ANSI_CPP
 endif
 
-export:: $(XPCOM_GLUE_SRC_CPPSRCS) $(XPCOM_GLUENS_SRC_CPPSRCS) $(topsrcdir)/xpcom/glue/nsStringAPI.cpp $(topsrcdir)/xpcom/glue/GenericModule.cpp $(topsrcdir)/xpcom/glue/DeadlockDetector.h $(topsrcdir)/xpcom/glue/SSE.h $(topsrcdir)/xpcom/glue/arm.h
+export:: $(XPCOM_GLUE_SRC_CPPSRCS) $(XPCOM_GLUENS_SRC_CPPSRCS) $(topsrcdir)/xpcom/glue/nsStringAPI.cpp $(topsrcdir)/xpcom/glue/GenericModule.cpp $(topsrcdir)/xpcom/glue/DeadlockDetector.h
 	$(INSTALL) $^ .
 
 ifdef TARGET_XPCOM_ABI
 DEFINES += -DTARGET_XPCOM_ABI=\"$(TARGET_XPCOM_ABI)\"
 endif
 
 DEFINES += -DMOZ_NO_MOZALLOC
--- a/xpcom/glue/objs.mk
+++ b/xpcom/glue/objs.mk
@@ -33,20 +33,15 @@ XPCOM_GLUE_SRC_LCPPSRCS =        \
   FileUtils.cpp                  \
   $(NULL)
 
 XPCOM_GLUE_SRC_CPPSRCS = $(addprefix $(topsrcdir)/xpcom/glue/, $(XPCOM_GLUE_SRC_LCPPSRCS))
 
 XPCOM_GLUENS_SRC_LCPPSRCS =      \
   BlockingResourceBase.cpp       \
   DeadlockDetector.cpp           \
-  SSE.cpp                        \
   unused.cpp                     \
   nsProxyRelease.cpp             \
   nsTextFormatter.cpp            \
   GenericFactory.cpp             \
   $(NULL)
 
-ifneq (,$(filter arm%,$(TARGET_CPU)))
-XPCOM_GLUENS_SRC_LCPPSRCS += arm.cpp
-endif
-
 XPCOM_GLUENS_SRC_CPPSRCS = $(addprefix $(topsrcdir)/xpcom/glue/,$(XPCOM_GLUENS_SRC_LCPPSRCS))
--- a/xpcom/glue/staticruntime/Makefile.in
+++ b/xpcom/glue/staticruntime/Makefile.in
@@ -37,15 +37,15 @@ include $(topsrcdir)/config/rules.mk
 
 ifdef _MSC_VER
 # Don't include directives about which CRT to use
 OS_COMPILE_CXXFLAGS += -Zl
 OS_COMPILE_CFLAGS += -Zl
 DEFINES += -D_USE_ANSI_CPP
 endif
 
-export:: $(XPCOM_GLUE_SRC_CPPSRCS) $(XPCOM_GLUENS_SRC_CPPSRCS) $(topsrcdir)/xpcom/glue/nsStringAPI.cpp $(topsrcdir)/xpcom/glue/GenericModule.cpp $(topsrcdir)/xpcom/glue/DeadlockDetector.h $(topsrcdir)/xpcom/glue/SSE.h $(topsrcdir)/xpcom/glue/arm.h
+export:: $(XPCOM_GLUE_SRC_CPPSRCS) $(XPCOM_GLUENS_SRC_CPPSRCS) $(topsrcdir)/xpcom/glue/nsStringAPI.cpp $(topsrcdir)/xpcom/glue/GenericModule.cpp $(topsrcdir)/xpcom/glue/DeadlockDetector.h
 	$(INSTALL) $^ .
 
 ifdef TARGET_XPCOM_ABI
 DEFINES += -DTARGET_XPCOM_ABI=\"$(TARGET_XPCOM_ABI)\"
 endif
 
--- a/xpcom/tests/moz.build
+++ b/xpcom/tests/moz.build
@@ -47,17 +47,16 @@ CPP_SOURCES += [
     'TestThreadPoolListener.cpp',
     'TestTimers.cpp',
     'TestUnicodeArguments.cpp',
     'nsIFileEnumerator.cpp',
 ]
 
 CPP_UNIT_TESTS += [
     'ShowAlignments.cpp',
-    'ShowSSEConfig.cpp',
     'TestAutoPtr.cpp',
     'TestAutoRef.cpp',
     'TestCOMArray.cpp',
     'TestCOMPtr.cpp',
     'TestCOMPtrEq.cpp',
     'TestDeque.cpp',
     'TestFile.cpp',
     'TestHashtables.cpp',