diff --git a/library/stdarch/crates/stdsimd-verify/tests/x86-intel.rs b/library/stdarch/crates/stdsimd-verify/tests/x86-intel.rs index 4a81b8f16d2c..eb84c8d0d701 100644 --- a/library/stdarch/crates/stdsimd-verify/tests/x86-intel.rs +++ b/library/stdarch/crates/stdsimd-verify/tests/x86-intel.rs @@ -273,15 +273,25 @@ fn matches(rust: &Function, intel: &Intrinsic) -> Result<(), String> { .flat_map(|c| c.to_lowercase()) .collect::(); + // The XML file names IFMA as "avx512ifma52", while Rust calls + // it "avx512ifma". Fix this mismatch by replacing the Intel + // name with the Rust name. + let fixup_cpuid = |cpuid: String| match cpuid.as_ref() { + "avx512ifma52" => String::from("avx512ifma"), + _ => cpuid, + }; + let fixed_cpuid = fixup_cpuid(cpuid); + let rust_feature = rust .target_feature .expect(&format!("no target feature listed for {}", rust.name)); - if rust_feature.contains(&cpuid) { + + if rust_feature.contains(&fixed_cpuid) { continue; } bail!( "intel cpuid `{}` not in `{}` for {}", - cpuid, + fixed_cpuid, rust_feature, rust.name )