Stream: git-wasmtime

Topic: wasmtime / PR #11931 fix(cranelift): fix sdiv by most neg...


view this post on Zulip Wasmtime GitHub notifications bot (Oct 24 2025 at 11:45):

emturner opened PR #11931 from trilitech:emturner/fix-div-const to bytecodealliance:main:

Closes #11927

When opt_level="speed" || opt_level="speed_and_size", i32::MIN/i32::MIN and i64::MIN/i64::MIN both give -1 instead of 1.

The signed x / d rule when d is a power of two was too broad in it's constraints: namely that it accidentally picked up ty::MIN too - which should have instead triggered the rule for signed division by a negative power of two.

The tests in sdiv.clif const tests added in f678260bb3b2fa07ae10737f581b2d395d3349da unfortunately missed this edge case. Even if the edge case had been tested for, however, the test would have passed - as it seems the sdiv.clif test file was tested with opt_level=none before.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 24 2025 at 11:45):

emturner requested wasmtime-compiler-reviewers for a review on PR #11931.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 24 2025 at 11:45):

emturner requested cfallin for a review on PR #11931.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 24 2025 at 11:50):

emturner updated PR #11931.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 24 2025 at 12:39):

emturner commented on PR #11931:

We had a go at fixing the issue in i64_is_negative_power_of_two by taking an additional Type parameter - but struggling with partial rules at that point.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 24 2025 at 14:47):

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

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 (Oct 29 2025 at 14:39):

cfallin submitted PR review:

Thanks!

view this post on Zulip Wasmtime GitHub notifications bot (Oct 29 2025 at 15:05):

cfallin merged PR #11931.


Last updated: Dec 06 2025 at 06:05 UTC