about summary refs log tree commit diff
path: root/compiler/rustc_target/src/asm/mod.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-11-25 08:13:44 +0000
committerbors <bors@rust-lang.org>2024-11-25 08:13:44 +0000
commit1278dad1e9a46a3a6fb5de80a5620cd2e58196cb (patch)
tree4aa87ca24f3ebf4d53208bf8176e3e7d8c0102eb /compiler/rustc_target/src/asm/mod.rs
parent67a8c642592f86eaf3b84030c04e0305d79953d1 (diff)
parentd2590e0ca3c4cee93b4b9a2c13699213489d4413 (diff)
downloadrust-1278dad1e9a46a3a6fb5de80a5620cd2e58196cb.tar.gz
rust-1278dad1e9a46a3a6fb5de80a5620cd2e58196cb.zip
Auto merge of #133433 - matthiaskrgr:rollup-lfa3wp1, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #131523 (Fix asm goto with outputs and move it to a separate feature gate)
 - #131664 (Support input/output in vector registers of s390x inline assembly (under asm_experimental_reg feature))
 - #132432 (Add a test to verify that libstd doesn't use protected symbols)
 - #132502 (Document possibility to set core features in example config.toml)
 - #132529 (ci(triagebot): add more top-level files to A-meta)
 - #132533 (Add BorrowedBuf::into_filled{,_mut} methods to allow returning buffer with original lifetime)
 - #132803 (Fix broken url)
 - #132982 (alloc: fix `Allocator` method names in `alloc` free function docs)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_target/src/asm/mod.rs')
-rw-r--r--compiler/rustc_target/src/asm/mod.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/compiler/rustc_target/src/asm/mod.rs b/compiler/rustc_target/src/asm/mod.rs
index 10778e9acf1..db8d23776e5 100644
--- a/compiler/rustc_target/src/asm/mod.rs
+++ b/compiler/rustc_target/src/asm/mod.rs
@@ -604,9 +604,13 @@ impl InlineAsmRegClass {
 
     /// Returns a list of supported types for this register class, each with an
     /// options target feature required to use this type.
+    ///
+    /// At the codegen stage, it is fine to always pass true for `allow_experimental_reg`,
+    /// since all the stability checking will have been done in prior stages.
     pub fn supported_types(
         self,
         arch: InlineAsmArch,
+        allow_experimental_reg: bool,
     ) -> &'static [(InlineAsmType, Option<Symbol>)] {
         match self {
             Self::X86(r) => r.supported_types(arch),
@@ -618,7 +622,7 @@ impl InlineAsmRegClass {
             Self::Hexagon(r) => r.supported_types(arch),
             Self::LoongArch(r) => r.supported_types(arch),
             Self::Mips(r) => r.supported_types(arch),
-            Self::S390x(r) => r.supported_types(arch),
+            Self::S390x(r) => r.supported_types(arch, allow_experimental_reg),
             Self::Sparc(r) => r.supported_types(arch),
             Self::SpirV(r) => r.supported_types(arch),
             Self::Wasm(r) => r.supported_types(arch),
@@ -696,8 +700,11 @@ impl InlineAsmRegClass {
 
     /// Returns whether registers in this class can only be used as clobbers
     /// and not as inputs/outputs.
-    pub fn is_clobber_only(self, arch: InlineAsmArch) -> bool {
-        self.supported_types(arch).is_empty()
+    ///
+    /// At the codegen stage, it is fine to always pass true for `allow_experimental_reg`,
+    /// since all the stability checking will have been done in prior stages.
+    pub fn is_clobber_only(self, arch: InlineAsmArch, allow_experimental_reg: bool) -> bool {
+        self.supported_types(arch, allow_experimental_reg).is_empty()
     }
 }