about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2023-05-08 19:41:51 +0900
committerGitHub <noreply@github.com>2023-05-08 19:41:51 +0900
commit2a8adcc966f0c7ec75460d99ef6966fa4e3c7825 (patch)
treef1e5e514237175886f4d912961b4e4d7f2952395 /compiler/rustc_codegen_llvm/src
parentc122ac3e6991544d2d28fbee3ffcf20a1dd4b514 (diff)
parentc5382adc65119d55ac5045049d6cff095f6d111f (diff)
downloadrust-2a8adcc966f0c7ec75460d99ef6966fa4e3c7825.tar.gz
rust-2a8adcc966f0c7ec75460d99ef6966fa4e3c7825.zip
Rollup merge of #111332 - loongarch-rs:inline-asm, r=Amanieu
Improve inline asm for LoongArch

This PR is a sub-part of https://github.com/rust-lang/rust/pull/111235, to improve inline asm for LoongArch.

r? `@Amanieu`
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-rw-r--r--compiler/rustc_codegen_llvm/src/asm.rs13
1 files changed, 12 insertions, 1 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());