about summary refs log tree commit diff
path: root/compiler/rustc_target/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-05-06 23:58:27 +0000
committerbors <bors@rust-lang.org>2023-05-06 23:58:27 +0000
commit34bee196cb85b5e7f45118a791360161c46cf000 (patch)
tree6a7c2cd398999f2deb0630e46151daf67f5148f1 /compiler/rustc_target/src
parenta77c552485a19245a266bc03c450676c666b605f (diff)
parent1de257bd33eecdcc1386beccd8ad3ed90012f358 (diff)
downloadrust-34bee196cb85b5e7f45118a791360161c46cf000.tar.gz
rust-34bee196cb85b5e7f45118a791360161c46cf000.zip
Auto merge of #111304 - matthiaskrgr:rollup-b9twh7l, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #111002 (Fix the test directories suggested by `./x.py suggest`)
 - #111077 (Make more ConstProp tests unit.)
 - #111151 (check bootstrap scripts syntax)
 - #111203 (Output LLVM optimization remark kind in `-Cremark` output)
 - #111237 (asm: loongarch64: Implementation of clobber_abi)
 - #111274 (Expand the LLVM coverage of `--print target-cpus`)
 - #111289 (Check arguments length in trivial diagnostic lint)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_target/src')
-rw-r--r--compiler/rustc_target/src/asm/mod.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/compiler/rustc_target/src/asm/mod.rs b/compiler/rustc_target/src/asm/mod.rs
index 266691b2c88..705966f5237 100644
--- a/compiler/rustc_target/src/asm/mod.rs
+++ b/compiler/rustc_target/src/asm/mod.rs
@@ -839,6 +839,7 @@ pub enum InlineAsmClobberAbi {
     AArch64,
     AArch64NoX18,
     RiscV,
+    LoongArch,
 }
 
 impl InlineAsmClobberAbi {
@@ -880,6 +881,10 @@ impl InlineAsmClobberAbi {
                 "C" | "system" | "efiapi" => Ok(InlineAsmClobberAbi::RiscV),
                 _ => Err(&["C", "system", "efiapi"]),
             },
+            InlineAsmArch::LoongArch64 => match name {
+                "C" | "system" | "efiapi" => Ok(InlineAsmClobberAbi::LoongArch),
+                _ => Err(&["C", "system", "efiapi"]),
+            },
             _ => Err(&[]),
         }
     }
@@ -1022,6 +1027,21 @@ impl InlineAsmClobberAbi {
                     v24, v25, v26, v27, v28, v29, v30, v31,
                 }
             },
+            InlineAsmClobberAbi::LoongArch => clobbered_regs! {
+                LoongArch LoongArchInlineAsmReg {
+                    // ra
+                    r1,
+                    // a0-a7
+                    r4, r5, r6, r7, r8, r9, r10, r11,
+                    // t0-t8
+                    r12, r13, r14, r15, r16, r17, r18, r19, r20,
+                    // fa0-fa7
+                    f0, f1, f2, f3, f4, f5, f6, f7,
+                    // ft0-ft15
+                    f8, f9, f10, f11, f12, f13, f14, f15,
+                    f16, f17, f18, f19, f20, f21, f22, f23,
+                }
+            },
         }
     }
 }