Rollup merge of #75781 - Amanieu:asm-fix, r=nagisa

More inline asm register name fixups for LLVM

Fixes #75761

r? @nagisa
This commit is contained in:
Dylan DPC 2020-08-22 02:14:54 +02:00 committed by GitHub
commit cb9ef0988e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View file

@ -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())
}

View file

@ -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") _);
}