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 Arm64EC inline assembly #131781

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 16, 2024

This stabilizes inline assembly for Arm64EC ("Emulation Compatible").

Corresponding reference PR: rust-lang/reference#1653


From the requirements of stabilization mentioned in #93335

Each architecture needs to be reviewed before stabilization:

  • It must have clobber_abi.

Done in #131332.

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

This is possible from the time of the initial implementation.

  • Generally review that the exposed register classes make sense.

The registers available in this target are a subset of those available in the AArch64 inline assembly which is already stable.

The following registers cannot be used in Arm64EC compared to AArch64:

  • x13, x14, x23, x24, x28 (register class: reg)
  • v[16-31] (register class: vreg)
  • p[0-15], ffr (clobber-only register class preg)

These are disallowed by the ABI (see also abi docs for reg/vreg and #131332 (comment) for preg).

Although not listed in the above requirements, preserves_flags is also implemented and the same as AArch64.


cc @dpaoliello

r? @Amanieu

@rustbot label O-windows O-AArch64 +A-inline-assembly +T-lang -T-compiler +needs-fcp

(T-lang FCP is needed after the review by the reviewer per #131258 (comment))

@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. A-inline-assembly Area: Inline assembly (`asm!(…)`) needs-fcp This change is insta-stable, so needs a completed FCP to proceed. O-AArch64 Armv8-A or later processors in AArch64 mode O-windows Operating system: Windows T-lang Relevant to the language team, which will review and decide on the PR/issue. labels Oct 16, 2024
@rustbot rustbot removed the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Oct 16, 2024
@dpaoliello
Copy link
Contributor

I'm fine with stabilizing this, but we should include a link to the Microsoft docs: https://learn.microsoft.com/en-us/windows/arm/arm64ec-abi#authoring-arm64ec-in-assembly

At the very least, it should be noted that devs will need to call the appropriate thunks, and I don't believe there's any way to request that new thunks are generated.

@tgross35
Copy link
Contributor

This will probably need lang input like #131258.

@rustbot label +I-lang-easy-decision

@rustbot rustbot added the I-lang-easy-decision Issue: The decision needed by the team is conjectured to be easy. label Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-inline-assembly Area: Inline assembly (`asm!(…)`) 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-AArch64 Armv8-A or later processors in AArch64 mode O-windows Operating system: Windows S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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.

5 participants