Skip to content

Commit a32d4bc

Browse files
committed
Stabilize s390x inline assembly
1 parent 27e38f8 commit a32d4bc

File tree

4 files changed

+5
-21
lines changed

4 files changed

+5
-21
lines changed

compiler/rustc_ast_lowering/src/asm.rs

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
4848
| asm::InlineAsmArch::RiscV32
4949
| asm::InlineAsmArch::RiscV64
5050
| asm::InlineAsmArch::LoongArch64
51+
| asm::InlineAsmArch::S390x
5152
);
5253
if !is_stable && !self.tcx.features().asm_experimental_arch() {
5354
feature_err(

src/doc/unstable-book/src/language-features/asm-experimental-arch.md

+2-19
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ This feature tracks `asm!` and `global_asm!` support for the following architect
1818
- MSP430
1919
- M68k
2020
- CSKY
21-
- s390x
2221
- Arm64EC
2322

2423
## Register classes
@@ -51,11 +50,6 @@ This feature tracks `asm!` and `global_asm!` support for the following architect
5150
| M68k | `reg_addr` | `a[0-3]` | `a` |
5251
| CSKY | `reg` | `r[0-31]` | `r` |
5352
| CSKY | `freg` | `f[0-31]` | `f` |
54-
| s390x | `reg` | `r[0-10]`, `r[12-14]` | `r` |
55-
| s390x | `reg_addr` | `r[1-10]`, `r[12-14]` | `a` |
56-
| s390x | `freg` | `f[0-15]` | `f` |
57-
| s390x | `vreg` | `v[0-31]` | Only clobbers |
58-
| s390x | `areg` | `a[2-15]` | Only clobbers |
5953
| Arm64EC | `reg` | `x[0-12]`, `x[15-22]`, `x[25-27]`, `x30` | `r` |
6054
| Arm64EC | `vreg` | `v[0-15]` | `w` |
6155
| Arm64EC | `vreg_low16` | `v[0-15]` | `x` |
@@ -93,10 +87,6 @@ This feature tracks `asm!` and `global_asm!` support for the following architect
9387
| M68k | `reg_data` | None | `i8`, `i16`, `i32` |
9488
| CSKY | `reg` | None | `i8`, `i16`, `i32` |
9589
| CSKY | `freg` | None | `f32`, |
96-
| s390x | `reg`, `reg_addr` | None | `i8`, `i16`, `i32`, `i64` |
97-
| s390x | `freg` | None | `f32`, `f64` |
98-
| s390x | `vreg` | N/A | Only clobbers |
99-
| s390x | `areg` | N/A | Only clobbers |
10090
| Arm64EC | `reg` | None | `i8`, `i16`, `i32`, `f32`, `i64`, `f64` |
10191
| Arm64EC | `vreg` | None | `i8`, `i16`, `i32`, `f32`, `i64`, `f64`, <br> `i8x8`, `i16x4`, `i32x2`, `i64x1`, `f32x2`, `f64x1`, <br> `i8x16`, `i16x8`, `i32x4`, `i64x2`, `f32x4`, `f64x2` |
10292

@@ -150,8 +140,8 @@ This feature tracks `asm!` and `global_asm!` support for the following architect
150140

151141
| Architecture | Unsupported register | Reason |
152142
| ------------ | --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
153-
| All | `sp`, `r15` (s390x) | The stack pointer must be restored to its original value at the end of an asm code block. |
154-
| All | `fr` (Hexagon), `fp` (PowerPC), `$fp` (MIPS), `Y` (AVR), `r4` (MSP430), `a6` (M68k), `r11` (s390x), `x29` (Arm64EC) | The frame pointer cannot be used as an input or output. |
143+
| All | `sp`, | The stack pointer must be restored to its original value at the end of an asm code block. |
144+
| All | `fr` (Hexagon), `fp` (PowerPC), `$fp` (MIPS), `Y` (AVR), `r4` (MSP430), `a6` (M68k), `x29` (Arm64EC) | The frame pointer cannot be used as an input or output. |
155145
| All | `r19` (Hexagon), `r29` (PowerPC), `r30` (PowerPC), `x19` (Arm64EC) | These are used internally by LLVM as "base pointer" for functions with complex stack frames. |
156146
| MIPS | `$0` or `$zero` | This is a constant zero register which can't be modified. |
157147
| MIPS | `$1` or `$at` | Reserved for assembler. |
@@ -172,8 +162,6 @@ This feature tracks `asm!` and `global_asm!` support for the following architect
172162
| CSKY | `r15` | This is the link register. |
173163
| CSKY | `r[26-30]` | Reserved by its ABI. |
174164
| CSKY | `r31` | This is the TLS register. |
175-
| s390x | `c[0-15]` | Reserved by the kernel. |
176-
| s390x | `a[0-1]` | Reserved for system use. |
177165
| Arm64EC | `xzr` | This is a constant zero register which can't be modified. |
178166
| Arm64EC | `x18` | This is an OS-reserved register. |
179167
| Arm64EC | `x13`, `x14`, `x23`, `x24`, `x28`, `v[16-31]` | These are AArch64 registers that are not supported for Arm64EC. |
@@ -192,9 +180,6 @@ This feature tracks `asm!` and `global_asm!` support for the following architect
192180
| PowerPC | `reg` | None | `0` | None |
193181
| PowerPC | `reg_nonzero` | None | `3` | None |
194182
| PowerPC | `freg` | None | `0` | None |
195-
| s390x | `reg` | None | `%r0` | None |
196-
| s390x | `reg_addr` | None | `%r1` | None |
197-
| s390x | `freg` | None | `%f0` | None |
198183
| CSKY | `reg` | None | `r0` | None |
199184
| CSKY | `freg` | None | `f0` | None |
200185
| Arm64EC | `reg` | None | `x0` | `x` |
@@ -217,8 +202,6 @@ These flags registers must be restored upon exiting the asm block if the `preser
217202
- The status register `r2`.
218203
- M68k
219204
- The condition code register `ccr`.
220-
- s390x
221-
- The condition code register `cc`.
222205
- Arm64EC
223206
- Condition flags (`NZCV` register).
224207
- Floating-point status (`FPSR` register).

tests/assembly/asm/s390x-types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//@[s390x] needs-llvm-components: systemz
55
//@ compile-flags: -Zmerge-functions=disabled
66

7-
#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_experimental_arch)]
7+
#![feature(no_core, lang_items, rustc_attrs, repr_simd)]
88
#![crate_type = "rlib"]
99
#![no_core]
1010
#![allow(asm_sub_register, non_camel_case_types)]

tests/codegen/asm/s390x-clobbers.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//@[s390x] needs-llvm-components: systemz
44

55
#![crate_type = "rlib"]
6-
#![feature(no_core, rustc_attrs, lang_items, asm_experimental_arch)]
6+
#![feature(no_core, rustc_attrs, lang_items)]
77
#![no_core]
88

99
#[lang = "sized"]

0 commit comments

Comments
 (0)