Expose cranelift nan canonicalization config via C API (#4154)
* Add cranelift_nan_canonicalization to c api header * Add cranelift_nan_canonicalization to capi/config.rs * Fix func name
This commit is contained in:
committed by
GitHub
parent
2e14a0ecc5
commit
8d7bccefcb
@@ -213,6 +213,19 @@ WASMTIME_CONFIG_PROP(wasmtime_error_t*, strategy, wasmtime_strategy_t)
|
||||
*/
|
||||
WASMTIME_CONFIG_PROP(void, cranelift_debug_verifier, bool)
|
||||
|
||||
/**
|
||||
* \brief Configures whether Cranelift should perform a NaN-canonicalization pass.
|
||||
*
|
||||
* When Cranelift is used as a code generation backend this will configure
|
||||
* it to replace NaNs with a single canonical value. This is useful for users
|
||||
* requiring entirely deterministic WebAssembly computation.
|
||||
*
|
||||
* This is not required by the WebAssembly spec, so it is not enabled by default.
|
||||
*
|
||||
* The default value for this is `false`
|
||||
*/
|
||||
WASMTIME_CONFIG_PROP(void, cranelift_nan_canonicalization, bool)
|
||||
|
||||
/**
|
||||
* \brief Configures Cranelift's optimization level for JIT code.
|
||||
*
|
||||
|
||||
@@ -120,6 +120,14 @@ pub extern "C" fn wasmtime_config_cranelift_debug_verifier_set(
|
||||
c.config.cranelift_debug_verifier(enable);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn wasmtime_config_cranelift_nan_canonicalization_set(
|
||||
c: &mut wasm_config_t,
|
||||
enable: bool,
|
||||
) {
|
||||
c.config.cranelift_nan_canonicalization(enable);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn wasmtime_config_cranelift_opt_level_set(
|
||||
c: &mut wasm_config_t,
|
||||
|
||||
Reference in New Issue
Block a user