Stream: git-wasmtime

Topic: wasmtime / PR #9760 Procedurally generate Pulley Cranelif...


view this post on Zulip Wasmtime GitHub notifications bot (Dec 06 2024 at 21:15):

alexcrichton opened PR #9760 from alexcrichton:pulley-generate-isle to bytecodealliance:main:

This commit is an integration of the for_each_op! macro (and extended ops) for Cranelift. This procedurally generates a few new items for Cranelift's Pulley backend to use:

The Inst enum now has a Raw variant which contains a RawInst. In this manner the main Inst enum can still have pseudo-insts like Call, polymorphic instructions like loads/stores (probably gonna get refactored in the future though), and slightly different representations such as Inst::Trap having a TrapCode and RawInst::Trap wouldn't.

The goal of this commit is to lower the amount of effort to quickly add and experiment with new instructions in Pulley. Ideally it's now just (a) define them in the pulley macro, (b) implement a direct lowering rule, and (c) implement it in the interpreter. Ideally no need to implement anything else inside of Cranelift as everything should be auto-generated.

Many existing Inst variants have been deleted in favor of their equivalents in RawInst now. This undeniably increases the complexity of the Pulley backend but at least for me I find it well worth it to have all this boilerplate generated automatically.

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Dec 06 2024 at 21:15):

alexcrichton requested wasmtime-default-reviewers for a review on PR #9760.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 06 2024 at 21:15):

alexcrichton requested abrown for a review on PR #9760.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 06 2024 at 21:15):

alexcrichton requested wasmtime-compiler-reviewers for a review on PR #9760.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 06 2024 at 21:19):

alexcrichton commented on PR #9760:

Heh I was going to cc you @abrown on this as it's definitely related to your assembler work for x64 which I haven't reviewed myself yet. You're tagged as a reviewer here though so works well :)

If you've tried out various patterns for x64 that work well I'd be happy to update Pulley to match said patterns as well.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 06 2024 at 21:20):

alexcrichton updated PR #9760.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 06 2024 at 22:03):

alexcrichton updated PR #9760.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 06 2024 at 23:16):

alexcrichton updated PR #9760.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 08 2024 at 00:57):

alexcrichton commented on PR #9760:

The final commit of https://github.com/bytecodealliance/wasmtime/pull/9765 is an example of how adding a new instruction after this PR requires relatively minimal boilerplate (yay!)

view this post on Zulip Wasmtime GitHub notifications bot (Dec 10 2024 at 14:18):

fitzgen submitted PR review:

This looks great -- I'm going to go ahead and merge and if @abrown has feedback on the meta generation approach, we can address it in follow ups. This unblocks more pulley work, and the guide, and all that though, so I think it is important to move forward here now.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 10 2024 at 14:34):

fitzgen merged PR #9760.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 10 2024 at 19:30):

abrown commented on PR #9760:

Yeah, I recognize a lot of the same needs as in what I'm doing (assembler-collaborate). The assembler might get more involved but essentially I'll be doing similar things; I need to remember that this is where I put my newly-generated ISLE!


Last updated: Dec 23 2024 at 12:05 UTC