std.Target.CpuFeatures is now a struct with both CPU and feature set

Previously it was a tagged union which was one of:
 * baseline
 * a specific CPU
 * a set of features

Now, it's possible to have a CPU but also modify the CPU's feature set
on top of that. This is closer to what LLVM does.

This is more correct because Zig's notion of CPUs (and LLVM's) is not
exact CPU models. For example "skylake" is not one very specific model;
there are several different pieces of hardware that match "skylake" that
have different feature sets enabled.
This commit is contained in:
Andrew Kelley
2020-01-22 17:13:31 -05:00
parent c6bfece1d5
commit 48c7e6c48b
13 changed files with 555 additions and 655 deletions

View File

@@ -8581,7 +8581,7 @@ Buf *codegen_generate_builtin_source(CodeGen *g) {
stage2_cpu_features_get_builtin_str(g->zig_target->cpu_features, &ptr, &len);
buf_append_mem(contents, ptr, len);
} else {
buf_append_str(contents, ".baseline;\n");
buf_append_str(contents, "arch.getBaselineCpuFeatures();\n");
}
}
if (g->libc_link_lib != nullptr && g->zig_target->glibc_version != nullptr) {