Skip to content

aarch64-nintendo-switch-freestanding - Enable CPU features that are always available in a live system (crypto instructions, plus explicit NEON). #144613

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

Merged
merged 2 commits into from
Aug 22, 2025

Conversation

pantsman0
Copy link
Contributor

@pantsman0 pantsman0 commented Jul 29, 2025

While some NEON and crypto features may not be supported on the Nintendo Switch at boot (e.g. on the a53 cores) and this has not been tested, the features will always be available if running as a sysmodule or homebrew application under Horizon/Atmosphere. EDIT: the a53 cores are fused out, these features are always available.

This has been tested with local tools personally, as well as building emuiibo as it uses both sha and aes primitives. This was tested using inline assembly in previous versions, and in current versions by using the aes, ctr, hmac, and sha2 crates.

r? @jam1garner

This ended up being much delayed from our discussions about updating this. I tested a number of individual features such as the aes and sha2 target-features directly to avoid a warning message with the crypto feature, but that appears to be caused by #96472 and is not actually an issue.

There is also a decision to make here about explicitly enabling the neon feature. I am in favor of it to be explicit, but it is not necessary as it is already enabled by the v8a and crypto features. I will defer to your decision as it does not change the actual instructions available for codegen.

While some neon and crypto features may not be supported on the switch at boot (e.g. on the a53 cores), the features will _always_ be available if running as a sysmodule or homebrew application under Horizon/Atmosphere.
@rustbot
Copy link
Collaborator

rustbot commented Jul 29, 2025

Failed to set assignee to jam1garner: invalid assignee

Note: Only org members with at least the repository "read" role, users with write permissions, or people who have commented on the PR may be assigned.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 29, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 29, 2025

These commits modify compiler targets.
(See the Target Tier Policy.)

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jul 29, 2025
@pantsman0 pantsman0 changed the title Enable CPU features that are always available in a live system (crypto instructions, plus explicit NEON). aarch64-nintendo-switch-freestanding - Enable CPU features that are always available in a live system (crypto instructions, plus explicit NEON). Jul 29, 2025
@pantsman0
Copy link
Contributor Author

The crc features has also been added, as it is always available on the T210.

Copy link
Contributor

@jam1garner jam1garner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Good catch, these features should've been included in the first place

@jieyouxu

This comment was marked as resolved.

@wesleywiser
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Aug 21, 2025

📌 Commit 05cd6e8 has been approved by wesleywiser

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 21, 2025
@jieyouxu jieyouxu assigned wesleywiser and unassigned jieyouxu Aug 21, 2025
bors added a commit that referenced this pull request Aug 21, 2025
Rollup of 16 pull requests

Successful merges:

 - #137494 (libstd: init(): dup() subsequent /dev/nulls instead of opening them again)
 - #144541 (c-variadic: multiple ABIs in the same program for arm)
 - #144613 (aarch64-nintendo-switch-freestanding - Enable CPU features that are always available in a live system (crypto instructions, plus explicit NEON).)
 - #144780 (Add a method to dump MIR in the middle of MIR building)
 - #145137 (Consolidate panicking functions in `slice/index.rs`)
 - #145507 (Refactor attribute parsing to improve ergonomics and some diagnostics)
 - #145604 (Gate static closures behind a parser feature)
 - #145648 (Add two tidy dependency checks)
 - #145661 (update some s390x codegen tests)
 - #145672 (Instantiate higher-ranked binder with erased when checking `IntoIterator` predicate for query instability)
 - #145689 (Migrate `panic_unwind` to use `cfg_select!`)
 - #145700 (Handle `ReEarlyParam` in `type_name`.)
 - #145703 (Remove MIPS targets from CI LLVM platforms)
 - #145704 (ci: don't cleanup windows disk)
 - #145705 (remove an `as` cast in prefetch codegen)
 - #145712 (Update outdated link in bound region comments)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 057fee9 into rust-lang:master Aug 22, 2025
10 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Aug 22, 2025
rust-timer added a commit that referenced this pull request Aug 22, 2025
Rollup merge of #144613 - pantsman0:nintendo_switch_cpu_features, r=wesleywiser

aarch64-nintendo-switch-freestanding - Enable CPU features that are always available in a live system (crypto instructions, plus explicit NEON).

~~While some NEON and crypto features may not be supported on the Nintendo Switch at boot (e.g. on the a53 cores) and this has not been tested, the features will _always_ be available if running as a sysmodule or homebrew application under Horizon/Atmosphere.~~ EDIT:  the a53 cores are fused out, these features are always available.

This has been tested with local tools personally, as well as building [emuiibo](https://github.com/XorTroll/emuiibo) as it uses both `sha` and `aes` primitives. This was tested using inline assembly in previous versions, and in current versions by using the `aes`, `ctr`, `hmac`, and `sha2` crates.

r? `@jam1garner`

This ended up being much delayed from our discussions about updating this. I tested a number of individual features such as the `aes` and `sha2` target-features directly to avoid a warning message with the `crypto` feature, but that appears to be caused by #96472 and is not actually an issue.

There is also a decision to make here about explicitly enabling the `neon` feature. I am in favor of it to be explicit, but it is not necessary as it is already enabled by the `v8a` and `crypto` features. I will defer to your decision as it does not change the actual instructions available for codegen.
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Aug 22, 2025
Rollup of 16 pull requests

Successful merges:

 - rust-lang/rust#137494 (libstd: init(): dup() subsequent /dev/nulls instead of opening them again)
 - rust-lang/rust#144541 (c-variadic: multiple ABIs in the same program for arm)
 - rust-lang/rust#144613 (aarch64-nintendo-switch-freestanding - Enable CPU features that are always available in a live system (crypto instructions, plus explicit NEON).)
 - rust-lang/rust#144780 (Add a method to dump MIR in the middle of MIR building)
 - rust-lang/rust#145137 (Consolidate panicking functions in `slice/index.rs`)
 - rust-lang/rust#145507 (Refactor attribute parsing to improve ergonomics and some diagnostics)
 - rust-lang/rust#145604 (Gate static closures behind a parser feature)
 - rust-lang/rust#145648 (Add two tidy dependency checks)
 - rust-lang/rust#145661 (update some s390x codegen tests)
 - rust-lang/rust#145672 (Instantiate higher-ranked binder with erased when checking `IntoIterator` predicate for query instability)
 - rust-lang/rust#145689 (Migrate `panic_unwind` to use `cfg_select!`)
 - rust-lang/rust#145700 (Handle `ReEarlyParam` in `type_name`.)
 - rust-lang/rust#145703 (Remove MIPS targets from CI LLVM platforms)
 - rust-lang/rust#145704 (ci: don't cleanup windows disk)
 - rust-lang/rust#145705 (remove an `as` cast in prefetch codegen)
 - rust-lang/rust#145712 (Update outdated link in bound region comments)

r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants