-
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
Tracking Issue for NEON intrinsics #90972
Comments
Could we clarify exactly what we're going to do? For example, the feature needs to be added to the rustc? |
I created an updated list of intrinsics that are missing/broken compared to Clang and the ARM intrinsic database CSV in rust-lang/stdarch#1258. Thanks to @JamieCunliffe for writing the tool to automate the testing of the intrinsics. AArch64This looks pretty good. We are only missing:
I think we can start the process of stabilizing the AArch64 intrinsics now, conditional on fixing the LLVM ICEs. The missing intrinsics can be added later. ARMThe situation here is a bit uglier and I don't think we can stabilize this as it is.
|
Team member @Amanieu 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! See this document for info about what commands tagged team members can give me. |
I would say GCC is correct here, in https://github.com/ARM-software/acle/blob/main/main/acle.rst#scalar-data-types For the LLVM ICE is there a bug for this? I'll take a look into it if no one else has. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
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. |
update stdarch 2 commits in d219ad6..0716b22 2021-12-9 23:50:37 +0000 to 2021-12-14 16:17:57 +0100 * Fix a bunch of typos ([Fix a bunch of typos stdarch#1267](rust-lang/stdarch#1267)) * Stabilize armv8 neon instruction set on aarch64 ([Stabilize armv8 neon instruction set on aarch64 stdarch#1266](rust-lang/stdarch#1266)) The update stabilizes armv8 neon instructions on aarch64. rust-lang#90972
update stdarch 2 commits in d219ad6..0716b22 2021-12-9 23:50:37 +0000 to 2021-12-14 16:17:57 +0100 * Fix a bunch of typos ([Fix a bunch of typos stdarch#1267](rust-lang/stdarch#1267)) * Stabilize armv8 neon instruction set on aarch64 ([Stabilize armv8 neon instruction set on aarch64 stdarch#1266](rust-lang/stdarch#1266)) The update stabilizes armv8 neon instructions on aarch64. rust-lang#90972
update stdarch 2 commits in d219ad6..0716b22 2021-12-9 23:50:37 +0000 to 2021-12-14 16:17:57 +0100 * Fix a bunch of typos ([Fix a bunch of typos stdarch#1267](rust-lang/stdarch#1267)) * Stabilize armv8 neon instruction set on aarch64 ([Stabilize armv8 neon instruction set on aarch64 stdarch#1266](rust-lang/stdarch#1266)) The update stabilizes armv8 neon instructions on aarch64. rust-lang#90972
update stdarch 2 commits in d219ad6..0716b22 2021-12-9 23:50:37 +0000 to 2021-12-14 16:17:57 +0100 * Fix a bunch of typos ([Fix a bunch of typos stdarch#1267](rust-lang/stdarch#1267)) * Stabilize armv8 neon instruction set on aarch64 ([Stabilize armv8 neon instruction set on aarch64 stdarch#1266](rust-lang/stdarch#1266)) The update stabilizes armv8 neon instructions on aarch64. rust-lang#90972
The next step is to stabilize the NEON intrinsics on ARM. Looking at the list of intrinsics which are failing the tests, I consider the following entries to be blockers:
Once these are fixed, we should be able to move forward with stabilizing the ARM intrinsics and also resolve rust-lang/stdarch#1268. |
rust-lang/stdarch#1266 has landed and shipped in 1.59. Should this issue be closed, or is there something else left to do? |
Only aarch64/armv8 neon support was stabilized, this issue also tracks armv7 neon. |
I am trying to understand what exactly has been stabilized and what target feature is needed to use the simd intrinsics on aarch64 but when I go to https://doc.rust-lang.org/core/arch/aarch64/fn.vdupq_n_u8.html it says that the intrinsic is still unstable:
Additionally, it says that the target feature bash-5.1# cat neon.rs
use std::arch::aarch64::*;
pub fn main() {
let a = unsafe { vdupq_n_u8(7) };
println!("a = {:?}", a);
}
bash-5.1# rustc neon.rs
bash-5.1# ./neon
a = uint8x16_t(7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7)
bash-5.1# rustc --version
rustc 1.59.0 (9d1b2106e 2022-02-23) For posterity, here is a screenshot of what you can currently see for libcore aarch64 simd intrinsics: |
This is a rustdoc bug. The intrinsics that are shared with the 32-bit ARM targets are basically partially stable; stable on AArch64, unstable on 32-bit. Rustdoc doesn't seem to be able to handle that. As to why you don't need to specify neon: It's an active by default target feature of AArch64. However even if it wasn't, you would still be able to unsafely call it, it would just be "UB" (I think) to call the instruction without having ensured (at least at runtime) the CPU actually supports it. |
Thank you for your answer, that explains everything. Even though, from a user perspective, I think it's very confusing. At least, it was very confusing for me. Is there an issue opened for the rustdoc bug already? If not, I can create one. For the neon target feature, it's a bit weird to advertise it in the doc as a regular target feature that looks like needed to be enabled. Would it be possible to add a note saying it's enabled by default for aarch64? I can provide the PR, I just don't know where to look. |
Additionally, I tried this small snippet: use std::arch::aarch64::*;
#[target_feature(enable = "neon")]
unsafe fn aarch64_intrinsic() {
let a = unsafe { vdupq_n_u8(7) };
println!("a = {:?}", a);
}
pub fn main() {
unsafe { aarch64_intrinsic() };
} Which doesn't compile because the
Now, I understand even less what has been stabilized. |
…table Note, neon still requires a nightly compiler to enable, this just means we don't need an explicit flag to detect this. And this code should "just work" when neon becomes stable. The state of things is a bit confusing. SIMD in Rust: rust-lang/rust#48556 NEON in Rust: rust-lang/rust#90972
Hello, any news on this? And if contributions are possible to push towards stabilization what's currently missing? |
@IceTDrinker Most NEON intrinsics were stabilized for AArch64. To resolve this for 32-bit Armv7 requires implementation, debugging their apparent lack of support, and any bugs with them mentioned in rust-lang/stdarch. In addition, some things are still not implemented, and to finish this out, we would want to implement the last barrage of intrinsics. Basically, just covering everything mentioned in #90972 (comment) |
Thanks, I was mainly asking for aarch64 intrisics, will take a look at the link and failing tests, but I'm afraid I don't have an arm32 machine to take a shot at fixing those (plus I'm more than a beginner contributing to a language/compiler) |
I would add this information to the issue title. |
It seems like this is the tracking issue for NEON on 32-bit ARM: #111800 |
Yes, this tracking issue is now complete and AArch32 NEON support is tracked in #111800. |
Feature gate:
#![feature(neon_intrinsics)]
This is a tracking issue for NEON SIMD intrinsics on ARM and AArch64. These intrinsics can be found in the
std::arch::arm
andstd::arch::aarch64
modules.Public API
The NEON intrinsics that are covered by this tracking issue consist of all the ARM/AArch64 intrinsics in those modules that start with the letter
v
. These are checked against the equivalent Clang intrinsics using automated verifiers.Unresolved Questions
The text was updated successfully, but these errors were encountered: