Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stabilize s390x inline assembly #131258

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

taiki-e
Copy link
Member

@taiki-e taiki-e commented Oct 4, 2024

This stabilizes inline assembly for s390x (SystemZ).

Corresponding reference PR: rust-lang/reference#1643


From the requirements of stabilization mentioned in #93335

Each architecture needs to be reviewed before stabilization:

  • It must have clobber_abi.

Done in #130630.

  • It must be possible to clobber every register that is normally clobbered by a function call.

Done in the PR that added support for clobber_abi.

  • Generally review that the exposed register classes make sense.

The followings can be used as input/output:

  • reg (r[0-10], r[12-14]): General-purpose register

  • reg_addr (r[1-10], r[12-14]): General-purpose register except r0 which is evaluated as zero in an address context

    This class is needed because r0, which may be allocated when using the reg class, cannot be used as a register in certain contexts. This is identical to the a constraint in LLVM and GCC. See Support reg_addr register class in s390x inline assembly #119431 for details.

  • freg (f[0-15]): Floating-point register

The followings are clobber-only:

  • vreg (v[0-31]): Vector register

    Technically vreg should be able to accept #[repr(simd)] types as input/output if the unstable vector target feature added is enabled, but core::arch has no s390x vector type and both #[repr(simd)] and core::simd are unstable. Everything related is unstable, so the fact that this is currently a clobber-only should not be considered a stabilization blocker. (s390x vector facilities support #130869 tracks unstable stuff here)

  • areg (a[2-15]): Access register

All of the above register classes except reg_addr are needed for clobber_abi.

The followings cannot be used as operands for inline asm (see also getReservedRegs and SystemZELFRegisters in LLVM):

  • r11: frame pointer
  • r15: stack pointer
  • a0, a1: Reserved for system use
  • c[0-15] (control register) Reserved by the kernel

Although not listed in the above requirements, preserves_flags is implemented in #111331.


cc @uweigand

r? @Amanieu

@rustbot label +O-SystemZ

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. O-SystemZ Target: SystemZ processors (s390x) labels Oct 4, 2024
@Amanieu Amanieu added T-lang Relevant to the language team, which will review and decide on the PR/issue. I-lang-easy-decision Issue: The decision needed by the team is conjectured to be easy. and removed T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 4, 2024
@Amanieu
Copy link
Member

Amanieu commented Oct 4, 2024

LGTM, but stabilization needs a T-lang FCP.

@taiki-e
Copy link
Member Author

taiki-e commented Oct 9, 2024

@rustbot label +S-waiting-on-team +needs-fcp

@rustbot rustbot added needs-fcp This change is insta-stable, so needs a completed FCP to proceed. S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). labels Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-lang-easy-decision Issue: The decision needed by the team is conjectured to be easy. needs-fcp This change is insta-stable, so needs a completed FCP to proceed. O-SystemZ Target: SystemZ processors (s390x) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants