Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rustc: Rewrite platform intrinsics crate
This commit rewrites (updates) the `rustc_platform_intrinsics` crate in this repository. This crate was previously procedurally generated from a number of JSON files and was intended to be the basis for how we bind SIMD in Rust. This crate is quite old at this point and is actually only used very little. The `stdsimd` crate and `std::arch` modules are the "new" way for stabilizing SIMD intrinsics. Despite this, however, the crate isn't useless! Most LLVM intrinsics are called directly in the `stdsimd` crate using the `link_llvm_intrinsics` feature, but not all intrinsics can be expressed directly in Rust. Instead some intrinsics, notably those that return LLVM aggregates, need to be compiler-defined to ensure they're declared with the correct signature. A good example of this is the x86 rdrand/rdseed family of LLVM intrinsics, all of which return an aggregate of some form. The stdsimd functions which provide these x86 intrinsics link to functions defined by this crate, so we need to keep those! Adding all that together, this commit performs the following tasks: * Deletes the now-outdated `src/etc/platform-intrinsics` infrastructure * Deletes all `src/librustc_platform_intrinsics/*` intrinsics that are otherwise compatible to be defined in Rust itself. This includes everything that doesn't deal with aggregates basically. Empty architecture files are removed. * The style of `src/librustc_platform_intrinsics/` was updated slightly to make it a bit easier to handwrite. The `x86` rdrand/rdseed intrinsics and some `aarch64` intrinsics which return aggregates have all survived to continue to be defined by this crate. Closes #41885
- Loading branch information