dotcom07 opened PR #14521 from dotcom07:fix/aarch64-f16-fcmp to bytecodealliance:main:
Fixes #14510.
When an
f16comparison is folded into a branch or select, AArch64 can emitfcmp hN, hMeven withhas_fp16disabled. This instruction requires Arm's half-precision floating-point arithmetic extension (FEAT_FP16), so these comparisons can trap on CPUs without that feature.This widens both operands to
f32in the shared comparison helper when FP16 is unavailable. The scalar f16-to-f32fcvtconversion does not require FEAT_FP16. This also allows standalonef16comparisons and zero-extended comparison results to use the same fallback.Adds precise-output tests for the generated comparisons, an encoding test for the conversion, and runtime tests covering NaNs, signed zeros, infinities, and subnormals. The runtime tests were run on Apple Silicon with
has_fp16enabled and disabled.
dotcom07 requested cfallin for a review on PR #14521.
dotcom07 requested wasmtime-compiler-reviewers for a review on PR #14521.
dotcom07 updated PR #14521.
github-actions[bot] added the label cranelift on PR #14521.
github-actions[bot] added the label cranelift:area:aarch64 on PR #14521.
cfallin commented on PR #14521:
@dotcom07 thanks for this PR -- as with the other one of yours, I plan to get to this early next week.
:thumbs_up: cfallin submitted PR review.
cfallin added PR #14521 aarch64: widen f16 comparisons when FP16 is unavailable to the merge queue.
:check: cfallin merged PR #14521.
cfallin removed PR #14521 aarch64: widen f16 comparisons when FP16 is unavailable from the merge queue.
Last updated: Oct 11 2026 at 04:10 UTC