Skip to content

Commit

Permalink
Rollup merge of rust-lang#103021 - GuillaumeGomez:constraint-pages, r…
Browse files Browse the repository at this point in the history
…=Amanieu

Add links to relevant pages to find constraint information

I think it can be quite helpful to find this information more quickly.

r? `@Amanieu`
  • Loading branch information
matthiaskrgr authored Oct 13, 2022
2 parents cf67565 + 2214748 commit 3f12e4b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions compiler/rustc_codegen_llvm/src/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,8 @@ fn reg_to_llvm(reg: InlineAsmRegOrRegClass, layout: Option<&TyAndLayout<'_>>) ->
format!("{{{}}}", reg.name())
}
}
// The constraints can be retrieved from
// https://llvm.org/docs/LangRef.html#supported-constraint-code-list
InlineAsmRegOrRegClass::RegClass(reg) => match reg {
InlineAsmRegClass::AArch64(AArch64InlineAsmRegClass::reg) => "r",
InlineAsmRegClass::AArch64(AArch64InlineAsmRegClass::vreg) => "w",
Expand Down Expand Up @@ -624,6 +626,8 @@ fn modifier_to_llvm(
reg: InlineAsmRegClass,
modifier: Option<char>,
) -> Option<char> {
// The modifiers can be retrieved from
// https://llvm.org/docs/LangRef.html#asm-template-argument-modifiers
match reg {
InlineAsmRegClass::AArch64(AArch64InlineAsmRegClass::reg) => modifier,
InlineAsmRegClass::AArch64(AArch64InlineAsmRegClass::vreg)
Expand Down

0 comments on commit 3f12e4b

Please sign in to comment.