Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose new c-api functions for configuring relaxed SIMD #6292

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions crates/c-api/include/wasmtime/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,22 @@ WASMTIME_CONFIG_PROP(void, wasm_reference_types, bool)
*/
WASMTIME_CONFIG_PROP(void, wasm_simd, bool)

/**
* \brief Configures whether the WebAssembly relaxed SIMD proposal is
* enabled.
*
* This setting is `false` by default.
*/
WASMTIME_CONFIG_PROP(void, wasm_relaxed_simd, bool)

/**
* \brief Configures whether the WebAssembly relaxed SIMD proposal is
* in deterministic mode.
*
* This setting is `false` by default.
*/
WASMTIME_CONFIG_PROP(void, wasm_relaxed_simd_deterministic, bool)

/**
* \brief Configures whether the WebAssembly bulk memory proposal is
* enabled.
Expand Down
13 changes: 13 additions & 0 deletions crates/c-api/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,19 @@ pub extern "C" fn wasmtime_config_wasm_simd_set(c: &mut wasm_config_t, enable: b
c.config.wasm_simd(enable);
}

#[no_mangle]
pub extern "C" fn wasmtime_config_wasm_relaxed_simd_set(c: &mut wasm_config_t, enable: bool) {
c.config.wasm_relaxed_simd(enable);
}

#[no_mangle]
pub extern "C" fn wasmtime_config_wasm_relaxed_simd_deterministic_set(
c: &mut wasm_config_t,
enable: bool,
) {
c.config.relaxed_simd_deterministic(enable);
}

#[no_mangle]
pub extern "C" fn wasmtime_config_wasm_bulk_memory_set(c: &mut wasm_config_t, enable: bool) {
c.config.wasm_bulk_memory(enable);
Expand Down
3 changes: 1 addition & 2 deletions crates/wasmtime/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -666,8 +666,7 @@ impl Config {
///
/// The [WebAssembly SIMD proposal][proposal]. This feature gates items such
/// as the `v128` type and all of its operators being in a module. Note that
/// this does not enable the [relaxed simd proposal] as that is not
/// implemented in Wasmtime at this time.
/// this does not enable the [relaxed simd proposal].
///
/// On x86_64 platforms note that enabling this feature requires SSE 4.2 and
/// below to be available on the target platform. Compilation will fail if
Expand Down