diff --git a/crates/std_detect/src/detect/arch/x86.rs b/crates/std_detect/src/detect/arch/x86.rs index 893e1a887f..fe9ec95ef6 100644 --- a/crates/std_detect/src/detect/arch/x86.rs +++ b/crates/std_detect/src/detect/arch/x86.rs @@ -91,6 +91,7 @@ features! { /// * `"cmpxchg16b"` /// * `"adx"` /// * `"rtm"` + /// * `"movbe"` /// /// [docs]: https://software.intel.com/sites/landingpage/IntrinsicsGuide #[stable(feature = "simd_x86", since = "1.27.0")] @@ -194,4 +195,6 @@ features! { /// ADX, Intel ADX (Multi-Precision Add-Carry Instruction Extensions) @FEATURE: #[stable(feature = "simd_x86", since = "1.27.0")] rtm: "rtm"; /// RTM, Intel (Restricted Transactional Memory) + @FEATURE: #[stable(feature = "movbe_target_feature", since = "1.67.0")] movbe: "movbe"; + /// MOVBE (Move Data After Swapping Bytes) } diff --git a/crates/std_detect/src/detect/os/x86.rs b/crates/std_detect/src/detect/os/x86.rs index ea5f595ec9..0c8ce303a2 100644 --- a/crates/std_detect/src/detect/os/x86.rs +++ b/crates/std_detect/src/detect/os/x86.rs @@ -111,6 +111,7 @@ pub(crate) fn detect_features() -> cache::Initializer { enable(proc_info_ecx, 13, Feature::cmpxchg16b); enable(proc_info_ecx, 19, Feature::sse4_1); enable(proc_info_ecx, 20, Feature::sse4_2); + enable(proc_info_ecx, 22, Feature::movbe); enable(proc_info_ecx, 23, Feature::popcnt); enable(proc_info_ecx, 25, Feature::aes); enable(proc_info_ecx, 29, Feature::f16c); diff --git a/crates/std_detect/tests/cpu-detection.rs b/crates/std_detect/tests/cpu-detection.rs index 9daaa65804..00933f44dc 100644 --- a/crates/std_detect/tests/cpu-detection.rs +++ b/crates/std_detect/tests/cpu-detection.rs @@ -155,6 +155,7 @@ fn x86_all() { println!("abm: {:?}", is_x86_feature_detected!("abm")); println!("lzcnt: {:?}", is_x86_feature_detected!("lzcnt")); println!("tbm: {:?}", is_x86_feature_detected!("tbm")); + println!("movbe: {:?}", is_x86_feature_detected!("movbe")); println!("popcnt: {:?}", is_x86_feature_detected!("popcnt")); println!("fxsr: {:?}", is_x86_feature_detected!("fxsr")); println!("xsave: {:?}", is_x86_feature_detected!("xsave")); diff --git a/crates/std_detect/tests/x86-specific.rs b/crates/std_detect/tests/x86-specific.rs index 59e9a62fdb..b23971bc2c 100644 --- a/crates/std_detect/tests/x86-specific.rs +++ b/crates/std_detect/tests/x86-specific.rs @@ -67,6 +67,7 @@ fn dump() { println!("cmpxchg16b: {:?}", is_x86_feature_detected!("cmpxchg16b")); println!("adx: {:?}", is_x86_feature_detected!("adx")); println!("rtm: {:?}", is_x86_feature_detected!("rtm")); + println!("movbe: {:?}", is_x86_feature_detected!("movbe")); } #[cfg(feature = "std_detect_env_override")] @@ -155,4 +156,5 @@ fn compare_with_cupid() { ); assert_eq!(is_x86_feature_detected!("adx"), information.adx(),); assert_eq!(is_x86_feature_detected!("rtm"), information.rtm(),); + assert_eq!(is_x86_feature_detected!("movbe"), information.movbe(),); }