-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 on 32-bit ARM #111800
Comments
In #126555 all SIMD types have been changed to require |
So what happens when I use the type and don't have NEON enabled? |
Note that this feature is currently unsound due to #129880. |
I appear to have missed a few words: the PR changes it so that NEON is required to use the SIMD types as inputs or outputs of inline assembly. Non-inline-assembly uses are unaffected. I've updated the original comment. |
Ah, makes sense. :) Once #127731 lands, we should probably also require NEON when passing vectors to/from non-Rust-ABI functions. |
Another unsoundness due to codegen: rust-lang/stdarch#1217 |
Currently only runs on `aarch64`, because `arm` NEON intrinsics are unstable: rust-lang/rust#111800
32-bit ARM is both [locked behind nightly](rust-lang/rust#111800) and [unsound](rust-lang/rust#129880).
#127731 has been merged in October 2024, any updates on this one? |
I noticed that the concerns around NEON requirements for inline assembly and non-Rust ABI functions have been addressed, and #127731 has already landed. Given that the API of these intrinsics will not change further; I've prepared a PR (which I haven't yet opened) to move forward with stabilisation. The PR also includes improvements to the documentation of these intrinsics. Would it be possible to move forward with this? The soundness issue appears to be endemic to any platform, possibly even any compiler using LLVM as a backend as the same issue is observed in C/C++ when using LLVM. Given this, it seems to be a separate problem from stabilizing the API of these intrinsics. |
The first thing that needs to be done before any stabilization here is cleaning up and stabilizing the target features for AArch32. This will be needed for any of these intrinsics to actually be called. |
No, this is an ARM-32 issue. Most1 other platforms implement floating-points properly, without mandatory subnormal flushing. So I am not happy with the idea of "let's just hope this soundness issue disappears by itself later". We shouldn't add operations to Rust that we know are unsound without a plan for how to make them sound. Footnotes
|
I initially thought the same issue affected x86 32-bit, but after scrolling through the ticket, it seems like it may possibly have been resolved: llvm/llvm-project#89885. That said, I could be wrong, changing the rounding mode of floats appears to cause a similar issue regardless of Arm-32: rust-lang/unsafe-code-guidelines#471 (comment) I completely understand your concern about not introducing unsound behavior into Rust. However, stabilizing the API for Neon intrinsics seems like a separate matter from resolving these issues. We should certainly document this issue when using them, but I thought the stabilization process was more about the API design rather than its implementation? |
Sure, if you call the deprecated, unsafe, and documented-to-be-unsound-never-use-this operations that change the rounding mode then you get in trouble. That's multiple light years away from "I used a normal, maybe even safe NEON intrinsic and got unsoundness".
Clearly we wouldn't stabilize something whose implementation is incomplete or buggy, no matter how sure we are about the API -- in particular if there are questions about how a correct implementation could even be achieved. |
Feature gate:
#![feature(stdarch_arm_neon_intrinsics)]
This is a tracking issue for the NEON intrinsics in
core::arch::arm
. This was split off from #90972 which tracked the AArch64 NEON intrinsics which have now been stabilized.Public API
Everything in
core::arch::arm
that starts with the letterv
.Steps / History
Unresolved Questions
Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩
The text was updated successfully, but these errors were encountered: