Skip to content

Commit

Permalink
Merge branch 'andriy/run-967-enable-simd' into 'master'
Browse files Browse the repository at this point in the history
feat: RUN-967: SIMD: Enable WebAssembly SIMD support

This MR enables WebAssembly SIMD support on the Internet Computer. 

See merge request dfinity-lab/public/ic!18966
  • Loading branch information
berestovskyy committed May 7, 2024
2 parents f6285d5 + de56c13 commit d63549e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
3 changes: 1 addition & 2 deletions rs/embedders/src/wasm_utils/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1364,9 +1364,8 @@ pub fn wasmtime_validation_config(embedders_config: &EmbeddersConfig) -> wasmtim
// implementation.
config.wasm_multi_memory(false);
config.wasm_reference_types(true);
// The SIMD instructions are disable for determinism.
// The relaxed SIMD instructions are disable for determinism.
config.wasm_relaxed_simd(false);
config.wasm_simd(false);
// Tail calls may be enabled in the future.
config.wasm_tail_call(false);
// Threads are disabled for determinism.
Expand Down
13 changes: 6 additions & 7 deletions rs/embedders/src/wasmtime_embedder/wasmtime_embedder_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,10 @@ fn test_initial_wasmtime_config() {
"tail calls support is not enabled",
),
(
"simd",
"relaxed_simd",
"https://github.com/WebAssembly/relaxed-simd/",
"(module (func $f (drop (v128.const i64x2 0 0))))",
"SIMD support is not enabled",
"(module (func $f (param v128) (drop (f64x2.relaxed_madd (local.get 0) (local.get 0) (local.get 0)))))",
"relaxed SIMD support is not enabled",
),
(
"threads",
Expand Down Expand Up @@ -216,10 +216,9 @@ fn test_initial_wasmtime_config() {
// Memory control
// GC
] {
let wasm_binary = BinaryEncodedWasm::new(
wat::parse_str(wat)
.unwrap_or_else(|_| panic!("Error parsing proposal `{proposal}` code snippet")),
);
let wasm_binary = BinaryEncodedWasm::new(wat::parse_str(wat).unwrap_or_else(|err| {
panic!("Error parsing proposal `{proposal}` code snippet: {err}")
}));
let err = validate_and_instrument_for_testing(
&WasmtimeEmbedder::new(EmbeddersConfig::default(), no_op_logger()),
&wasm_binary,
Expand Down

0 comments on commit d63549e

Please sign in to comment.