Bug 1118235 - Disable AVX for now due to performance regressions. r=jandem, a=lmandel
authorHannes Verschore <hv1989@gmail.com>
Thu, 15 Jan 2015 10:07:09 +0100
changeset 249318 81d32b8782721f002d0749a24a858b75ed854823
parent 249317 dab26db33addd50a75063660568c84ac7e280242
child 249319 6c054dbd27113772e11a54c17f09ec9857f9de21
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem, lmandel
bugs1118235
milestone37.0a2
Bug 1118235 - Disable AVX for now due to performance regressions. r=jandem, a=lmandel
js/src/jit/shared/Assembler-x86-shared.cpp
js/src/jit/shared/Assembler-x86-shared.h
js/src/shell/js.cpp
--- a/js/src/jit/shared/Assembler-x86-shared.cpp
+++ b/js/src/jit/shared/Assembler-x86-shared.cpp
@@ -137,17 +137,17 @@ AssemblerX86Shared::InvertCondition(Cond
       default:
         MOZ_CRASH("unexpected condition");
     }
 }
 
 CPUInfo::SSEVersion CPUInfo::maxSSEVersion = UnknownSSE;
 CPUInfo::SSEVersion CPUInfo::maxEnabledSSEVersion = UnknownSSE;
 bool CPUInfo::avxPresent = false;
-bool CPUInfo::avxEnabled = true;
+bool CPUInfo::avxEnabled = false;
 
 static uintptr_t
 ReadXGETBV()
 {
     // We use a variety of low-level mechanisms to get at the xgetbv
     // instruction, including spelling out the xgetbv instruction as bytes,
     // because older compilers and assemblers may not recognize the instruction
     // by name.
--- a/js/src/jit/shared/Assembler-x86-shared.h
+++ b/js/src/jit/shared/Assembler-x86-shared.h
@@ -178,17 +178,17 @@ class CPUInfo
     static bool IsSSE41Present() { return GetSSEVersion() >= SSE4_1; }
     static bool IsSSE42Present() { return GetSSEVersion() >= SSE4_2; }
 
 #ifdef JS_CODEGEN_X86
     static void SetFloatingPointDisabled() { maxEnabledSSEVersion = NoSSE; avxEnabled = false; }
 #endif
     static void SetSSE3Disabled() { maxEnabledSSEVersion = SSE2; avxEnabled = false; }
     static void SetSSE4Disabled() { maxEnabledSSEVersion = SSSE3; avxEnabled = false; }
-    static void SetAVXDisabled() { avxEnabled = false; }
+    static void SetAVXEnabled() { avxEnabled = true; }
 };
 
 class AssemblerX86Shared : public AssemblerShared
 {
   protected:
     struct RelativePatch {
         int32_t offset;
         void *target;
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -5894,18 +5894,19 @@ main(int argc, char **argv, char **envp)
                             "Wait for COUNT calls or iterations before baseline-compiling "
                             "(default: 10)", -1)
         || !op.addBoolOption('\0', "no-fpu", "Pretend CPU does not support floating-point operations "
                              "to test JIT codegen (no-op on platforms other than x86).")
         || !op.addBoolOption('\0', "no-sse3", "Pretend CPU does not support SSE3 instructions and above "
                              "to test JIT codegen (no-op on platforms other than x86 and x64).")
         || !op.addBoolOption('\0', "no-sse4", "Pretend CPU does not support SSE4 instructions"
                              "to test JIT codegen (no-op on platforms other than x86 and x64).")
-        || !op.addBoolOption('\0', "no-avx", "Pretend CPU does not support AVX instructions"
-                             "to test JIT codegen (no-op on platforms other than x86 and x64).")
+        || !op.addBoolOption('\0', "enable-avx", "AVX is disabled by default. Enable AVX. "
+                             "(no-op on platforms other than x86 and x64).")
+        || !op.addBoolOption('\0', "no-avx", "No-op. AVX is currently disabled by default.")
         || !op.addBoolOption('\0', "fuzzing-safe", "Don't expose functions that aren't safe for "
                              "fuzzers to call")
         || !op.addBoolOption('\0', "no-threads", "Disable helper threads and PJS threads")
 #ifdef DEBUG
         || !op.addBoolOption('\0', "dump-entrained-variables", "Print variables which are "
                              "unnecessarily entrained by inner functions")
 #endif
         || !op.addBoolOption('\0', "no-ggc", "Disable Generational GC")
@@ -5977,19 +5978,19 @@ main(int argc, char **argv, char **envp)
     if (op.getBoolOption("no-sse3")) {
         js::jit::CPUInfo::SetSSE3Disabled();
         PropagateFlagToNestedShells("--no-sse3");
     }
     if (op.getBoolOption("no-sse4")) {
         js::jit::CPUInfo::SetSSE4Disabled();
         PropagateFlagToNestedShells("--no-sse4");
     }
-    if (op.getBoolOption("no-avx")) {
-        js::jit::CPUInfo::SetAVXDisabled();
-        PropagateFlagToNestedShells("--no-avx");
+    if (op.getBoolOption("enable-avx")) {
+        js::jit::CPUInfo::SetAVXEnabled();
+        PropagateFlagToNestedShells("--enable-avx");
     }
 #endif
 
     if (op.getBoolOption("no-threads"))
         js::DisableExtraThreads();
 
     // Start the engine.
     if (!JS_Init())