Skip to content

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

Open
@folkertdev

Description

@folkertdev

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-inline-assemblyArea: Inline assembly (`asm!(…)`)C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCF-asm`#![feature(asm)]` (not `llvm_asm`)T-langRelevant to the language team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions