Skip to content

Tracking Issue for asm_cfg: #[cfg(...)] within asm! #140364

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
7 tasks
folkertdev opened this issue Apr 27, 2025 · 0 comments
Open
7 tasks

Tracking Issue for asm_cfg: #[cfg(...)] within asm! #140364

folkertdev opened this issue Apr 27, 2025 · 0 comments
Labels
A-inline-assembly Area: Inline assembly (`asm!(…)`) C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC F-asm `#![feature(asm)]` (not `llvm_asm`) T-lang Relevant to the language team, which will review and decide on the PR/issue.

Comments

@folkertdev
Copy link
Contributor

The feature gate for the issue is #![feature(asm_cfg)].

This feature was discussed in #140279. It allows configuring templates and operands in the assembly macros, for example:

asm!( // or global_asm! or naked_asm!
    "nop",
    #[cfg(target_feature = "sse2")]
    "nop",
    // ...
    #[cfg(target_feature = "sse2")]
    a = const 123, // only used on sse2
);

About tracking issues

Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Discussion comments will get marked as off-topic or deleted.
Repeated discussions on the tracking issue may lead to the tracking issue getting locked.

Steps

Unresolved Questions

  • Should the parser be changed to parse specifically string literals and item macro invocations (rather than general expressions)?
  • How should non-cfg attributes be handled?

Implementation history

@rustbot label +T-lang +F-asm +A-inline-assembly

@folkertdev folkertdev added the C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC label Apr 27, 2025
@rustbot rustbot added A-inline-assembly Area: Inline assembly (`asm!(…)`) F-asm `#![feature(asm)]` (not `llvm_asm`) T-lang Relevant to the language team, which will review and decide on the PR/issue. labels Apr 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-inline-assembly Area: Inline assembly (`asm!(…)`) C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC F-asm `#![feature(asm)]` (not `llvm_asm`) T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants