-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
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
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon. |
1d84152
to
965a280
Compare
(Rebased to resolve merge conflict with #131258) |
…iaskrgr Rollup of 3 pull requests Successful merges: - rust-lang#131781 (Stabilize Arm64EC inline assembly) - rust-lang#132426 (Prefer `pub(super)` in `unreachable_pub` lint suggestion) - rust-lang#132866 (Break from review rotation) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#131781 - taiki-e:arm64ec-stabilize-asm, r=Amanieu,traviscross Stabilize Arm64EC inline assembly This stabilizes inline assembly for Arm64EC ("Emulation Compatible"). Corresponding reference PR: rust-lang/reference#1653 --- From the requirements of stabilization mentioned in rust-lang#93335 > Each architecture needs to be reviewed before stabilization: > - It must have clobber_abi. Done in rust-lang#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](https://learn.microsoft.com/en-us/cpp/build/arm64ec-windows-abi-conventions?view=msvc-170#register-mapping) for `reg`/`vreg` and rust-lang#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
…manieu,traviscross Stabilize Arm64EC inline assembly This stabilizes inline assembly for Arm64EC ("Emulation Compatible"). Corresponding reference PR: rust-lang/reference#1653 --- From the requirements of stabilization mentioned in rust-lang#93335 > Each architecture needs to be reviewed before stabilization: > - It must have clobber_abi. Done in rust-lang#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](https://learn.microsoft.com/en-us/cpp/build/arm64ec-windows-abi-conventions?view=msvc-170#register-mapping) for `reg`/`vreg` and rust-lang#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
…iaskrgr Rollup of 3 pull requests Successful merges: - rust-lang#131781 (Stabilize Arm64EC inline assembly) - rust-lang#132426 (Prefer `pub(super)` in `unreachable_pub` lint suggestion) - rust-lang#132866 (Break from review rotation) r? `@ghost` `@rustbot` modify labels: rollup
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