Stream: git-wasmtime

Topic: wasmtime / issue #6220 Optimize sign extension via shifts


view this post on Zulip Wasmtime GitHub notifications bot (Apr 17 2023 at 16:13):

alexcrichton commented on issue #6220:

Indeed! This is inspired by LLVM's alternate lowerings for casts in Rust which produce different sequences of wasm instructions. Piping these through Cranelift the old shift-based lowering generates two shifts while the "new" i32.extend8_s generates a single movsx instruction. Given that ireduce is typically a noop with respect to backends I figured it'd be good to get this two-instruction folding into a single-instruction folding. Additionally I figured that the purpose of adding i32.extend8_s was to be a bit more optimal/compact and we may as well try to represent both of these equivalently in the IR.

I'll add some tests though to the backend for the codegen too!


Last updated: Dec 23 2024 at 12:05 UTC