diff options
author | Torbjorn Granlund <tege@gmplib.org> | 2014-04-03 16:32:16 +0200 |
---|---|---|
committer | Torbjorn Granlund <tege@gmplib.org> | 2014-04-03 16:32:16 +0200 |
commit | 05bc27cf742146fafe698bf01e2ef3fe19849c6a (patch) | |
tree | 5ee911daa76c0bf4dc9979b10961111b36080524 /config.guess | |
parent | 1b494d3bf64b950adc2c832219760e056dbba124 (diff) | |
download | gmp-05bc27cf742146fafe698bf01e2ef3fe19849c6a.tar.gz |
Handle the situation where a CPU knows about AVX but the kernel does not.
Diffstat (limited to 'config.guess')
-rwxr-xr-x | config.guess | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/config.guess b/config.guess index 02b61f45a..71dae0737 100755 --- a/config.guess +++ b/config.guess @@ -755,9 +755,9 @@ main () char dummy_string[12]; long fms; int family, model, stepping; - const char *modelstr; + const char *modelstr, *suffix; int cpu_64bit = 0; - int cpuid_64bit; + int cpuid_64bit, cpuid_avx, cpuid_osxsave; CPUID (vendor_string, 0); vendor_string[12] = 0; @@ -768,6 +768,10 @@ main () model = ((fms >> 4) & 0xf) + ((fms >> 12) & 0xf0); stepping = fms & 0xf; + cpuid_avx = (dummy_string[11] >> 4) & 1; + cpuid_osxsave = (dummy_string[11] >> 3) & 1; + suffix = cpuid_avx > cpuid_osxsave ? "noavx" : ""; + modelstr = "$guess_cpu"; /**************************************************/ @@ -905,7 +909,7 @@ main () if (cpuid_64bit && ! cpu_64bit) modelstr = "x86_64"; - printf ("%s", modelstr); + printf ("%s%s", modelstr, suffix); return 0; } EOF |