Skip to content

Commit

Permalink
[JSC] Enable Wasm SIMD on x64
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=249850
rdar://103674073

Reviewed by Justin Michaud.

Enable Wasm SIMD by default for x64 if AVX is available.

* Source/JavaScriptCore/runtime/Options.cpp:
(JSC::Options::notifyOptionsChanged):
* Source/JavaScriptCore/runtime/OptionsList.h:

Canonical link: https://commits.webkit.org/258309@main
  • Loading branch information
Constellation committed Dec 23, 2022
1 parent 618b085 commit 0ca8468
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions Source/JavaScriptCore/runtime/Options.cpp
Expand Up @@ -30,6 +30,7 @@
#include "CPU.h"
#include "JITOperationValidation.h"
#include "LLIntCommon.h"
#include "MacroAssembler.h"
#include "MinimumReservedZoneSize.h"
#include <algorithm>
#include <limits>
Expand Down Expand Up @@ -577,6 +578,7 @@ void Options::notifyOptionsChanged()
#if !CPU(X86_64) && !CPU(ARM64)
Options::useConcurrentGC() = false;
Options::forceUnlinkedDFG() = false;
Options::useWebAssemblySIMD() = false;
#endif

if (!Options::allowDoubleShape())
Expand Down Expand Up @@ -662,6 +664,11 @@ void Options::notifyOptionsChanged()
if (!Options::useBBQJIT() && Options::useOMGJIT())
Options::wasmLLIntTiersUpToBBQ() = false;

#if CPU(X86_64)
if (!MacroAssembler::supportsAVX())
Options::useWebAssemblySIMD() = false;
#endif

if (Options::forceAllFunctionsToUseSIMD() && !Options::useWebAssemblySIMD())
Options::forceAllFunctionsToUseSIMD() = false;

Expand Down
2 changes: 1 addition & 1 deletion Source/JavaScriptCore/runtime/OptionsList.h
Expand Up @@ -559,7 +559,7 @@ bool canUseWebAssemblyFastMemory();
v(Bool, useWebAssemblyTypedFunctionReferences, false, Normal, "Allow function types from the wasm typed function references spec.") \
v(Bool, useWebAssemblyGC, false, Normal, "Allow gc types from the wasm gc proposal.") \
v(Bool, forceAllFunctionsToUseSIMD, false, Normal, "Force all functions to act conservatively w.r.t fp/vector registers for testing.") \
v(Bool, useWebAssemblySIMD, isARM64(), Normal, "Allow the new simd instructions and types from the wasm simd spec.") \
v(Bool, useWebAssemblySIMD, true, Normal, "Allow the new simd instructions and types from the wasm simd spec.") \
v(Bool, useWebAssemblyTailCalls, true, Normal, "Allow the new instructions from the wasm tail calls spec.") \


Expand Down

0 comments on commit 0ca8468

Please sign in to comment.