You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of rust-lang#111331 - taiki-e:s390x-asm-cc, r=Amanieu
Mark s390x condition code register as clobbered in inline assembly
Various s390x instructions (arithmetic operations, logical operations, comparisons, etc. see also "Condition Codes" section in [z/Architecture Reference Summary](https://www.ibm.com/support/pages/zarchitecture-reference-summary)) modify condition code register `cc`, but AFAIK there is currently no way to mark it as clobbered in `asm!`.
`cc` register definition in LLVM:
https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/SystemZ/SystemZRegisterInfo.td#L320
This PR also updates asm_experimental_arch docs in the unstable-book to mention s390x registers.
cc `@uweigand`
r? `@Amanieu`
| All |`sp`| The stack pointer must be restored to its original value at the end of an asm code block. |
119
-
| All |`fr` (Hexagon), `$fp` (MIPS), `Y` (AVR), `r4` (MSP430), `a6` (M68k), `$fp` (LoongArch) | The frame pointer cannot be used as an input or output. |
123
+
| All |`sp`, `r15` (s390x)| The stack pointer must be restored to its original value at the end of an asm code block. |
124
+
| All |`fr` (Hexagon), `$fp` (MIPS), `Y` (AVR), `r4` (MSP430), `a6` (M68k), `$fp` (LoongArch), `r11` (s390x)| The frame pointer cannot be used as an input or output. |
120
125
| All |`r19` (Hexagon) | This is used internally by LLVM as a "base pointer" for functions with complex stack frames. |
121
126
| MIPS |`$0` or `$zero`| This is a constant zero register which can't be modified. |
122
127
| MIPS |`$1` or `$at`| Reserved for assembler. |
@@ -147,6 +152,8 @@ This feature tracks `asm!` and `global_asm!` support for the following architect
147
152
| PowerPC |`freg`| None |`0`| None |
148
153
| LoongArch |`reg`| None |`$r2`| None |
149
154
| LoongArch |`freg`| None |`$f0`| None |
155
+
| s390x |`reg`| None |`%r0`| None |
156
+
| s390x |`freg`| None |`%f0`| None |
150
157
151
158
# Flags covered by `preserves_flags`
152
159
@@ -157,3 +164,5 @@ These flags registers must be restored upon exiting the asm block if the `preser
0 commit comments