summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/rustc_codegen_llvm/src/asm.rs13
-rw-r--r--compiler/rustc_target/src/asm/loongarch.rs9
2 files changed, 16 insertions, 6 deletions
diff --git a/compiler/rustc_codegen_llvm/src/asm.rs b/compiler/rustc_codegen_llvm/src/asm.rs
index 70bcbf92f38..2a6ad1be763 100644
--- a/compiler/rustc_codegen_llvm/src/asm.rs
+++ b/compiler/rustc_codegen_llvm/src/asm.rs
@@ -236,7 +236,18 @@ impl<'ll, 'tcx> AsmBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> {
InlineAsmArch::Nvptx64 => {}
InlineAsmArch::PowerPC | InlineAsmArch::PowerPC64 => {}
InlineAsmArch::Hexagon => {}
- InlineAsmArch::LoongArch64 => {}
+ InlineAsmArch::LoongArch64 => {
+ constraints.extend_from_slice(&[
+ "~{$fcc0}".to_string(),
+ "~{$fcc1}".to_string(),
+ "~{$fcc2}".to_string(),
+ "~{$fcc3}".to_string(),
+ "~{$fcc4}".to_string(),
+ "~{$fcc5}".to_string(),
+ "~{$fcc6}".to_string(),
+ "~{$fcc7}".to_string(),
+ ]);
+ }
InlineAsmArch::Mips | InlineAsmArch::Mips64 => {}
InlineAsmArch::S390x => {
constraints.push("~{cc}".to_string());
diff --git a/compiler/rustc_target/src/asm/loongarch.rs b/compiler/rustc_target/src/asm/loongarch.rs
index 7ace1647ded..9d1a4f3eeea 100644
--- a/compiler/rustc_target/src/asm/loongarch.rs
+++ b/compiler/rustc_target/src/asm/loongarch.rs
@@ -33,12 +33,11 @@ impl LoongArchInlineAsmRegClass {
pub fn supported_types(
self,
- arch: InlineAsmArch,
+ _arch: InlineAsmArch,
) -> &'static [(InlineAsmType, Option<Symbol>)] {
- match (self, arch) {
- (Self::reg, InlineAsmArch::LoongArch64) => types! { _: I8, I16, I32, I64, F32, F64; },
- (Self::reg, _) => types! { _: I8, I16, I32, F32; },
- (Self::freg, _) => types! { _: F32, F64; },
+ match self {
+ Self::reg => types! { _: I8, I16, I32, I64, F32, F64; },
+ Self::freg => types! { _: F32, F64; },
}
}
}