about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-04-12 18:29:25 +0000
committerbors <bors@rust-lang.org>2021-04-12 18:29:25 +0000
commitd0695c9081b16077d0aed368bccaf437d77ff497 (patch)
treee502b113ff2c7ff88e2f5f29b23eace25b85886c
parent1284da34da56a17ae368e4673920ec4120562cbd (diff)
parent1b0b7e95be5f0da032ddd35226792ca469c21684 (diff)
downloadrust-d0695c9081b16077d0aed368bccaf437d77ff497.tar.gz
rust-d0695c9081b16077d0aed368bccaf437d77ff497.zip
Auto merge of #83776 - jyn514:update-stdarch-docs, r=Amanieu
Update stdarch submodule (to before it switched to const generics)

https://github.com/rust-lang/rust/pull/83278#issuecomment-812389823: This unblocks #82539.

Major changes:
- More AVX-512 intrinsics.
- More ARM & AArch64 NEON intrinsics.
- Updated unstable WASM intrinsics to latest draft standards.
- std_detect is now a separate crate instead of a submodule of std.

I double-checked and the first use of const generics looks like https://github.com/rust-lang/stdarch/commit/8d5017861ed594a2baf169e632379862d516e013, which isn't included in this PR.

r? `@Amanieu`
-rw-r--r--Cargo.lock12
-rw-r--r--Cargo.toml2
-rw-r--r--library/std/Cargo.toml5
-rw-r--r--library/std/src/lib.rs22
m---------library/stdarch0
5 files changed, 25 insertions, 16 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 58e1d1db55a..8fec4bf128f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -5034,11 +5034,23 @@ dependencies = [
  "profiler_builtins",
  "rand 0.7.3",
  "rustc-demangle",
+ "std_detect",
  "unwind",
  "wasi",
 ]
 
 [[package]]
+name = "std_detect"
+version = "0.1.5"
+dependencies = [
+ "cfg-if 0.1.10",
+ "compiler_builtins",
+ "libc",
+ "rustc-std-workspace-alloc",
+ "rustc-std-workspace-core",
+]
+
+[[package]]
 name = "string_cache"
 version = "0.8.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/Cargo.toml b/Cargo.toml
index 95a15a9d7a4..02011357eac 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -45,6 +45,8 @@ exclude = [
   # not all `Cargo.toml` files are available, so we exclude the `x` binary,
   # so it can be invoked before the current checkout is set up.
   "src/tools/x",
+  # stdarch has its own Cargo workspace
+  "library/stdarch",
 ]
 
 [profile.release.package.compiler_builtins]
diff --git a/library/std/Cargo.toml b/library/std/Cargo.toml
index 84a64228921..ab7b142ef3d 100644
--- a/library/std/Cargo.toml
+++ b/library/std/Cargo.toml
@@ -21,6 +21,7 @@ compiler_builtins = { version = "0.1.39" }
 profiler_builtins = { path = "../profiler_builtins", optional = true }
 unwind = { path = "../unwind" }
 hashbrown = { version = "0.11", default-features = false, features = ['rustc-dep-of-std'] }
+std_detect = { path = "../stdarch/crates/std_detect", default-features = false, features = ['rustc-dep-of-std'] }
 
 # Dependencies of the `backtrace` crate
 addr2line = { version = "0.14.0", optional = true, default-features = false }
@@ -70,8 +71,8 @@ panic_immediate_abort = ["core/panic_immediate_abort"]
 
 # Enable std_detect default features for stdarch/crates/std_detect:
 # https://github.com/rust-lang/stdarch/blob/master/crates/std_detect/Cargo.toml
-std_detect_file_io = []
-std_detect_dlsym_getauxval = []
+std_detect_file_io = ["std_detect/std_detect_file_io"]
+std_detect_dlsym_getauxval = ["std_detect/std_detect_dlsym_getauxval"]
 
 [package.metadata.fortanix-sgx]
 # Maximum possible number of threads when testing
diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs
index 91695ced6a9..18ad2077d83 100644
--- a/library/std/src/lib.rs
+++ b/library/std/src/lib.rs
@@ -538,22 +538,16 @@ pub mod rt;
 #[allow(dead_code, unused_attributes)]
 mod backtrace_rs;
 
-// Pull in the `std_detect` crate directly into libstd. The contents of
-// `std_detect` are in a different repository: rust-lang/stdarch.
-//
-// `std_detect` depends on libstd, but the contents of this module are
-// set up in such a way that directly pulling it here works such that the
-// crate uses the this crate as its libstd.
-#[path = "../../stdarch/crates/std_detect/src/mod.rs"]
-#[allow(missing_debug_implementations, missing_docs, dead_code)]
-#[unstable(feature = "stdsimd", issue = "48556")]
-#[cfg(not(test))]
-mod std_detect;
-
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub use std_detect::is_x86_feature_detected;
 #[doc(hidden)]
 #[unstable(feature = "stdsimd", issue = "48556")]
-#[cfg(not(test))]
-pub use std_detect::detect;
+pub use std_detect::*;
+#[unstable(feature = "stdsimd", issue = "48556")]
+pub use std_detect::{
+    is_aarch64_feature_detected, is_arm_feature_detected, is_mips64_feature_detected,
+    is_mips_feature_detected, is_powerpc64_feature_detected, is_powerpc_feature_detected,
+};
 
 // Re-export macros defined in libcore.
 #[stable(feature = "rust1", since = "1.0.0")]
diff --git a/library/stdarch b/library/stdarch
-Subproject 9c732a56f67f54d12a0b4fd99993154906c95ea
+Subproject 19f5459dd0f89e466b7bcaa0f69ecca90f21a4d