Stream: git-wasmtime

Topic: wasmtime / PR #14883 Cranelift: fail cleanly on fpromote/...


view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 08:56):

ilyas-mallah requested wasmtime-compiler-s390x-reviewers for a review on PR #14883.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 08:56):

ilyas-mallah opened PR #14883 from ilyas-mallah:cranelift-fpromote-fdemote-types to bytecodealliance:main:

The verifier accepts fpromote and fdemote with an f16 or f128 operand. The x64 and aarch64 lowerings match only the result type, and s390x matches any pair. On aarch64 that compiles to a wrong value: fpromote.f64 of an f16 1.0 gives about 2.15e-41, and fdemote.f32 of an f128 gives 0.0. x64 and s390x panic. Wasm doesn't produce these types, so only CLIF reaches this.

The rules now match the source type too, so these pairs fail with the usual unsupported-feature error, as in #14653. riscv64 and Pulley already did. I compiled all 12 type pairs for 8 targets before and after. Only the broken cases changed, and the 24 supported compiles are byte for byte the same.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 08:56):

ilyas-mallah removed the review request for wasmtime-compiler-reviewers from PR #14883.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 08:56):

ilyas-mallah requested alexcrichton for a review on PR #14883.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 08:56):

ilyas-mallah requested wasmtime-compiler-reviewers for a review on PR #14883.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 09:32):

:memo: uweigand submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 09:32):

:speech_balloon: uweigand created PR review comment:

Same here.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 09:32):

:speech_balloon: uweigand created PR review comment:

This isn't wrong, but I don't see why it is necessary - the fpromote_reg rule itself already rejects all unsupported type combinations ...

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 10:55):

:memo: ilyas-mallah submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 10:55):

:speech_balloon: ilyas-mallah created PR review comment:

The guard is needed because fpromote_reg isn't partial. A pair it has no rule for panics instead of being rejected. On main, clif-util compile --target s390x of fpromote.f64 on an f16 value exits 101 with "no rule matched for term fpromote_reg ... should it be partial?". The new s390x filetest fails on main with that panic.

The old generic rule sent every f16 pair into the helper, so the explicit pairs keep f16 out of it. I can make the two helpers partial instead. That touches 19 call sites in lower.isle, which would each need to handle a missing match. Do you prefer that?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 10:55):

:memo: ilyas-mallah submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 10:55):

:speech_balloon: ilyas-mallah created PR review comment:

Same reason, see my reply above. fdemote_reg isn't partial either, and fdemote.f16 of an f32 value panics in it with "no rule matched for term fdemote_reg".

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 11:15):

:memo: uweigand submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 11:15):

:speech_balloon: uweigand created PR review comment:

Ah, I see. No, this change is fine with me then. Thanks!

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 11:16):

:thumbs_up: uweigand submitted PR review:

LGTM, thanks!

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 11:18):

uweigand added PR #14883 Cranelift: fail cleanly on fpromote/fdemote with f16 or f128 types to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 11:42):

:check: uweigand merged PR #14883.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 11:42):

uweigand removed PR #14883 Cranelift: fail cleanly on fpromote/fdemote with f16 or f128 types from the merge queue.


Last updated: Oct 31 2026 at 23:03 UTC