Bug 1882291. Switch to stdarch_arm_neon_intrinsics feature on rust >=1.78. r=glandium
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Tue, 05 Mar 2024 03:12:28 +0000 (16 months ago)
changeset 698059 e9b01ce8e2fe053ffef77505f05cf18ed0b9fcd2
parent 698058 171664703051d94e1be995b74ad97a9dff5beea5
child 698060 61bb37d1ba16985ef9e5cd99cd02912849f743a3
push id41627
push usernfay@mozilla.com
push dateTue, 05 Mar 2024 09:48:50 +0000 (16 months ago)
treeherdermozilla-central@63e18d5ef9ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1882291
milestone125.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1882291. Switch to stdarch_arm_neon_intrinsics feature on rust >=1.78. r=glandium We only need this on ARM32 because the ARM64 intrinsics are stable. stdarch_arm_neon_intrinsics was split out from stdsimd here: https://github.com/rust-lang/stdarch/pull/1486 Differential Revision: https://phabricator.services.mozilla.com/D203039
Cargo.lock
gfx/qcms/Cargo.toml
gfx/qcms/build.rs
gfx/qcms/src/lib.rs
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4579,16 +4579,17 @@ dependencies = [
  "libc",
 ]
 
 [[package]]
 name = "qcms"
 version = "0.3.0"
 dependencies = [
  "libc",
+ "version_check",
 ]
 
 [[package]]
 name = "qlog"
 version = "0.12.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "9c0407438c69b3d99714a796a135cbfb2d60744e4747fb2b46a87acd1c1fcd0e"
 dependencies = [
--- a/gfx/qcms/Cargo.toml
+++ b/gfx/qcms/Cargo.toml
@@ -15,8 +15,11 @@ categories = ["graphics"]
 default = ["iccv4-enabled", "cmyk"]
 c_bindings = ["libc"]
 neon = []
 iccv4-enabled = []
 cmyk = []
 
 [dependencies]
 libc = {version = "0.2", optional = true }
+
+[build-dependencies]
+version_check = "0.9"
new file mode 100644
--- /dev/null
+++ b/gfx/qcms/build.rs
@@ -0,0 +1,7 @@
+extern crate version_check as rustc;
+
+fn main() {
+    if rustc::is_min_version("1.78.0").unwrap_or(false) {
+        println!("cargo:rustc-cfg=stdsimd_split");
+    }
+}
--- a/gfx/qcms/src/lib.rs
+++ b/gfx/qcms/src/lib.rs
@@ -2,19 +2,21 @@
 */
 
 #![allow(dead_code)]
 #![allow(non_camel_case_types)]
 #![allow(non_snake_case)]
 #![allow(non_upper_case_globals)]
 // These are needed for the neon SIMD code and can be removed once the MSRV supports the
 // instrinsics we use
-#![cfg_attr(feature = "neon", feature(stdsimd))]
+#![cfg_attr(all(stdsimd_split, target_arch = "arm", feature = "neon"), feature(stdarch_arm_neon_intrinsics))]
+#![cfg_attr(all(stdsimd_split, target_arch = "arm", feature = "neon"), feature(stdarch_arm_feature_detection))]
+#![cfg_attr(all(not(stdsimd_split), target_arch = "arm", feature = "neon"), feature(stdsimd))]
 #![cfg_attr(
-    feature = "neon",
+    all(target_arch = "arm", feature = "neon"),
     feature(arm_target_feature, raw_ref_op)
 
 )]
 
 /// These values match the Rendering Intent values from the ICC spec
 #[repr(C)]
 #[derive(Clone, Copy, Debug)]
 pub enum Intent {