-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
base: master
Are you sure you want to change the base?
Conversation
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. |
LGTM but needs lang FCP. |
LGTM. @rfcbot merge |
Team member @joshtriplett has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns. |
Thanks for the feedback. I added this to rules for inline assembly in the rust-lang/reference PR. |
@dpaoliello Will devs need to ask for new thunks to be generated, or are there existing thunks they can reach? |
@rustbot labels +I-lang-nominated Hopefully easy decisions still need a nomination for them to come up on our agenda. |
The thunks have different names and contents depending on the function signature (return and param types and calling conv). So if you are handwriting a function call to an x64 function, a function pointer, or an extern function that you don't know is ARM64EC then you need to call via a thunk with the appropriate name. If LLVM detects that some other code also needs that thunk then it will get generated, if not then you'll get a linker failure for an undefined symbol (the thunk you're calling). If the dev needs a thunk generated, then they can use cc-rs to build a C file with MSVC that will request the thunk is generated: https://learn.microsoft.com/en-us/windows/arm/arm64ec-abi#generating-entry-and-exit-thunks So, again, not a blocker but devs must be aware that ARM64EC is ✨special✨ hence why I requested a link to the docs. |
@rfcbot reviewed |
1 similar comment
@rfcbot reviewed |
As before I am going to mark this as reviewed but I wish we had clearer lines of ownership @rfcbot reviewed |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
☔ The latest upstream changes (presumably #132470) made this pull request unmergeable. Please resolve the merge conflicts. |
b4b8a73
to
a2763c8
Compare
☔ The latest upstream changes (presumably #131341) made this pull request unmergeable. Please resolve the merge conflicts. |
a2763c8
to
3357314
Compare
☔ The latest upstream changes (presumably #132472) made this pull request unmergeable. Please resolve the merge conflicts. |
3357314
to
1d84152
Compare
This stabilizes inline assembly for Arm64EC ("Emulation Compatible").
Corresponding reference PR: rust-lang/reference#1653
From the requirements of stabilization mentioned in #93335
Done in #131332.
This is possible from the time of the initial implementation.
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 classpreg
)These are disallowed by the ABI (see also abi docs for
reg
/vreg
and #131332 (comment) forpreg
).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