Skip to content

Commit b1d365d

Browse files
hdevalencegnzlbg
authored andcommitted
Add a fixup pass for cpuid values when validating XML.
1 parent 553fdab commit b1d365d

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

crates/stdsimd-verify/tests/x86-intel.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,15 +273,25 @@ fn matches(rust: &Function, intel: &Intrinsic) -> Result<(), String> {
273273
.flat_map(|c| c.to_lowercase())
274274
.collect::<String>();
275275

276+
// The XML file names IFMA as "avx512ifma52", while Rust calls
277+
// it "avx512ifma". Fix this mismatch by replacing the Intel
278+
// name with the Rust name.
279+
let fixup_cpuid = |cpuid: String| match cpuid.as_ref() {
280+
"avx512ifma52" => String::from("avx512ifma"),
281+
_ => cpuid,
282+
};
283+
let fixed_cpuid = fixup_cpuid(cpuid);
284+
276285
let rust_feature = rust
277286
.target_feature
278287
.expect(&format!("no target feature listed for {}", rust.name));
279-
if rust_feature.contains(&cpuid) {
288+
289+
if rust_feature.contains(&fixed_cpuid) {
280290
continue;
281291
}
282292
bail!(
283293
"intel cpuid `{}` not in `{}` for {}",
284-
cpuid,
294+
fixed_cpuid,
285295
rust_feature,
286296
rust.name
287297
)

0 commit comments

Comments
 (0)