-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-inline-assemblyArea: Inline assembly (`asm!(…)`)Area: Inline assembly (`asm!(…)`)C-bugCategory: This is a bug.Category: This is a bug.F-asm`#![feature(asm)]` (not `llvm_asm`)`#![feature(asm)]` (not `llvm_asm`)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
First discussed on zulip.
Quick summary: the set of what registers are available for inline assembly is related to the current target arch. However, the instruction_set
attribute lets a function be compiled for what's effectively an alternate arch. This should allow the other arch's registers to be used, but currently that's not the case.
- Specifically for ARM a32/t32, the
thumb-mode
target attribute is either not present (a32) or present (t32) in the target, and using theinstruction_set
attribute lets you have the opposite mode. - Note: The actual assembly code is already compiled correctly on LLVM's side, it's just that rustc gives you the incorrect register class limits.
Quoting Amanieu's Zulip post on the probable fix for this:
You'd need to somehow remove the thumb-mode target feature from the list passed to the asm handling code in ast_lowering and intrinsicck when the containing function uses the a32 ISA.
Metadata
Metadata
Assignees
Labels
A-inline-assemblyArea: Inline assembly (`asm!(…)`)Area: Inline assembly (`asm!(…)`)C-bugCategory: This is a bug.Category: This is a bug.F-asm`#![feature(asm)]` (not `llvm_asm`)`#![feature(asm)]` (not `llvm_asm`)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.