Skip to content
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

More inline asm register name fixups for LLVM #75781

Merged
merged 2 commits into from
Aug 22, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/librustc_codegen_llvm/asm.rs
Original file line number Diff line number Diff line change
@@ -479,10 +479,13 @@ fn reg_to_llvm(reg: InlineAsmRegOrRegClass, layout: Option<&TyAndLayout<'tcx>>)
_ => unreachable!(),
}
} else {
// We use i32 as the type for discarded outputs
's'
// We use i64x2 as the type for discarded outputs
'q'
};
format!("{{{}{}}}", class, idx)
} else if reg == InlineAsmReg::AArch64(AArch64InlineAsmReg::x30) {
// LLVM doesn't recognize x30
"lr".to_string()
} else {
format!("{{{}}}", reg.name())
}
5 changes: 5 additions & 0 deletions src/test/assembly/asm/aarch64-types.rs
Original file line number Diff line number Diff line change
@@ -553,3 +553,8 @@ check_reg!(v0_f32x4 f32x4 "s0" "fmov");
// CHECK: fmov s0, s0
// CHECK: //NO_APP
check_reg!(v0_f64x2 f64x2 "s0" "fmov");

// Regression test for #75761
pub unsafe fn issue_75761() {
asm!("", out("v0") _, out("x30") _);
}