rust-lang / rust-lang/rust

Incorrect target feature shown during `asm!` verification (aarch64)

Open
#126,329 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-diagnostics T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Code
asm!("ldp d0, d1, [x0, 0x100]");
Current output
error: instruction requires: fp-armv8
   --> /Users/lysan/.cargo/git/checkouts/unwinding-943b7a48f658f090/5718f01/src/unwinder/arch/aarch64.rs:101:13
    |
101 |             ldp d0, d1, [x0, 0x100]
    |             ^
    |
note: instantiated into assembly here
   --> <inline asm>:2:13
    |
2   |             ldp d0, d1, [x0, 0x100]
    |             ^
Desired output
error: instruction requires: neon
   --> /Users/lysan/.cargo/git/checkouts/unwinding-943b7a48f658f090/5718f01/src/unwinder/arch/aarch64.rs:101:13
    |
101 |             ldp d0, d1, [x0, 0x100]
    |             ^
    |
note: instantiated into assembly here
   --> <inline asm>:2:13
    |
2   |             ldp d0, d1, [x0, 0x100]
    |             ^
Rationale and extra context

This error only appears on aarch64-unknown-none-softfloat (all other aarch64s have neon).

fp-armv8 is not an aarch64 feature, it's an arm feature. neon is the equivalent aarch64 feature afaict.

Other cases

No response

Rust Version
rustc 1.80.0-nightly (804421dff 2024-06-07)
binary: rustc
commit-hash: 804421dff5542c9c7da5c60257b5dbc849719505
commit-date: 2024-06-07
host: aarch64-apple-darwin
release: 1.80.0-nightly
LLVM version: 18.1.7
Anything else?

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the asm! example on aarch64-unknown-none-softfloat and compare its diagnostic with the requested neon wording. Start from the reported unwinding/.../aarch64.rs:101 assembly location and the compiler's AArch64 target-feature diagnostic path; done means the failing case reports neon without changing other targets' diagnostics.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.