-
Notifications
You must be signed in to change notification settings - Fork 14k
Integrate Arm SVE types and intrinsics into stdarch #149297
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
Conversation
Extend parsing of `ReprOptions` with `rustc_scalable_vector(N)` which optionally accepts a single literal integral value - the base multiple of lanes that are in a scalable vector. Can only be applied to structs. Co-authored-by: Jamie Cunliffe <Jamie.Cunliffe@arm.com>
Extend well-formedness checking and HIR analysis to prohibit the use of scalable vectors in structs, enums, unions, tuples and arrays. LLVM does not support scalable vectors being members of other types, so these restrictions are necessary. Co-authored-by: Jamie Cunliffe <Jamie.Cunliffe@arm.com>
`simd_reinterpret` is a replacement for `transmute`, specifically for use with scalable SIMD types. It is used in the tests for scalable vectors and in stdarch. Co-authored-by: Jamie Cunliffe <Jamie.Cunliffe@arm.com>
Introduces `BackendRepr::ScalableVector` corresponding to scalable vector types annotated with `repr(scalable)` which lowers to a scalable vector type in LLVM. Co-authored-by: Jamie Cunliffe <Jamie.Cunliffe@arm.com>
LLVM doesn't handle stores on `<vscale x N x i1>` for `N != 16`, a type used internally in SVE intrinsics. Spilling to the stack to create debuginfo will cause errors during instruction selection. These types that are an internal implementation detail to the intrinsic, so users should never see them types and won't need any debuginfo. Co-authored-by: Jamie Cunliffe <Jamie.Cunliffe@arm.com>
Scalable vectors cannot be members of ADTs and thus cannot be kept over await points in async functions.
Scalable vector types only work with the relevant target features enabled, so require this for any function with the types in its signature.
Trivial changes to rust-analyzer to keep it compiling with changes to `ReprOptions`.
This commit introduces a new file containing a comprehensive set of SVE (Scalable Vector Extension) intrinsics for the AArch64 architecture. The intrinsics include functions for absolute comparisons (greater than, less than, equal to) and arithmetic operations (addition, subtraction) for various data types (float, int) and their respective vector representations. Each function is annotated with documentation links to Arm's official documentation and includes test assertions for validation. The addition of these intrinsics enhances the support for scalable vector types in Rust, aligning with recent changes to the compiler and standard library to accommodate scalable SIMD operations. Co-authored-by: Jamie Cunliffe <Jamie.Cunliffe@arm.com>
This commit introduces a new module for Scalable Vector Extension (SVE) intrinsics specific to the AArch64 architecture. It includes the implementation of scalar type conversions, SIMD functions, and core SVE types such as `svbool_t`, `svint8_t`, and their variants. The new files `mod.rs`, `sve2.rs`, and `types.rs` provide foundational support for SVE operations, enhancing the Rust standard library's capabilities for scalable SIMD programming. The implementation includes traits for scalar conversion and type casting, ensuring compatibility with various data types. This addition lays the groundwork for future enhancements and optimizations in SIMD operations within Rust. Co-authored-by: Jamie Cunliffe <Jamie.Cunliffe@arm.com>
…t` )(`svcmp*`, `svc*` )(`svaddv`, `svcnt*`, `svclz/cls` )
…t` )(`svcmp*`, `svc*` )(`svaddv`, `svcnt*`, `svclz/cls` )(`svadr*`, `svld*`, `svst*` )(`svbic*`, `svbrk*`, `svcmla`)
…static dispatch for SVE select operations. Update documentation for clarity and maintainability.
…pe conversion documentation. Refactor existing conversion implementations for clarity and consistency.
|
rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead. cc @rust-lang/rust-analyzer
cc @Amanieu, @folkertdev, @sayantn Some changes occurred to the CTFE machinery Some changes occurred in compiler/rustc_attr_parsing Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter cc @rust-lang/miri, @RalfJung, @oli-obk, @lcnr Some changes occurred in compiler/rustc_hir/src/attrs Changes to the size of AST and/or HIR nodes. cc @nnethercote Some changes occurred in compiler/rustc_codegen_gcc Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred to the platform-builtins intrinsics. Make sure the cc @antoyo, @GuillaumeGomez, @bjorn3, @calebzulawski, @programmerjake changes to the core type system Some changes occurred in compiler/rustc_passes/src/check_attr.rs This PR changes rustc_public |
|
rustbot has assigned @Mark-Simulacrum. Use |
|
|
Hi. This is the moderation team of the Rust project. The comments left by you are significantly too verbose. While being detailed is good, please be respectful of reviewer time and avoid verbose text that mostly doesn't convey any useful content. We are closing and locking this PR, but you're welcome to reopen this contribution in a new PR with more concise wording. It is perfectly fine to just leave a one line comment and bullet points otherwise if this is easier for you. If you would like some help with that, please ensure you're familiar with our contribution guidelines and feel free to either reach out to moderation or ask on the Zulip stream for general help from other contributors. If you are unsure how concise to make your message, you can include the full message in a Note that this is a moderation warning. Repetitions of such overly verbose messages will result in a ban from contributing to our project. You can contact the moderation team to discuss your warning. |
|
I would add, please write commit messages in English, so that one has to learn only one language to get around the Rust project. |
Background:
RFC 3838 introduces a new internal compiler attribute
#[rustc_scalable_vector(N)]to define scalable vector types in the Rust standard library.PR143924 is a preliminary experimental implementation of RFC 3838, aiming to allow types with a single field to be converted to scalable vectors at the codegen backend.
This PR is based on these previous works.
Summary:
This PR integrates Arm SVE (Scalable Vector Extension) types and intrinsics into the Rust
stdarchlibrary, enabling support for scalable vector operations on aarch64 targets.Key changes:
1. Type System Integration
aarch64/sve/types.rsusing#[rustc_scalable_vector(N)]attributesmod sve;topub mod sve;inaarch64/mod.rsaarch64/sve/mod.rsto ensure types and functions are accessible2. Type Conversion Layer
core::mem::transmute_copysimd_castandsimd_reinterpretas safe bit-level operations for layout-compatible types3. Selection Operation Implementation
extern "C"with unique link names for each