Stream: git-wasmtime

Topic: wasmtime / PR #12854 Fix fmin f16 cprop rule using $F32 i...


view this post on Zulip Wasmtime GitHub notifications bot (Mar 27 2026 at 06:36):

shumbo opened PR #12854 from shumbo:fix-fmin-f16-rule to bytecodealliance:main:

<!--
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
-->

Typo in the fmin f16 constant propagation rule causes the folded constant to be typed as F32 instead of F16. This means the 16-bit float bit pattern gets reinterpreted as a 32-bit float in any subsequent type-dependent operation (e.g., fpromote) producing incorrect values.

https://github.com/bytecodealliance/wasmtime/blob/c7d25dfd8cf0adaab2629166b80141a58c2329d9/cranelift/codegen/src/opts/cprop.isle#L406

The adjacent fmax f16 rule has the correct typing.

https://github.com/bytecodealliance/wasmtime/blob/c7d25dfd8cf0adaab2629166b80141a58c2329d9/cranelift/codegen/src/opts/cprop.isle#L419

This PR fixes the typo and adds a regression test that folds fmin on two f16 constants and promotes the result, verifying the fix.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 27 2026 at 06:36):

shumbo requested cfallin for a review on PR #12854.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 27 2026 at 06:36):

shumbo requested wasmtime-compiler-reviewers for a review on PR #12854.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 27 2026 at 10:00):

github-actions[bot] added the label cranelift on PR #12854.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 27 2026 at 10:00):

github-actions[bot] added the label isle on PR #12854.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 27 2026 at 10:01):

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

Subscribe to Label Action

cc @cfallin, @fitzgen

<details>
This issue or pull request has been labeled: "cranelift", "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 (Mar 27 2026 at 16:43):

fitzgen submitted PR review:

Thanks!

view this post on Zulip Wasmtime GitHub notifications bot (Mar 27 2026 at 16:43):

fitzgen added PR #12854 Fix fmin f16 cprop rule using $F32 instead of $F16 to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 27 2026 at 17:06):

fitzgen merged PR #12854.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 27 2026 at 17:06):

fitzgen removed PR #12854 Fix fmin f16 cprop rule using $F32 instead of $F16 from the merge queue.


Last updated: Apr 12 2026 at 23:10 UTC