Stream: git-wasmtime

Topic: wasmtime / PR #14238 aarch64: add missing F16 and F128 ru...


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

dsecurity49 opened PR #14238 from dsecurity49:fix-aarch64-scalar-size-f16-f128 to bytecodealliance:main:

Summary

In cranelift/codegen/src/isa/aarch64/inst.isle, scalar_size is declared as a total term:

(decl scalar_size (Type) ScalarSize)

It defined rules for integer types (I8..I128) and F32 / F64, but omitted F16 and F128.

When ISLE lowering rules (such as fma.f16) passed an F16 or F128 type to scalar_size, the Cranelift compiler panicked with an internal ISLE error:

thread 'worker' panicked at out/isle_aarch64.rs:3755:5:
internal error: entered unreachable code: no rule matched for term scalar_size at src/isa/aarch64/inst.isle line 1587; should it be partial?

Fix

Add the missing ISLE rules for F16 and F128:

(rule (scalar_size $F16) (ScalarSize.Size16))
(rule (scalar_size $F128) (ScalarSize.Size128))

Testing

Added cranelift/filetests/filetests/isa/aarch64/fma-f16.clif and verified natively on AArch64 hardware:

$ ./target/debug/clif-util test ./cranelift/filetests/filetests/isa/aarch64/fma-f16.clif
1 tests

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

dsecurity49 requested cfallin for a review on PR #14238.

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

dsecurity49 requested wasmtime-compiler-reviewers for a review on PR #14238.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 30 2026 at 16:12):

dsecurity49 updated PR #14238.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 30 2026 at 16:29):

dsecurity49 updated PR #14238.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 30 2026 at 19:44):

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

view this post on Zulip Wasmtime GitHub notifications bot (Aug 30 2026 at 19:44):

github-actions[bot] added the label cranelift:area:aarch64 on PR #14238.

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

dsecurity49 edited PR #14238:

Add missing F16 and F128 rules to scalar_size in inst.isle, as well as their corresponding models in prelude.isle.

Without these, rules that pass f16 or f128 types to scalar_size (like fma.f16) trigger an ISLE panic because scalar_size is a total term.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 31 2026 at 20:54):

:speech_balloon: cfallin created PR review comment:

We usually have compile-tests with the precise-output flag to show (and lock down) the actual compilation output. Could you include that here? And could you add something for f128 as well if aarch64 has lowerings for it (I don't remember if it does)?

view this post on Zulip Wasmtime GitHub notifications bot (Aug 31 2026 at 20:54):

:memo: cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 01 2026 at 04:22):

:memo: dsecurity49 submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 01 2026 at 04:22):

:speech_balloon: dsecurity49 created PR review comment:

I've updated the AArch64 specific test to use test compile precise output to lock down the generated assembly sequence, and added target aarch64 to the existing runtests/i128-bitselect.clif runtest.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 01 2026 at 04:25):

:speech_balloon: dsecurity49 deleted PR review comment.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 01 2026 at 04:29):

dsecurity49 updated PR #14238.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 01 2026 at 04:42):

:memo: dsecurity49 submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 01 2026 at 04:42):

:speech_balloon: dsecurity49 created PR review comment:

Updated the f16 test to precise-output (emits fmadd h0, h0, h1, h2 as expected).

For f128: there are no native 128-bit float instructions on AArch64, so it would need softfloat libcalls (__addtf3, __fmatf3, etc.) which cranelift doesn't have on any backend yet, even x64 only handles f128const.For now I kept the scalar_size rule for F128 since it prevents a confusing panic, but happy to drop it if you'd prefer to keep this minimal.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 01 2026 at 04:57):

dsecurity49 updated PR #14238.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 01 2026 at 04:59):

:memo: dsecurity49 submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 01 2026 at 04:59):

:speech_balloon: dsecurity49 created PR review comment:

After checking further, keeping the F128 rule would be misleading,f128 arithmetic hits unexpected scalar FP operand size (size128)deeper in the backend anyway, so the scalar_size rule for it is effectively dead code. I've removed it and the corresponding model from prelude.isle, keeping only the F16 fix.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 03 2026 at 15:03):

:thumbs_up: cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 03 2026 at 15:03):

cfallin added PR #14238 aarch64: add missing F16 and F128 rules for scalar_size in ISLE to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 03 2026 at 15:29):

:check: cfallin merged PR #14238.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 03 2026 at 15:29):

cfallin removed PR #14238 aarch64: add missing F16 and F128 rules for scalar_size in ISLE from the merge queue.


Last updated: Sep 20 2026 at 18:08 UTC