зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1706891 - Config machinery for relaxed simd. r=rhunt
Introduce moz.configure, WasmFeatures, and StaticPrefList.yaml machinery to define a config option for relaxed SIMD (https://github.com/WebAssembly/relaxed-simd). At the moment, there are no defined relaxed SIMD opcodes, but a dozen or so are in the works. This just sets us up for implementing those. Differential Revision: https://phabricator.services.mozilla.com/D114117
This commit is contained in:
Родитель
1b59a49ab1
Коммит
fa1414e4b5
|
@ -804,6 +804,38 @@ set_config("ENABLE_WASM_SIMD_WORMHOLE", wasm_simd_wormhole)
|
|||
set_define("ENABLE_WASM_SIMD_WORMHOLE", wasm_simd_wormhole)
|
||||
|
||||
|
||||
# Support for WebAssembly relaxed SIMD
|
||||
# =====================================================
|
||||
|
||||
|
||||
@depends(milestone.is_nightly, "--enable-wasm-simd")
|
||||
def default_wasm_relaxed_simd(is_nightly, wasm_simd):
|
||||
if is_nightly and wasm_simd:
|
||||
return True
|
||||
|
||||
|
||||
option(
|
||||
"--enable-wasm-relaxed-simd",
|
||||
default=default_wasm_relaxed_simd,
|
||||
help="{Enable|Disable} WebAssembly relaxed SIMD",
|
||||
)
|
||||
|
||||
|
||||
@depends("--enable-wasm-relaxed-simd", "--enable-wasm-simd")
|
||||
def wasm_relaxed_simd(value, wasm_simd):
|
||||
if not value:
|
||||
return
|
||||
|
||||
if not wasm_simd:
|
||||
die("relaxed SIMD requires SIMD")
|
||||
|
||||
return True
|
||||
|
||||
|
||||
set_config("ENABLE_WASM_RELAXED_SIMD", wasm_relaxed_simd)
|
||||
set_define("ENABLE_WASM_RELAXED_SIMD", wasm_relaxed_simd)
|
||||
|
||||
|
||||
# Options for generating the shell as a script
|
||||
# ============================================
|
||||
option("--with-qemu-exe", nargs=1, help="Use path as an arm emulator on host platforms")
|
||||
|
|
|
@ -52,6 +52,11 @@
|
|||
#else
|
||||
# define WASM_SIMD_ENABLED 0
|
||||
#endif
|
||||
#ifdef ENABLE_WASM_RELAXED_SIMD
|
||||
# define WASM_RELAXED_SIMD_ENABLED 1
|
||||
#else
|
||||
# define WASM_RELAXED_SIMD_ENABLED 0
|
||||
#endif
|
||||
#ifdef ENABLE_WASM_EXCEPTIONS
|
||||
# define WASM_EXCEPTIONS_ENABLED 1
|
||||
#else
|
||||
|
@ -100,7 +105,16 @@
|
|||
/* compiler predicate */ BaselineAvailable(cx), \
|
||||
/* flag predicate */ WasmFunctionReferencesFlag(cx), \
|
||||
/* shell flag */ "gc", \
|
||||
/* preference name */ "gc")
|
||||
/* preference name */ "gc") \
|
||||
EXPERIMENTAL(/* capitalized name */ RelaxedSimd, \
|
||||
/* lower case name */ v128Relaxed, \
|
||||
/* compile predicate */ WASM_RELAXED_SIMD_ENABLED, \
|
||||
/* compiler predicate */ AnyCompilerAvailable(cx), \
|
||||
/* flag predicate */ !IsFuzzingCranelift(cx) && \
|
||||
js::jit::JitSupportsWasmSimd(), \
|
||||
/* shell flag */ "relaxed-simd", \
|
||||
/* preference name */ "relaxed_simd")
|
||||
|
||||
// clang-format on
|
||||
|
||||
#endif // js_WasmFeatures_h
|
||||
|
|
|
@ -5779,6 +5779,13 @@
|
|||
mirror: always
|
||||
#endif // defined(ENABLE_WASM_SIMD)
|
||||
|
||||
#if defined(ENABLE_WASM_RELAXED_SIMD)
|
||||
- name: javascript.options.wasm_relaxed_simd
|
||||
type: bool
|
||||
value: false
|
||||
mirror: always
|
||||
#endif // defined(ENABLE_WASM_RELAXED_SIMD)
|
||||
|
||||
#if defined(ENABLE_WASM_REFTYPES)
|
||||
- name: javascript.options.wasm_reftypes
|
||||
type: bool
|
||||
|
|
Загрузка…
Ссылка в новой задаче