Stream: git-wasmtime

Topic: wasmtime / PR #9084 riscv64: Refactor Floating Point Inst...


view this post on Zulip Wasmtime GitHub notifications bot (Aug 07 2024 at 14:12):

afonso360 opened PR #9084 from afonso360:riscv-refactor-float to bytecodealliance:main:

:wave: Hey,

This is a refactor to the floating point instruction emission code for RISC-V.

All FP instructions include a 2 bit field that denotes the width of the arguments, from FP16 up to FP128. In the current code that is part of the opcode, and we replicate opcodes between FP32 and FP64.

With this PR we now encode the width on a separate field, and make the opcodes width agnostic, which should simplify the introduction of FP16 and FP128 instructions.

There shouldn't be any bytecode changes with this PR. The one formatting change we have is due to us previously hiding the selected FRM mode for fcvt.d.{w,wu} instructions, which shouldn't have been hidden since, we don't do the same for their fcvt.s variants. Additionally these instructions change their results based on FRM so we should probably show it anyway.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 07 2024 at 14:12):

afonso360 requested wasmtime-compiler-reviewers for a review on PR #9084.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 07 2024 at 14:12):

afonso360 requested elliottt for a review on PR #9084.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 07 2024 at 14:17):

afonso360 updated PR #9084.

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

afonso360 edited PR #9084:

:wave: Hey,

This is a refactor to the floating point instruction emission code for RISC-V.

All FP instructions include a 2 bit field that denotes the width of the arguments, from FP16 up to FP128. In the current code that is part of the opcode, and we duplicate opcodes between FP32 and FP64.

With this PR we now encode the width on a separate field, and make the opcodes width agnostic, which should simplify the introduction of FP16 and FP128 instructions.

There shouldn't be any bytecode changes with this PR. The one formatting change we have is due to us previously hiding the selected FRM mode for fcvt.d.{w,wu} instructions, which shouldn't have been hidden since, we don't do the same for their fcvt.s variants. Additionally these instructions change their results based on FRM so we should probably show it anyway.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 07 2024 at 16:46):

github-actions[bot] commented on PR #9084:

Subscribe to Label Action

cc @cfallin, @fitzgen

<details>
This issue or pull request has been labeled: "cranelift", "cranelift:area:riscv64", "isle"

Thus the following users have been cc'd because of the following labels:

To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.

Learn more.
</details>

view this post on Zulip Wasmtime GitHub notifications bot (Aug 09 2024 at 02:56):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 09 2024 at 03:12):

alexcrichton merged PR #9084.


Last updated: Nov 22 2024 at 16:03 UTC