This commit is contained in:
Jorijn van der Graaf 2026-05-18 20:33:47 +02:00
commit 35091b2c53
5 changed files with 322 additions and 12 deletions

View file

@ -28,12 +28,12 @@ extern "C" Configuration CrafterBuildProject(std::span<const std::string_view> a
cfg.GetInterfacesAndImplementations(ifaces, impls);
}
auto addTest = [&](std::string_view testName, std::string march, std::string mtune) {
auto addTest = [&](std::string_view testName, std::string march, std::string mtune, std::string target = {}) {
Test t;
t.config.path = "./";
t.config.name = std::format("{}-{}", testName, march);
t.config.outputName = t.config.name;
t.config.target = cfg.target;
t.config.target = target.empty() ? cfg.target : target;
t.config.type = ConfigurationType::Executable;
t.config.march = march;
t.config.mtune = mtune;
@ -44,10 +44,23 @@ extern "C" Configuration CrafterBuildProject(std::span<const std::string_view> a
t.config.GetInterfacesAndImplementations(ifaces, impls);
cfg.tests.push_back(std::move(t));
};
const std::string_view target = cfg.target;
const bool isX86 = target.starts_with("x86_64") || target.starts_with("i686");
const bool isRiscv = target.starts_with("riscv");
for (std::string_view name : { "Vector", "Intersection", "Matrix" }) {
addTest(name, "sapphirerapids", "native");
addTest(name, "x86-64-v4", "generic");
addTest(name, "x86-64-v3", "generic");
if (isX86) {
addTest(name, "sapphirerapids", "native");
addTest(name, "x86-64-v4", "generic");
addTest(name, "x86-64-v3", "generic");
}
if (isRiscv) {
// RISC-V tiers, mirroring the x86 selector: register width is
// picked from the guaranteed VLEN encoded in the march's Zvl*
// suffix. rv64gcv → ZVL128B (matches the RVA23 baseline).
addTest(name, "rv64gcv_zvl512b", "generic");
addTest(name, "rv64gcv_zvl256b", "generic");
addTest(name, "rv64gcv", "generic");
}
}
return cfg;