summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/asm.rs
diff options
context:
space:
mode:
authorWANG Rui <wangrui@loongson.cn>2023-05-08 11:05:46 +0800
committerWANG Rui <wangrui@loongson.cn>2023-05-08 11:05:46 +0800
commit8ad78cb02c62af59e750082c538968430d9c0cdd (patch)
treeb1c735c0471d0ca5c05bb2a0bd1eec1103f8ad1c /compiler/rustc_codegen_llvm/src/asm.rs
parentad6b20bf5225c65aab30169c9a173719f5bdfc04 (diff)
downloadrust-8ad78cb02c62af59e750082c538968430d9c0cdd.tar.gz
rust-8ad78cb02c62af59e750082c538968430d9c0cdd.zip
Mark LoongArch float-point condition flags as clobbered in inline assembly
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/asm.rs')
-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 f9af103c9ad..645b5b41c6b 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 => {}
                 InlineAsmArch::SpirV => {}