Skip to content

fix: annotate aarch64 fp16 vector helpers with target features - #45

Closed
K12231217 wants to merge 1 commit into
sarah-quinones:mainfrom
K12231217:fix/aarch64-fp16-target-features
Closed

fix: annotate aarch64 fp16 vector helpers with target features#45
K12231217 wants to merge 1 commit into
sarah-quinones:mainfrom
K12231217:fix/aarch64-fp16-target-features

Conversation

@K12231217

Copy link
Copy Markdown

Summary

Annotate the four aarch64 helpers that emit 8-lane FP16 vector instructions with the function-level fp16 target feature:

  • vmulq_f16
  • vaddq_f16
  • vfmaq_f16
  • vfmaq_laneq_f16

The existing microkernel dispatch remains unchanged. This does not enable FP16 globally or raise the baseline CPU requirement for callers that do not enter the FP16-dispatched path.

Reproduction

The standalone workspace uses dev opt-level 3, which hides the issue. A top-level downstream workspace using an unoptimized debug profile reproduces it without additional CPU flags:

env -u RUSTFLAGS CARGO_PROFILE_DEV_OPT_LEVEL=0 CARGO_PROFILE_DEV_DEBUG=1 cargo build -p gemm-f16 --target aarch64-unknown-linux-gnu

Before this change, LLVM rejects the instantiated vfmaq_laneq_f16 assembly with instruction requires: fullfp16.

Verification

  • The reproduction command passes after the change using a fresh target directory.
  • env -u RUSTFLAGS cargo build -p gemm-f16 --release --target aarch64-unknown-linux-gnu
  • cargo fmt --all -- --check
  • cargo test --workspace: 5 tests passed; all doctests passed.

Tested from the gemm-common 0.18.2 release baseline because that is the downstream dependency version exposing the failure.

@K12231217 K12231217 closed this by deleting the head repository Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant