about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAmanieu d'Antras <amanieu@gmail.com>2023-10-27 13:37:04 +0100
committerAmanieu d'Antras <amanieu@gmail.com>2023-10-29 20:39:50 +0100
commitea27e5cfcb0bf156e11d45fd439ccbf539cd1d18 (patch)
tree2f5dea2aea729cb8f0973698d0ca6fce7483f620
parent3e5850284a518dff59f691e50fe0d7efded9ff56 (diff)
Fix various compilation errors
-rw-r--r--library/stdarch/crates/core_arch/src/arm/mod.rs2
-rw-r--r--library/stdarch/crates/core_arch/src/lib.rs1
-rw-r--r--library/stdarch/crates/intrinsic-test/src/main.rs8
-rw-r--r--library/stdarch/crates/std_detect/src/lib.rs2
-rw-r--r--library/stdarch/crates/std_detect/tests/cpu-detection.rs29
-rw-r--r--library/stdarch/crates/std_detect/tests/macro_trailing_commas.rs4
-rw-r--r--library/stdarch/crates/stdarch-verify/tests/arm.rs3
-rw-r--r--library/stdarch/examples/connect5.rs4
8 files changed, 36 insertions, 17 deletions
diff --git a/library/stdarch/crates/core_arch/src/arm/mod.rs b/library/stdarch/crates/core_arch/src/arm/mod.rs
index d994508e817..217906c78da 100644
--- a/library/stdarch/crates/core_arch/src/arm/mod.rs
+++ b/library/stdarch/crates/core_arch/src/arm/mod.rs
@@ -11,6 +11,8 @@
 mod sat;
 
 #[cfg(any(target_feature = "v6", doc))]
+// Remove warning because this module is currently empty.
+#[allow(unused_imports)]
 pub use self::sat::*;
 
 // Supported arches: 5TE, 7E-M. See Section 10.1 of ACLE (e.g. QADD)
diff --git a/library/stdarch/crates/core_arch/src/lib.rs b/library/stdarch/crates/core_arch/src/lib.rs
index 155363b892d..ed301e208a3 100644
--- a/library/stdarch/crates/core_arch/src/lib.rs
+++ b/library/stdarch/crates/core_arch/src/lib.rs
@@ -74,6 +74,7 @@ mod core_arch;
 #[stable(feature = "stdsimd", since = "1.27.0")]
 pub mod arch {
     #[stable(feature = "stdsimd", since = "1.27.0")]
+    #[allow(unused_imports)]
     pub use crate::core_arch::arch::*;
     #[stable(feature = "stdsimd", since = "1.27.0")]
     pub use core::arch::asm;
diff --git a/library/stdarch/crates/intrinsic-test/src/main.rs b/library/stdarch/crates/intrinsic-test/src/main.rs
index 162d3a72bd3..3c181584bef 100644
--- a/library/stdarch/crates/intrinsic-test/src/main.rs
+++ b/library/stdarch/crates/intrinsic-test/src/main.rs
@@ -166,6 +166,14 @@ fn generate_rust_program(notices: &str, intrinsic: &Intrinsic, a32: bool) -> Str
     format!(
         r#"{notices}#![feature(simd_ffi)]
 #![feature(link_llvm_intrinsics)]
+#![cfg_attr(target_arch = "arm", feature(stdarch_arm_neon_intrinsics))]
+#![feature(stdarch_arm_crc32)]
+#![cfg_attr(target_arch = "aarch64", feature(stdarch_neon_fcma))]
+#![cfg_attr(target_arch = "aarch64", feature(stdarch_neon_dotprod))]
+#![cfg_attr(target_arch = "aarch64", feature(stdarch_neon_i8mm))]
+#![cfg_attr(target_arch = "aarch64", feature(stdarch_neon_sha3))]
+#![cfg_attr(target_arch = "aarch64", feature(stdarch_neon_sm4))]
+#![cfg_attr(target_arch = "aarch64", feature(stdarch_neon_ftts))]
 #![allow(overflowing_literals)]
 #![allow(non_upper_case_globals)]
 use core_arch::arch::{target_arch}::*;
diff --git a/library/stdarch/crates/std_detect/src/lib.rs b/library/stdarch/crates/std_detect/src/lib.rs
index 1ff42000992..5862ada21db 100644
--- a/library/stdarch/crates/std_detect/src/lib.rs
+++ b/library/stdarch/crates/std_detect/src/lib.rs
@@ -21,6 +21,8 @@
 #![no_std]
 #![allow(internal_features)]
 // Temporary hack: needed to build against toolchains from before the mass feature renaming.
+// Remove this as soon as the stdarch submodule is updated on nightly.
+#![allow(stable_features)]
 #![feature(stdsimd)]
 
 #[cfg(test)]
diff --git a/library/stdarch/crates/std_detect/tests/cpu-detection.rs b/library/stdarch/crates/std_detect/tests/cpu-detection.rs
index f20ea6a2f77..8d551fc2cb7 100644
--- a/library/stdarch/crates/std_detect/tests/cpu-detection.rs
+++ b/library/stdarch/crates/std_detect/tests/cpu-detection.rs
@@ -1,19 +1,20 @@
-#![feature(
-    stdarch_internal,
-    stdarch_arm_feature_detection,
-    stdarch_powerpc_feature_detection
-)]
+#![feature(stdarch_internal)]
+#![cfg_attr(target_arch = "arm", feature(stdarch_arm_feature_detection))]
+#![cfg_attr(target_arch = "powerpc", feature(stdarch_powerpc_feature_detection))]
+#![cfg_attr(target_arch = "powerpc64", feature(stdarch_powerpc_feature_detection))]
 #![allow(clippy::unwrap_used, clippy::use_debug, clippy::print_stdout)]
-#![cfg(any(
-    target_arch = "arm",
-    target_arch = "aarch64",
-    target_arch = "x86",
-    target_arch = "x86_64",
-    target_arch = "powerpc",
-    target_arch = "powerpc64"
-))]
 
-#[macro_use]
+#[cfg_attr(
+    any(
+        target_arch = "arm",
+        target_arch = "aarch64",
+        target_arch = "x86",
+        target_arch = "x86_64",
+        target_arch = "powerpc",
+        target_arch = "powerpc64"
+    ),
+    macro_use
+)]
 extern crate std_detect;
 
 #[test]
diff --git a/library/stdarch/crates/std_detect/tests/macro_trailing_commas.rs b/library/stdarch/crates/std_detect/tests/macro_trailing_commas.rs
index 3d5c736a053..8304b225f53 100644
--- a/library/stdarch/crates/std_detect/tests/macro_trailing_commas.rs
+++ b/library/stdarch/crates/std_detect/tests/macro_trailing_commas.rs
@@ -1,4 +1,6 @@
-#![feature(stdarch_arm_feature_detection, stdarch_powerpc_feature_detection)]
+#![cfg_attr(target_arch = "arm", feature(stdarch_arm_feature_detection))]
+#![cfg_attr(target_arch = "powerpc", feature(stdarch_powerpc_feature_detection))]
+#![cfg_attr(target_arch = "powerpc64", feature(stdarch_powerpc_feature_detection))]
 #![allow(clippy::unwrap_used, clippy::use_debug, clippy::print_stdout)]
 
 #[cfg(any(
diff --git a/library/stdarch/crates/stdarch-verify/tests/arm.rs b/library/stdarch/crates/stdarch-verify/tests/arm.rs
index 84131c0fbec..d6f8e69acb6 100644
--- a/library/stdarch/crates/stdarch-verify/tests/arm.rs
+++ b/library/stdarch/crates/stdarch-verify/tests/arm.rs
@@ -1,8 +1,9 @@
+#![allow(unused)]
+
 use std::collections::HashMap;
 
 use serde::Deserialize;
 
-#[allow(unused)]
 struct Function {
     name: &'static str,
     arguments: &'static [&'static Type],
diff --git a/library/stdarch/examples/connect5.rs b/library/stdarch/examples/connect5.rs
index 6298255421a..ffbff5e4869 100644
--- a/library/stdarch/examples/connect5.rs
+++ b/library/stdarch/examples/connect5.rs
@@ -28,7 +28,9 @@
 //! You should see a game self-playing. In the end of the game, it shows the average time for
 //! each move.
 
-#![feature(avx512_target_feature, stdarch_x86_avx512)]
+#![feature(avx512_target_feature)]
+#![cfg_attr(target_arch = "x86", feature(stdarch_x86_avx512))]
+#![cfg_attr(target_arch = "x86_64", feature(stdarch_x86_avx512))]
 #![feature(stmt_expr_attributes)]
 
 use rand::seq::SliceRandom;