<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/rss.xsl.xml"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Changes in regalloc.rs</title>
    <description></description>
    <language>en</language>
    <copyright>Copyright 2015</copyright>
    <generator>Java</generator><item>
        <title>b112bb85 - Migrate winch-codegen to `wasmtime_environ::error` (#12297)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/winch/codegen/src/regalloc.rs#b112bb85</link>
        <description>Migrate winch-codegen to `wasmtime_environ::error` (#12297)

            List of files:
            /wasmtime-44.0.1/winch/codegen/src/regalloc.rs</description>
        <pubDate>Fri, 09 Jan 2026 19:20:48 +0000</pubDate>
        <dc:creator>Nick Fitzgerald &lt;fitzgen@gmail.com&gt;</dc:creator>
    </item>
<item>
        <title>90ac295e - Update Wasmtime to the 2024 Rust Edition (#10806)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/winch/codegen/src/regalloc.rs#90ac295e</link>
        <description>Update Wasmtime to the 2024 Rust Edition (#10806)* Update Wasmtime to the 2024 Rust EditionNow that our MSRV supports the 2024 edition it&apos;s possible to make thisswitch. This commit moves Wasmtime to the 2024 Edition to keepup-to-date with Rust idioms and access many of the edition featuresexclusive to the 2024 edition.prtest:full* Reformat with the 2024 edition

            List of files:
            /wasmtime-44.0.1/winch/codegen/src/regalloc.rs</description>
        <pubDate>Mon, 19 May 2025 16:40:55 +0000</pubDate>
        <dc:creator>Alex Crichton &lt;alex@alexcrichton.com&gt;</dc:creator>
    </item>
<item>
        <title>b93e1bc0 - winch: Gracefully handle compilation errors (#9851)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/winch/codegen/src/regalloc.rs#b93e1bc0</link>
        <description>winch: Gracefully handle compilation errors (#9851)* winch: Gracefully handle compilation errorsCloses: https://github.com/bytecodealliance/wasmtime/issues/8096This commit threads `anyhow::Result`  through most of Winch&apos;scompilation process in order to gracefully handle compilation errorsgracefully instead of panicking.The error classification is intentionally very granular, to avoid stringallocation which could impact compilation performance.The errors are largely fit in two categories:* Unimplemented/Unsupported* InternalThe firs category signals partial or no support for Wasmtime featuresand or Wasm proposals. These errors are meant to be temporary whilesuch features or proposals are in development.The second category signals that a compilation invariant was not met.These errors are considered internal and their presence usually meansa bug in the compiler.* Include `Result` in the MacroAssemblerThis commit updates the MacroAssembler trait to require returning`Result&lt;T&gt;`  on every method in the interface, making it easier todetect partial support for Masm instructions.

            List of files:
            /wasmtime-44.0.1/winch/codegen/src/regalloc.rs</description>
        <pubDate>Wed, 01 Jan 2025 18:11:39 +0000</pubDate>
        <dc:creator>Sa&#250;l Cabrera &lt;saulecabrera@gmail.com&gt;</dc:creator>
    </item>
<item>
        <title>a0442ea0 - Enforce `uninlined_format_args` for the workspace (#9065)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/winch/codegen/src/regalloc.rs#a0442ea0</link>
        <description>Enforce `uninlined_format_args` for the workspace (#9065)* Enforce `uninlined_format_args` for the workspace* fix: failing `Monolith Checks` job* fix: formatting

            List of files:
            /wasmtime-44.0.1/winch/codegen/src/regalloc.rs</description>
        <pubDate>Mon, 05 Aug 2024 09:59:59 +0000</pubDate>
        <dc:creator>Hamir Mahal &lt;hamirmahal@gmail.com&gt;</dc:creator>
    </item>
<item>
        <title>0e9121da - Fix some typos (#8641)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/winch/codegen/src/regalloc.rs#0e9121da</link>
        <description>Fix some typos (#8641)* occurred* winch typos* tests typos* cli typos* fuzz typos* examples typos* docs typos* crates/wasmtime typos* crates/environ typos* crates/cranelift typos* crates/test-programs typos* crates/c-api typos* crates/cache typos* crates other typos* cranelift/codegen/src/isa typos* cranelift/codegen/src other typos* cranelift/codegen other typos* cranelift other typos* ci js typo* .github workflows typo* RELEASES typo* Fix clang-format documentation line---------Co-authored-by: Andrew Brown &lt;andrew.brown@intel.com&gt;

            List of files:
            /wasmtime-44.0.1/winch/codegen/src/regalloc.rs</description>
        <pubDate>Thu, 16 May 2024 23:21:22 +0000</pubDate>
        <dc:creator>FrankReh &lt;FrankReh@users.noreply.github.com&gt;</dc:creator>
    </item>
<item>
        <title>d36d4708 - winch(arm64): fpu arithmetics (add, sub, mul, div, min, max) and regalloc (#8365)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/winch/codegen/src/regalloc.rs#d36d4708</link>
        <description>winch(arm64): fpu arithmetics (add, sub, mul, div, min, max) and regalloc (#8365)* winch(arm64): fpu arithmetics (add, sub, mul, div, min, max)Signed-off-by: Edoardo Vacchi &lt;evacchi@users.noreply.github.com&gt;* disas: add fpu test cases (add)Signed-off-by: Edoardo Vacchi &lt;evacchi@users.noreply.github.com&gt;* winch(arm64): regalloc for fpuSigned-off-by: Edoardo Vacchi &lt;evacchi@users.noreply.github.com&gt;* disas: add fpu test cases (add64)Signed-off-by: Edoardo Vacchi &lt;evacchi@users.noreply.github.com&gt;* disas: add fpu test casesSigned-off-by: Edoardo Vacchi &lt;evacchi@users.noreply.github.com&gt;* Apply suggestions from code reviewCo-authored-by: Sa&#250;l Cabrera &lt;saulecabrera@gmail.com&gt;* Apply suggestions from code reviewCo-authored-by: Sa&#250;l Cabrera &lt;saulecabrera@gmail.com&gt;* add todo for f32 movSigned-off-by: Edoardo Vacchi &lt;evacchi@users.noreply.github.com&gt;---------Signed-off-by: Edoardo Vacchi &lt;evacchi@users.noreply.github.com&gt;Co-authored-by: Sa&#250;l Cabrera &lt;saulecabrera@gmail.com&gt;

            List of files:
            /wasmtime-44.0.1/winch/codegen/src/regalloc.rs</description>
        <pubDate>Mon, 15 Apr 2024 19:42:28 +0000</pubDate>
        <dc:creator>Edoardo Vacchi &lt;evacchi@users.noreply.github.com&gt;</dc:creator>
    </item>
<item>
        <title>1b5c4ae8 - winch: Optimize calls (#7927)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/winch/codegen/src/regalloc.rs#1b5c4ae8</link>
        <description>winch: Optimize calls (#7927)* winch: Optimize callsThis commit introduces several optimizations to speed up the compilationof function calls:* Keep track of previously resolved function signatures for local or  imported callees to avoid computing the `ABISig` on every  function call.* Keep track of previously resolved type signatures for indirect calls  to avoid computing the `ABISig` on every function call.* Refactor `CallKnown` and `CallUnknown` instructions to make the  `BoxCallInfo` field in the struct optional. Prior to this change,  from Winch&apos;s perspective each call lowering involved a heap  allocation, using the default values for `BoxCallInfo`, which in the  end are not used by Winch.* Switch Winch&apos;s internal `Stack` to use a `SmallVec` rather than  a `Vec`. Many of the operations involving builtin function calls  require inserting elements at arbitrary offsets in the stack and  using a `SmallVec` makes this process more efficient.With the changes mentioned above, I observed ~30% improvement incompilation times for modules that are call-heavy.* Expect `CallInfo` where applicable and add a comment about the typedefinition* Remove unneeded types and lifetimes

            List of files:
            /wasmtime-44.0.1/winch/codegen/src/regalloc.rs</description>
        <pubDate>Wed, 14 Feb 2024 11:56:59 +0000</pubDate>
        <dc:creator>Sa&#250;l Cabrera &lt;saulecabrera@gmail.com&gt;</dc:creator>
    </item>
<item>
        <title>4b288ba8 - winch(x64): Call indirect (#7100)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/winch/codegen/src/regalloc.rs#4b288ba8</link>
        <description>winch(x64): Call indirect (#7100)* winch(x64): Call indirectThis change adds support for the `call_indirect` instruction to Winch.Libcalls are a pre-requisite for supporting `call_indirect` in order tolazily initialy funcrefs. This change adds support for libcalls toWinch by introducing a `BuiltinFunctions` struct similar to Cranelift&apos;s`BuiltinFunctionSignatures` struct.In general, libcalls are handled like any other function call, with theonly difference that given that not all the information to fulfill thefunction call might be known up-front, control is given to the callerfor finalizing the call.The introduction of function references also involves dealing withpointer-sized loads and stores, so this change also adds the requiredfunctionality to `FuncEnv` and `MacroAssembler` to be pointer aware,making it straight forward to derive an `OperandSize` or `WasmType` fromthe target&apos;s pointer size.Finally, given the complexity of the call_indirect instrunction, thischange bundles an improvement to the register allocator, allowing it totrack the allocatable vs non-allocatable registers, this is done toavoid any mistakes when allocating/de-allocating registers that are notalloctable.--prtest:full* Address review comments* Fix typos* Better documentation for `new_unchecked`* Introduce `max` for `BitSet`* Make allocatable property `u64`* winch(calls): Overhaul `FnCall`This commit simplifies `FnCall`&apos;s interface making its usage moreuniform throughout the compiler. In summary, this change:* Avoids side effects in the `FnCall::new` constructor, and also makes  it the only constructor.* Exposes `FnCall::save_live_registers` and  `FnCall::calculate_call_stack_space` to calculate the stack space  consumed by the call and so that the caller can decide which one to  use at callsites depending on their use-case.* tests: Fix regset tests

            List of files:
            /wasmtime-44.0.1/winch/codegen/src/regalloc.rs</description>
        <pubDate>Fri, 29 Sep 2023 16:59:40 +0000</pubDate>
        <dc:creator>Sa&#250;l Cabrera &lt;saulecabrera@gmail.com&gt;</dc:creator>
    </item>
<item>
        <title>2da108df - winch: Add support for parametric instructions (#6912)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/winch/codegen/src/regalloc.rs#2da108df</link>
        <description>winch: Add support for parametric instructions (#6912)* winch: Add support for parametric instructionsThis commit introduces support for the drop and select instructions.Additionally, it refactors the CodeGenContext::drop_last implementation,enhancing flexibility for callers to determine the handling of elements to bedropped. This refactoring simplifies scenarios where a Memory entry is at thetop of the stack.* refactor: Use `cmov` instead of local control flow

            List of files:
            /wasmtime-44.0.1/winch/codegen/src/regalloc.rs</description>
        <pubDate>Fri, 25 Aug 2023 17:57:07 +0000</pubDate>
        <dc:creator>Sa&#250;l Cabrera &lt;saulecabrera@gmail.com&gt;</dc:creator>
    </item>
<item>
        <title>14b39bc2 - winch: Initial support for floats (#6860)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/winch/codegen/src/regalloc.rs#14b39bc2</link>
        <description>winch: Initial support for floats (#6860)* winch: Initial support for floatsThis change introuduces the necessary building blocks to support floats inWinch as well as support for both `f32.const` and `f64.const` instructions.To achieve support for floats, this change adds several key enhancements to thecompiler:* Constant pool: A constant pool is implemented, at the Assembler level, using the machinery  exposed by Cranelift&apos;s `VCode` and `MachBuffer`. Float immediates are stored  using their bit representation in the value stack, and whenever they are  used at the MacroAssembler level they are added to the constant  pool, from that point on, they are referenced through a `Constant` addressing  mode, which gets translated to a RIP-relative addressing mode during emission.* More precise value tagging: aside from immediates, from which the type can  be easily inferred, all the other value stack entries (`Memory`, `Reg`, and `Local`) are  modified to explicitly contain a WebAssembly type. This allows for better  instruction selection.--prtest:full* fix: Account for relative sp position when pushing float regsThis was an oversight of the initial implementation. When pushing floatregisters, always return an address that is relative to the current position ofthe stack pointer, essentially storing to (%rsp). The previous implementationaccounted for static addresses, which is not correct.* fix: Introduce `stack_arg_slot_size_for_type`To correctly calculate the stack argument slot sizes, instead of overallocatingfor `word_bytes`, since for `f32` floating points we only need to worry aboutloading/storing 4 bytes.* fix: Correctly type the result register.The previous version wrongly typed the register as a general purpose register.* refactor: Re-write `add_constants` through `add_constant`* docs: Replace old comment* chore: Rust fmt* refactor: Index regset per register classThis commit implements `std::ops::{Index, IndexMut}` for `RegSet` to index eachof the bitsets by class. This reduces boilerplate and repetition throuhg thecode generation context, register allocator and register set.* refactor: Correctly size callee saved registersTo comply with the expectation of the underlying architecture: for example inAarch64, only the low 64 bits of VRegs are callee saved (the D-view) and in the`fastcall` calling convention it&apos;s expected that the callee saves the entire 128bits of the register xmm6-xmm15.This change also fixes the the stores/loads of callee saved float registers in thefastcall calling convention, as in the previous implementation only the low 64bits were saved/restored.* docs: Add comment regarding typed-based spills

            List of files:
            /wasmtime-44.0.1/winch/codegen/src/regalloc.rs</description>
        <pubDate>Wed, 23 Aug 2023 10:44:35 +0000</pubDate>
        <dc:creator>Sa&#250;l Cabrera &lt;saulecabrera@gmail.com&gt;</dc:creator>
    </item>
<item>
        <title>20c58362 - winch: Implement new trampolines (#6358)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/winch/codegen/src/regalloc.rs#20c58362</link>
        <description>winch: Implement new trampolines (#6358)* winch: Implement new trampolinesThis change is a follow-up tohttps://github.com/bytecodealliance/wasmtime/pull/6262, in which the newtrampolines, described [here](https://github.com/bytecodealliance/rfcs/blob/main/accepted/tail-calls.md#new-trampolines-and-vmcallercheckedanyfunc-changes),were introduced to Wasmtime.This change, focuses on the `array-to-wasm`,`native-to-wasm` and `wasm-to-native` trampolines to restore Winch&apos;sworking state prior to the introduction of the new trampolines. It&apos;sworth noting that the new approach for trampolines make it easier to supportthe `TypedFunc` API in Winch. Prior to the introduction of the newtrampolines, it was not obvious how to approach it.This change also introduces a pinned register that will hold the`VMContext` pointer, which is loaded in the `*-to-wasm`  trampolines;the `VMContext`  register is a pre-requisite to this change to supportthe `wasm-to-native` trampolines.Lastly, with the introduction of the `VMContext` register and the`wasm-to-native` trampolines, this change also introduces support forcalling function imports, which is a variation of the already existingcalls to locally defined functions.The other notable piece of this change aside from the trampolines is`winch-codegen`&apos;s dependency on `wasmtime-environ`. Winch is so closelytied to the concepts exposed by the wasmtime crates that it makes senseto tie them together, even though the separation provides someadvantages like easier testing in some cases, in the long run, there&apos;sprobably going to be less need to test Winch in isolation and ratherwe&apos;d rely more on integration style tests which require all of Wasmtimepieces anyway (fuzzing, spec tests, etc).This change doesn&apos;t update the  existing implmenetation of`winch_codegen::FuncEnv`, but the intention is to update that part afterthis change.prtest:full* tests: Ignore miri in Winch integration tests* Remove hardcoded alignment and addend

            List of files:
            /wasmtime-44.0.1/winch/codegen/src/regalloc.rs</description>
        <pubDate>Tue, 16 May 2023 17:32:04 +0000</pubDate>
        <dc:creator>Sa&#250;l Cabrera &lt;saulecabrera@gmail.com&gt;</dc:creator>
    </item>
<item>
        <title>af4d94c8 - winch(x64): Initial implementation for function calls (#6067)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/winch/codegen/src/regalloc.rs#af4d94c8</link>
        <description>winch(x64): Initial implementation for function calls (#6067)* winch(x64): Initial implementation for function callsThis change adds the main building blocks for calling locally definedfunctions. Support for function imports will be added iteratively after thischange lands and once trampolines are supported.To support function calls, this change introduces the following functionality tothe MacroAssembler:* `pop` to pop the machine stack into a given register, which in the case ofthis change, translates to the x64 pop instruction.* `call` to a emit a call to locally defined functions.* `address_from_sp` to construct memory addresses with the SP as a base.* `free_stack` to emit the necessary instrunctions to claim stack space.The heavy lifting of setting up and emitting the function call is done throughthe implementation of `FnCall`.* Fix spill behaviour in function calls and add more documentationThis commits adds a more detailed documentation to the `call.rs` module.It also fixes a couple of bugs, mainly:* The previous commit didn&apos;t account for memory addresses used as arguments forthe function call, any memory entry in the value stack used as a functionargument should be tracked and then used to claim that memory when the functioncall ends. We could `pop` and do this implicitly, but we can also track thisdown and emit a single instruction to decrement the stack pointer, which willresult in better code.* Introduce a differentiator between addresses relative or absolute to the stackpointer. When passing arguments in the stack -- assuming that SP at that pointis aligned for the function call -- we should store the arguments relative tothe absolute position of the stack pointer and when addressing a memory entry inthe Wasm value stack, we should use an address relative to the offset and theposition of the stack pointer.* Simplify tracking of the stack space needed for emitting a function call

            List of files:
            /wasmtime-44.0.1/winch/codegen/src/regalloc.rs</description>
        <pubDate>Tue, 28 Mar 2023 18:30:31 +0000</pubDate>
        <dc:creator>Sa&#250;l Cabrera &lt;saulecabrera@gmail.com&gt;</dc:creator>
    </item>
<item>
        <title>7ec92512 - winch: Add support for the `&lt;i32|i64&gt;.div_*` instructions (#5807)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/winch/codegen/src/regalloc.rs#7ec92512</link>
        <description>winch: Add support for the `&lt;i32|i64&gt;.div_*` instructions (#5807)* Refactor the structure and responsibilities of `CodeGenContext`This commit refactors how the `CodeGenContext` is used throughout the codegeneration process, making it easier to pass it around when more flexibility isdesired in the MacroAssembler to perform the lowering of certain instructions.As of this change, the responsibility of the `CodeGenContext` is to provide aninterface for operations that require an orchestration between the registerallocator, the value stack and function&apos;s frame. The MacroAssembler is removedfrom the CodeGenContext as is passed as a dependency where needed, effectlyusing it as an independent code generation interface only.By giving more responsibilities to the `CodeGenContext` we can clearly separatethe concerns of the register allocator, which previously did more than itshould (e.g. popping values and spilling).This change ultimately allows passing in the `CodeGenContext` to the`MacroAssembler` when a given instruction cannot be generically describedthrough a common interface. Allowing each implementation to decide the best wayto lower a particular instruction.* winch: Add support for the WebAssembly `&lt;i32|i64&gt;.div_*` instructionsGiven that some architectures have very specific requirements on how to handledivision, this change uses `CodeGenContext` as a dependency to the `div`MacroAssembler instruction to ensure that each implementation can decide on how to lower thedivision. This approach also allows -- in architectures where division can beexpressed as an ordinary binary operation -- to rely on the`CodeGenContext::i32_binop` or `CodeGenContext::i64_binop` helpers.

            List of files:
            /wasmtime-44.0.1/winch/codegen/src/regalloc.rs</description>
        <pubDate>Fri, 17 Feb 2023 22:42:03 +0000</pubDate>
        <dc:creator>Sa&#250;l Cabrera &lt;saulecabrera@gmail.com&gt;</dc:creator>
    </item>
<item>
        <title>7c5c7e4b - winch: Add full support for integer `sub` and `add` instructions (#5737)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/winch/codegen/src/regalloc.rs#7c5c7e4b</link>
        <description>winch: Add full support for integer `sub` and `add` instructions (#5737)This patch adds complete support for the `sub` and `add` WebAssembly instructionsfor x64, and complete support for the `add` WebAssembly instruction for aarch64.This patch also refactors how the binary operations get constructed within the`VisitOperator` trait implementation. The refactor adds methods in the`CodeGenContext` to abstract all the common steps to emit binary operations,making this process less repetitive and less brittle (e.g. omitting to push the resulting valueto the stack, or omitting to free registers after used).This patch also improves test coverage and refactors the filetests directory to make iteasier to add tests for other instructions.

            List of files:
            /wasmtime-44.0.1/winch/codegen/src/regalloc.rs</description>
        <pubDate>Thu, 09 Feb 2023 01:01:44 +0000</pubDate>
        <dc:creator>Sa&#250;l Cabrera &lt;saulecabrera@gmail.com&gt;</dc:creator>
    </item>
<item>
        <title>f5f517e8 - winch: Small clean-up for x64 (#5691)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/winch/codegen/src/regalloc.rs#f5f517e8</link>
        <description>winch: Small clean-up for x64 (#5691)This commit contains a small set of clean up items for x64.Notably:* Adds filetests* Documents why 16 for the arg base offset abi implementation, for clarity.* Fixes a bug in the spill implementation caught while anlyzing thefiletests results. The fix consists of emitting a load instead of a store intothe scratch register before spiiling its value.* Remove dead code for pretty printing registers which is not needed anymoresince we now have proper disassembly.

            List of files:
            /wasmtime-44.0.1/winch/codegen/src/regalloc.rs</description>
        <pubDate>Thu, 02 Feb 2023 16:40:31 +0000</pubDate>
        <dc:creator>Sa&#250;l Cabrera &lt;saulecabrera@gmail.com&gt;</dc:creator>
    </item>
<item>
        <title>94b51cdb - winch: Use cranelift-codegen x64 backend for emission. (#5581)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/winch/codegen/src/regalloc.rs#94b51cdb</link>
        <description>winch: Use cranelift-codegen x64 backend for emission. (#5581)This change substitutes the string based emission mechanism withcranelift-codegen&apos;s x64 backend.This change _does not_:* Introduce new functionality in terms of supported instructions.* Change the semantics of the assembler/macroassembler in terms of the logic toemit instructions.The most notable differences between this change and the previous version are:* Handling of shared flags and ISA-specific flags, which for now are left withthe default value.* Simplification of instruction emission per operand size: previously theassembler defined different methods depending on the operand size (e.g. `mov`for 64 bits, and `movl` for 32 bits). This change updates such approach so thateach assembler method takes an operand size as a parameter, reducing duplicationand making the code more concise and easier to integrate with the x64&apos;s `Inst` enum.* Introduction of a disassembler for testing purposes.As of this change, Winch generates the following code for the following testprograms:```wat(module  (export &quot;main&quot; (func $main))  (func $main (result i32)        (i32.const 10)        (i32.const 20)        i32.add        ))``````asm   0:	55                   	push	rbp   1:	48 89 e5             	mov	rbp, rsp   4:	b8 0a 00 00 00       	mov	eax, 0xa   9:	83 c0 14             	add	eax, 0x14   c:	5d                   	pop	rbp   d:	c3                   	ret``````wat(module  (export &quot;main&quot; (func $main))  (func $main (result i32)        (local $foo i32)    (local $bar i32)        (i32.const 10)    (local.set $foo)        (i32.const 20)    (local.set $bar)        (local.get $foo)        (local.get $bar)        i32.add        ))``````asm   0:	55                   	push	rbp   1:	48 89 e5             	mov	rbp, rsp   4:	48 83 ec 08          	sub	rsp, 8   8:	48 c7 04 24 00 00 00 00	mov	qword ptr [rsp], 0  10:	b8 0a 00 00 00       	mov	eax, 0xa  15:	89 44 24 04          	mov	dword ptr [rsp + 4], eax  19:	b8 14 00 00 00       	mov	eax, 0x14  1e:	89 04 24             	mov	dword ptr [rsp], eax  21:	8b 04 24             	mov	eax, dword ptr [rsp]  24:	8b 4c 24 04          	mov	ecx, dword ptr [rsp + 4]  28:	01 c1                	add	ecx, eax  2a:	48 89 c8             	mov	rax, rcx  2d:	48 83 c4 08          	add	rsp, 8  31:	5d                   	pop	rbp  32:	c3                   	ret``````wat(module  (export &quot;main&quot; (func $main))  (func $main (param i32) (param i32) (result i32)        (local.get 0)        (local.get 1)        i32.add        ))``````asm   0:	55                   	push	rbp   1:	48 89 e5             	mov	rbp, rsp   4:	48 83 ec 08          	sub	rsp, 8   8:	89 7c 24 04          	mov	dword ptr [rsp + 4], edi   c:	89 34 24             	mov	dword ptr [rsp], esi   f:	8b 04 24             	mov	eax, dword ptr [rsp]  12:	8b 4c 24 04          	mov	ecx, dword ptr [rsp + 4]  16:	01 c1                	add	ecx, eax  18:	48 89 c8             	mov	rax, rcx  1b:	48 83 c4 08          	add	rsp, 8  1f:	5d                   	pop	rbp  20:	c3                   	ret```

            List of files:
            /wasmtime-44.0.1/winch/codegen/src/regalloc.rs</description>
        <pubDate>Wed, 18 Jan 2023 11:58:13 +0000</pubDate>
        <dc:creator>Sa&#250;l Cabrera &lt;saulecabrera@gmail.com&gt;</dc:creator>
    </item>
<item>
        <title>835abbcd - Initial skeleton for Winch (#4907)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/winch/codegen/src/regalloc.rs#835abbcd</link>
        <description>Initial skeleton for Winch (#4907)* Initial skeleton for WinchThis commit introduces the initial skeleton for Winch, the &quot;baseline&quot;compiler.This skeleton contains mostly setup code for the ISA, ABI, registers,and compilation environment abstractions. It also includes thecalculation of function local slots.As of this commit, the structure of these abstractions looks like thefollowing:                        +------------------------+                        |                        v     +----------+     +-----+     +-----------+-----+-----------------+     | Compiler | --&gt; | ISA | --&gt; | Registers | ABI | Compilation Env |     +----------+     +-----+     +-----------+-----+-----------------+                        |                              ^                        +------------------------------+* Compilation environment will hold a reference to the function data* Add basic documentation to the ABI trait* Enable x86 and arm64 in cranelift-codegen* Add reg_name function for x64* Introduce the concept of a MacroAssembler and AssemblerThis commit introduces the concept of a MacroAsesembler andAssembler. The MacroAssembler trait will provide a high enoughinterface across architectures so that each ISA implementation can use their own low-levelAssembler implementation to fulfill the interface. Each Assembler willprovide a 1-1 mapping to each ISA instruction.As of this commit, only a partial debug implementation is provided forthe x64 Assembler.* Add a newtype over PRegAdds a newtype `Reg` over regalloc2::PReg; this ensures that Winchwill operate only on the concept of `Reg`. This change is temporaryuntil we have the necessary machinery to share a common Regabstraction via `cranelift_asm`* Improvements to local calcuation- Add `LocalSlot::addressed_from_sp`- Use `u32` for local slot and local sizes calculation* Add helper methods to ABIArgAdds helper methods to retrieve register and type information from the argument* Make locals_size public in frame* Improve x64 register naming depending on size* Add new methods to the masm interfaceThis commit introduces the ability for the MacroAssembler to reservestack space, get the address of a given local and perform a stackstore based on the concept of `Operand`s.There are several motivating factors to introduce the concept of anOperand:- Make the translation between Winch and Cranelift easier;- Make dispatching from the MacroAssembler to the underlying Assembler- easier by minimizing the amount of functions that we need to define- in order to satisfy the store/load combinationsThis commit also introduces the concept of a memory address, whichessentially describes the addressing modes; as of this commit only oneaddressing mode is supported. We&apos;ll also need to verify that thisstructure will play nicely with arm64.* Blank masm implementation for arm64* Implementation of reserve_stack, local_address, store and fp_offsetfor x64* Implement function prologue and argument register spilling* Add structopt and wat* Fix debug instruction formatting* Make TargetISA trait publicly accessible* Modify the MacroAssembler finalize siganture to return a slice of strings* Introduce a simple CLI for WinchTo be able to compile Wasm programs with Winch independently. Mostlymeant for testing / debugging* Fix bug in x64 assembler mov_rm* Remove unused import* Move the stack slot calculation to the FrameThis commit moves the calculation of the stack slots to the framehandler abstraction and also includes the calculation of the limitsfor the function defined locals, which will be used to zero the localsthat are not associated to function arguments* Add i32 and i64 constructors to local slots* Introduce the concept of DefinedLocalsRangeThis commit introduces `DefinedLocalsRange` to track the stack offsetat which the function-defined locals start and end; this is later usedto zero-out that stack region* Add constructors for int and float registers* Add a placeholder stack implementation* Add a regset abstraction to track register availabilityAdds a bit set abstraction to track register availability for registerallocation.The bit set has no specific knowledge about physical registers, itworks on the register&apos;s hardware encoding as the source of truth.Each RegSet is expected to be created with the universe of allocatableregisters per ISA when starting the compilation of a particular function.* Add an abstraction over register and immediateThis is meant to be used as the source for stores.* Add a way to zero local slots and an initial skeletion of regallocThis commit introduces `zero_local_slots` to the MacroAssembler; whichensures that function defined locals are zeroed out when starting thefunction body.The algorithm divides the defined function locals stack rangeinto 8 byte slots and stores a zero at each address. This processrelies on register allocation if the amount of slots that need to beinitialized is greater than 1. In such case, the next availableregister is requested to the register set and it&apos;s used to store a 0,which is then stored at every local slot* Update to wasmparser 0.92* Correctly track if the regset has registers available* Add a result entry to the ABI signatureThis commuit introduces ABIResult as part of the ABISignature;this struct will track how function results are stored; initially itwill consiste of a single register that will be requested to theregister allocator at the end of the function; potentially causing a spill* Move zero local slots and add more granular methods to the masmThis commit removes zeroing local slots from the MacroAssembler andinstead adds more granular methods to it (e.g `zero`, `add`).This allows for better code sharing since most of the work done by thealgorithm for zeroing slots will be the same in all targets, exceptfor the binary emissions pieces, which is what gets delegated to the masm* Use wasmparser&apos;s visitor API and add initial support for const and addThis commit adds initial support for the I32Const and I32instructions; this involves adding a minimum for registerallocation. Note that some regalloc pieces are still incomplete, sincefor the current set of supported instructions they are not needed.* Make the ty field public in Local* Add scratch_reg to the abi* Add a method to get a particular local from the Frame* Split the compilation environment abstractionThis commit splits the compilation environment into two more conciseabstractions:1. CodeGen: the main abstraction for code generation2. CodeGenContext: abstraction that shares the common pieces forcompilation; these pieces are shared between the code generator andthe register allocator* Add `push` and `load` to the MacroAssembler* Remove dead code warnings for unused paths* Map ISA features to cranelift-codegen ISA features* Apply formatting* Fix Cargo.toml after a bad rebase* Add component-compiler feature* Use clap instead of structopt* Add winch to publish.rs script* Minor formatting* Add tests to RegSet and fix two bugs when freeing and checking forregister availability* Add tests to Stack* Free source register after a non-constant i32 add* Improve comments- Remove unneeded comments- And improve some of the TODO items* Update default features* Drop the ABI generic param and pass the word_size information directlyTo avoid dealing with dead code warnings this commit passes the wordsize information directly, since it&apos;s the only piece of informationneeded from the ABI by Codegen until now* Remove dead codeThis piece of code will be put back once we start integrating Winchwith Wasmtime* Remove unused enum variantThis variant doesn&apos;t get constructed; it should be added back once abackend is added and not enabled by default or when Winch getsintegrated into Wasmtime* Fix unused code in regset tests* Update spec testsuite* Switch the visitor pattern for a simpler operator matchThis commit removes the usage of wasmparser&apos;s visitor pattern andinstead defaults to a simpler operator matching approach. This removesthe complexity of having to define all the visitor trait functions at once.* Use wasmparser&apos;s Visitor trait with a different macro strategyThis commit puts back wasmparser&apos;s Visitor trait, with a sigle;simpler macro, only used for unsupported operators.* Restructure WinchThis commit restuructures Winch&apos;s parts. It divides the initialapproach into three main crates: `winch-codegen`,`wasmtime-winch` and `winch-tools`.`wasmtime-winch` is reponsible for the Wasmtime-Winch integration.`winch-codegen` is solely responsible for code generation.`winch-tools` is CLI tool to compile Wasm programs, mainly for testing purposes.* Refactor zero local slotsThis commit moves the logic of zeroing local slots from the codegenmodule into a method with a default implementation in theMacroAssembler trait: `zero_mem_range`.The refactored implementation is very similar to the previousimplementation with the only differencethat it doesn&apos;t allocates a general-purpose register; it instead usesthe register allocator to retrieve the scratch register and uses thisregister to unroll the series of zero stores.* Tie the codegen creation to the ISA ABIThis commit makes the relationship between the ISA ABI and the codegenexplicit. This allows us to pass down ABI-specific bit and pieces tothe codegeneration. In this case the only concrete piece that we needis the ABI word size.* Mark winch as publishable directory* Revamp winch docsThis commit ensures that all the code comments in Winch are compliantwith the syle used in the rest of Wasmtime&apos;s codebase.It also imptoves, generally the quality of the comments in some modules.* Panic when using multi-value when the target is aarch64Similar to x64, this commit ensures that the abi signature of thecurrent function doesn&apos;t use multi-value returns* Document the usage of directives* Use endianness instead of endianess in the ISA trait* Introduce a three-argument form in the MacroAssemblerThis commit introduces the usage of three-argument form for theMacroAssembler interface. This allows for a natural mapping forarchitectures like aarch64. In the case of x64, the implementation cansimply restrict the implementation asserting for equality in two ofthe arguments of defaulting to a differnt set of instructions.As of this commit, the implementation of `add` panics if thedestination and the first source arguments are not equal; internallythe x64 assembler implementation will ensure that all the allowedcombinations of `add` are satisfied. The reason for panicking and notemitting a `mov` followed by an `add` for example is simply because registerallocation happens right before calling `add`, which ensures anyregister-to-register moves, if needed.This implementation will evolve in the future and this panic will belifted if needed.* Improve the documentation for the MacroAssembler.Documents the usage of three-arg form and the intention around thehigh-level interface.* Format comments in remaining modules* Clean up Cargo.toml for winch piecesThis commit adds missing fields to each of Winch&apos;s Cargo.toml.* Use `ModuleTranslation::get_types()` to derive the function type* Assert that start range is always word-size aligned

            List of files:
            /wasmtime-44.0.1/winch/codegen/src/regalloc.rs</description>
        <pubDate>Fri, 28 Oct 2022 21:19:34 +0000</pubDate>
        <dc:creator>Sa&#250;l Cabrera &lt;saulecabrera@gmail.com&gt;</dc:creator>
    </item>
</channel>
</rss>
