//===-- README.txt - Notes for WebAssembly code gen -----------------------===// The object format emitted by the WebAssembly backed is documented in: * https://github.com/WebAssembly/tool-conventions/blob/main/Linking.md The C ABI is described in: * https://github.com/WebAssembly/tool-conventions/blob/main/BasicCABI.md For more information on WebAssembly itself, see the home page: * https://webassembly.github.io/ Emscripten provides a C/C++ compilation environment based on clang which includes standard libraries, tools, and packaging for producing WebAssembly applications that can run in browsers and other environments. wasi-sdk provides a more minimal C/C++ SDK based on clang, llvm and a libc based on musl, for producing WebAssemmbly applictions that use the WASI ABI. Rust provides WebAssembly support integrated into Cargo. There are two main options: - wasm32-unknown-unknown, which provides a relatively minimal environment that has an emphasis on being "native" - wasm32-unknown-emscripten, which uses Emscripten internally and provides standard C/C++ libraries, filesystem emulation, GL and SDL bindings For more information, see: * https://www.hellorust.com/ The following documents contain some information on the semantics and binary encoding of WebAssembly itself: * https://github.com/WebAssembly/design/blob/main/Semantics.md * https://github.com/WebAssembly/design/blob/main/BinaryEncoding.md Some notes on ways that the generated code could be improved follow: //===---------------------------------------------------------------------===// Br, br_if, and br_table instructions can support having a value on the value stack across the jump (sometimes). We should (a) model this, and (b) extend the stackifier to utilize it. //===---------------------------------------------------------------------===// The min/max instructions aren't exactly a