Bug 1673285 - Enable SIMD for Wasm sandboxed SoundTouch. r=glandium

This patch enables SIMD in Wasm sandboxed SoundTouch by using
simd-everywhere to map SSE intrinsics to WASMSIMD intrinsics and
compiling with -msimd128 flag.

Differential Revision: https://phabricator.services.mozilla.com/D183629
This commit is contained in:
Willy R. Vasquez 2023-08-29 06:26:35 +00:00
Родитель 13fb7e7835
Коммит cd68466dbf
1 изменённых файлов: 9 добавлений и 0 удалений

Просмотреть файл

@ -104,9 +104,18 @@ if CONFIG["MOZ_WASM_SANDBOXING_SOUNDTOUCH"]:
include("/media/libsoundtouch/src/sources.mozbuild")
WASM_SOURCES += ["/media/libsoundtouch/src/" + s for s in soundtouch_sources]
# Only enable SIMD if Float32 is supported
if CONFIG["MOZ_SAMPLE_TYPE_FLOAT32"]:
WASM_DEFINES["MOZ_SAMPLE_TYPE_FLOAT32"] = 1
# Enable SoundTouch SSE optimized intrinsics
WASM_SOURCES += ["/media/libsoundtouch/src/sse_optimized.cpp"]
WASM_DEFINES["SOUNDTOUCH_ALLOW_SSE"] = 1
# Enables SIMD-everywhere to map SSE intrinsics to WASMSIMD intrinsics
WASM_DEFINES["SOUNDTOUCH_WASM_SIMD"] = 1
WASM_DEFINES["SIMDE_ENABLE_NATIVE_ALIASES"] = 1
for k, v in soundtouch_defines:
WASM_DEFINES[k] = v