ISPC: Fix object suffix for dotted target names

ISPC target names containing dots, such as `avx10.2dmr-x16`, produce
output files with underscores in the ISA suffix (e.g. `_avx10_2dmr`).
The `ComputeISPCObjectSuffixes` function did not account for this,
causing a mismatch between the predicted and actual object file names.

Replace dots with underscores in the extracted target suffix to match
ISPC's `ISAToString()` behavior.  Also add mappings for `sse4.1`
and `sse4.2` target name variants, which ISPC both maps to `sse4`.
This commit is contained in:
Philipp Kolberg authored and Brad King committed 2026-04-03 09:37:58 -04:00
1 parent aa6f936d6c
commit b53f020b47
1 file changed
+6
+6
View File
@@ -5238,9 +5238,15 @@ std::vector<std::string> ComputeISPCObjectSuffixes(cmGeneratorTarget* target)
// transform targets into the suffixes
auto pos = ispcTarget.find('-');
auto target_suffix = ispcTarget.substr(0, pos);
// ISPC uses underscores in output file suffixes where the target name
// has dots (e.g. "avx10.2dmr" produces files with "_avx10_2dmr" suffix)
std::replace(target_suffix.begin(), target_suffix.end(), '.', '_');
if (target_suffix ==
"avx1") { // when targeting avx1 ISPC uses the 'avx' output string
target_suffix = "avx";
} else if (target_suffix == "sse4_1" || target_suffix == "sse4_2") {
// when targeting sse4.1 or sse4.2 ISPC uses the 'sse4' output string
target_suffix = "sse4";
}
ispcTarget = target_suffix;
}