dsecurity49 opened PR #14436 from dsecurity49:f16-aarch64-and-interpreter to bytecodealliance:main:
Two f16 fixes for AArch64, plus interpreter support so f16 can be tested.
f16 arithmetic on AArch64 was emitting half-precision instructions without FEAT_FP16, which are UNDEFINED (Arm ARM, C7.2.73 FCVT).
fadd.f16on plaintarget aarch64compiled tofadd h0, h0, h1and trapped at run time. Adds aty_scalar_float_with_fp16extractor mirroring the RISC-V Zfh gate, makes the four fma constructorspartialso the negated forms report instead of panicking, and lowersfcopysign.f16in integer registers, which previously panicked.The interpreter only handled F32/F64, so
test interpretfailed on f16 and fuzzgen had no oracle for it. AddsIeee16::to_f32andfrom_f32_rne/from_f64_rne, withfmawidening to f64 so the exact product and sum survives.Includes precise-output filetests for the new lowerings, and
test interpreton the f16 runtests.
dsecurity49 requested cfallin for a review on PR #14436.
dsecurity49 requested wasmtime-compiler-reviewers for a review on PR #14436.
dsecurity49 updated PR #14436.
github-actions[bot] added the label cranelift:area:aarch64 on PR #14436.
github-actions[bot] added the label cranelift on PR #14436.
github-actions[bot] added the label isle on PR #14436.
github-actions[bot] commented on PR #14436:
Subscribe to Label Action
cc @avanhatt, @cfallin, @fitzgen, @mmcloughlin
<details>
This issue or pull request has been labeled: "cranelift", "cranelift:area:aarch64", "isle"Thus the following users have been cc'd because of the following labels:
- avanhatt: isle
- cfallin: isle
- fitzgen: isle
- mmcloughlin: isle
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
:memo: cfallin submitted PR review:
Thanks! A few comments below mostly about style but overall looks fine.
:speech_balloon: cfallin created PR review comment:
Let's keep these in the one
mod test, idiomatically, not a separate..._testsmodule at the top level.
:speech_balloon: cfallin created PR review comment:
A bit too much detail here makes it unclear -- maybe just "
partialso that unsupported cases fail at the top level rather than panicking"
:speech_balloon: cfallin created PR review comment:
Let's fix the indentation here -- we don't exactly have one consistent style, but this one (N spaces before the start of the RHS on same line, then the rest of the RHS indented less on new lines) is quite nonstandard.
:speech_balloon: cfallin created PR review comment:
We usually don't combine predicates like this -- better to have a separate ISA-feature flag and check with if-let, as it makes the intent more clear in lowering rules.
dsecurity49 updated PR #14436.
dsecurity49 commented on PR #14436:
Done. The f16 tests are in the existing
mod testswith the_ieee16suffix, and the feature check is now an explicit$F16rule guarded by(if-let true (use_fp16))next to$F32/$F64, likefpu_csel. Thefmaddpriorities had to shift to make room — F16 needs to sit below the negation rules sofma(-x, y, z)stays a singlefmsub. Codegen is byte-identical for f32/f64/vector fma either way.
dsecurity49 requested cfallin for a review on PR #14436.
:thumbs_up: cfallin submitted PR review:
Thanks!
cfallin added PR #14436 cranelift: don't emit FEAT_FP16 instructions without the feature, and support f16 in the interpreter to the merge queue.
github-merge-queue[bot] removed PR #14436 cranelift: don't emit FEAT_FP16 instructions without the feature, and support f16 in the interpreter from the merge queue.
alexcrichton added PR #14436 cranelift: don't emit FEAT_FP16 instructions without the feature, and support f16 in the interpreter to the merge queue.
:check: alexcrichton merged PR #14436.
alexcrichton removed PR #14436 cranelift: don't emit FEAT_FP16 instructions without the feature, and support f16 in the interpreter from the merge queue.
Last updated: Oct 11 2026 at 04:10 UTC