Skip to content

Commit

Permalink
Flag pulley as not supporting most wasm features (#9648)
Browse files Browse the repository at this point in the history
This commit updates `Config::compiler_panicking_wasm_features` to
include most wasm features for pulley targets. These backends in
Cranelift don't support most instructions at this time and have lots of
`todo!()`-related panics here and there. This won't completely cover all
panics but it's at least a start.
  • Loading branch information
alexcrichton authored Nov 21, 2024
1 parent b03ef2f commit 0343d2e
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion crates/wasmtime/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1898,7 +1898,42 @@ impl Config {
fn compiler_panicking_wasm_features(&self) -> WasmFeatures {
#[cfg(any(feature = "cranelift", feature = "winch"))]
match self.compiler_config.strategy {
None | Some(Strategy::Cranelift) => WasmFeatures::empty(),
None | Some(Strategy::Cranelift) => match self.compiler_target().architecture {
// Pulley doesn't support most of wasm at this time and there's
// lots of panicking bits and pieces within the backend. This
// doesn't fully cover all panicking cases but it's at least a
// starting place to have a ratchet. As the pulley backend is
// developed this'll get filtered down over time.
target_lexicon::Architecture::Pulley32 | target_lexicon::Architecture::Pulley64 => {
WasmFeatures::SATURATING_FLOAT_TO_INT
| WasmFeatures::SIGN_EXTENSION
| WasmFeatures::REFERENCE_TYPES
| WasmFeatures::MULTI_VALUE
| WasmFeatures::BULK_MEMORY
| WasmFeatures::SIMD
| WasmFeatures::RELAXED_SIMD
| WasmFeatures::THREADS
| WasmFeatures::SHARED_EVERYTHING_THREADS
| WasmFeatures::TAIL_CALL
| WasmFeatures::FLOATS
| WasmFeatures::MULTI_MEMORY
| WasmFeatures::EXCEPTIONS
| WasmFeatures::MEMORY64
| WasmFeatures::EXTENDED_CONST
| WasmFeatures::FUNCTION_REFERENCES
| WasmFeatures::MEMORY_CONTROL
| WasmFeatures::GC
| WasmFeatures::CUSTOM_PAGE_SIZES
| WasmFeatures::LEGACY_EXCEPTIONS
| WasmFeatures::GC_TYPES
| WasmFeatures::STACK_SWITCHING
| WasmFeatures::WIDE_ARITHMETIC
}

// Other Cranelift backends are either 100% missing or complete
// at this time, so no need to further filter.
_ => WasmFeatures::empty(),
},
Some(Strategy::Winch) => {
let mut unsupported = WasmFeatures::GC
| WasmFeatures::FUNCTION_REFERENCES
Expand Down

0 comments on commit 0343d2e

Please sign in to comment.