Skip to content
Browse files
[JSC] Enable Wasm SIMD on x64

Reviewed by Justin Michaud.

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

* Source/JavaScriptCore/runtime/Options.cpp:
* Source/JavaScriptCore/runtime/OptionsList.h:

Canonical link:
  • Loading branch information
Constellation committed Dec 23, 2022
1 parent 618b085 commit 0ca8468650f43d2a0140748be7f7718a53c7badd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
@@ -30,6 +30,7 @@
#include "CPU.h"
#include "JITOperationValidation.h"
#include "LLIntCommon.h"
#include "MacroAssembler.h"
#include "MinimumReservedZoneSize.h"
#include <algorithm>
#include <limits>
@@ -577,6 +578,7 @@ void Options::notifyOptionsChanged()
#if !CPU(X86_64) && !CPU(ARM64)
Options::useConcurrentGC() = false;
Options::forceUnlinkedDFG() = false;
Options::useWebAssemblySIMD() = false;

if (!Options::allowDoubleShape())
@@ -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;

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

@@ -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.") \

0 comments on commit 0ca8468

Please sign in to comment.