Browse Source

Exposes new c-api functions for configuring relaxed SIMD (#6292)

* Exposes new c-api functions for configuring relaxed SIMD:

 - wasmtime_config_wasm_relaxed_simd_set(bool)
 - wasmtime_config_wasm_relaxed_simd_deterministic_set(bool)

* Applied rustfmt suggestion

* Added header file entries for new calls

* Fixed link to `relaxed simd proposal`
pull/6304/head
Martin Evans 2 years ago
committed by GitHub
parent
commit
5cce054a9f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      crates/c-api/include/wasmtime/config.h
  2. 13
      crates/c-api/src/config.rs
  3. 3
      crates/wasmtime/src/config.rs

16
crates/c-api/include/wasmtime/config.h

@ -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.

13
crates/c-api/src/config.rs

@ -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);

3
crates/wasmtime/src/config.rs

@ -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

Loading…
Cancel
Save