Stream: git-wasmtime

Topic: wasmtime / PR #7228 winch: Add a subset of known libcalls...


view this post on Zulip Wasmtime GitHub notifications bot (Oct 12 2023 at 21:17):

saulecabrera edited PR #7228:

This change is a follow up to:

One of the objectives of this change is to make it easy to emit function calls at the MacroAssembler layer, for cases in which it's challenging to know ahead-of-time if a particular functionality can be achieved natively (e.g. rounding and SSE4.2). The original implementation of function call emission, made this objective difficult to achieve and it was also difficult to reason about.
I decided to simplify the overall approach to function calls as part of this PR; in essence, the call module now exposes a single function FnCall::emit which is reponsible of gathtering the dependencies and orchestrating the emission of the call. This new approach deliberately avoids holding any state regarding the function call for simplicity.

This change also standardizes the usage of Callee as the main entrypoint for function call emission, as of this change 4 Callee types exist (Local, Builtin, Import, FuncRef), each callee kind is mappable to a CalleeKind which is the materialized version of a callee which Cranelift understands.

This change also moves the creation of the BuiltinFunctions to the ISA level given that they can be safely used accross multiple function compilations.

Finally, this change also introduces support for some of the "well-known" libcalls and hooks those libcalls at the MacroAssembler::float_round callsite.

--

prtest:full

<!--
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 (Oct 12 2023 at 22:09):

saulecabrera updated PR #7228.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 13 2023 at 00:06):

elliottt submitted PR review:

This is looking great, I'm so happy to see the default cases for fp rounding operations now!

view this post on Zulip Wasmtime GitHub notifications bot (Oct 13 2023 at 00:06):

elliottt submitted PR review:

This is looking great, I'm so happy to see the default cases for fp rounding operations now!

view this post on Zulip Wasmtime GitHub notifications bot (Oct 13 2023 at 00:06):

elliottt created PR review comment:

Similarly to the CodeGenContext parameters, can this be simplified down to using the 'a lifetime for everything?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 13 2023 at 00:06):

elliottt created PR review comment:

Awesome! :tada:

view this post on Zulip Wasmtime GitHub notifications bot (Oct 13 2023 at 00:06):

elliottt created PR review comment:

Does 'b actually outlive 'a here, or would it be possible to collapse these down to just 'a?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 13 2023 at 14:10):

saulecabrera submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 13 2023 at 14:10):

saulecabrera created PR review comment:

It actually outlives 'a; the changes in this PR make it so the compiled_function function at the ISA level gets a reference to BuiltinFunctions, which will outlive any of the other structs created in the body of the compile_function function (e.g. FuncEnv and VMOffsets) and on top of that, there's is a third lifetime ('data, previously 'c) which represents the lifetime of any references to the original WebAssembly binary through wasmtime_environ::ModuleTranslation.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 13 2023 at 14:10):

saulecabrera updated PR #7228.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 13 2023 at 14:11):

saulecabrera submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 13 2023 at 14:11):

saulecabrera created PR review comment:

Yeah, the same comment applies here too.

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

saulecabrera updated PR #7228.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 13 2023 at 19:47):

saulecabrera merged PR #7228.


Last updated: Oct 23 2024 at 20:03 UTC