Contributing support for a Wasm instruction to Winch - Shopify
Jul 18, 2023

Summary
This post details the technical process of adding support for new WebAssembly instructions to Winch, Wasmtime's baseline compiler. It outlines the six key steps involved: modifying the visitor, MacroAssembler, CodeGenContext, and assembler; adding tests; and executing fuzzing. The post explains the roles of each component, the interaction between them, and how to emit machine instructions using Cranelift's ISLE definitions. It also describes the testing methodologies, including filetests and differential fuzzing, and the challenges of cross-ISA testing.