Skip to content

cranelift: don't emit FEAT_FP16 instructions without the feature, and support f16 in the interpreter - #14436

Open
dsecurity49 wants to merge 2 commits into
bytecodealliance:mainfrom
dsecurity49:f16-aarch64-and-interpreter
Open

dsecurity49 wants to merge 2 commits into
bytecodealliance:mainfrom
dsecurity49:f16-aarch64-and-interpreter

Conversation

@dsecurity49

Copy link
Copy Markdown
Contributor

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.f16 on plain target aarch64 compiled to fadd h0, h0, h1 and trapped at run time. Adds a ty_scalar_float_with_fp16 extractor mirroring the RISC-V Zfh gate, makes the four fma constructors partial so the negated forms report instead of panicking, and lowers fcopysign.f16 in integer registers, which previously panicked.

The interpreter only handled F32/F64, so test interpret failed on f16 and fuzzgen had no oracle for it. Adds Ieee16::to_f32 and from_f32_rne/from_f64_rne, with fma widening to f64 so the exact product and sum survives.

Includes precise-output filetests for the new lowerings, and test interpret on the f16 runtests.

@dsecurity49
dsecurity49 requested a review from a team as a code owner September 28, 2026 13:42
@dsecurity49
dsecurity49 requested review from cfallin and removed request for a team September 28, 2026 13:42
@dsecurity49
dsecurity49 force-pushed the f16-aarch64-and-interpreter branch from aeaecea to 81a4ea3 Compare September 28, 2026 14:27
@github-actions github-actions Bot added cranelift Issues related to the Cranelift code generator cranelift:area:aarch64 Issues related to AArch64 backend. isle Related to the ISLE domain-specific language labels Sep 28, 2026
@github-actions

Copy link
Copy Markdown

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 .github/subscribe-to-label.json configuration file.

Learn more.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cranelift:area:aarch64 Issues related to AArch64 backend. cranelift Issues related to the Cranelift code generator isle Related to the ISLE domain-specific language

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant