mirror of
https://github.com/odin-lang/Odin.git
synced 2026-02-15 15:44:04 +00:00
Suggest -microarch:native if popcnt instruction is missing.
Fixes #4453.
This commit is contained in:
13
src/main.cpp
13
src/main.cpp
@@ -3321,6 +3321,19 @@ int main(int arg_count, char const **arg_ptr) {
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(GB_CPU_X86)
|
||||
// We've detected that the CPU doesn't support popcnt, or another reason to use `-microarch:native`,
|
||||
// and that no custom microarch was chosen.
|
||||
if (should_use_march_native() && march == get_default_microarchitecture()) {
|
||||
if (command == "run" || command == "test") {
|
||||
gb_printf_err("Error: Try using '-microarch:native' as Odin defaults to %.*s (close to Nehalem) by default and your CPU seems to be a much older CPU.\n", LIT(march));
|
||||
gb_exit(1);
|
||||
} else if (command == "build") {
|
||||
gb_printf("Suggestion: Try using '-microarch:native' as Odin defaults to %.*s (close to Nehalem) by default and your CPU seems to be a much older CPU.\n", LIT(march));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (build_context.target_features_string.len != 0) {
|
||||
String_Iterator target_it = {build_context.target_features_string, 0};
|
||||
for (;;) {
|
||||
|
||||
Reference in New Issue
Block a user