summaryrefslogtreecommitdiffstats
path: root/contrib/gcc
diff options
context:
space:
mode:
authormm <mm@FreeBSD.org>2011-03-16 12:40:58 +0000
committermm <mm@FreeBSD.org>2011-03-16 12:40:58 +0000
commit0ef0516836e9f3918c51602ae86816750dbed5f2 (patch)
tree30cc550daadc91b15a46890d6afed5b2a5bcaa90 /contrib/gcc
parent18c497939abd17b5b1a7c20b41c1e778e9894668 (diff)
downloadFreeBSD-src-0ef0516836e9f3918c51602ae86816750dbed5f2.zip
FreeBSD-src-0ef0516836e9f3918c51602ae86816750dbed5f2.tar.gz
Fix -march/-mtune=native autodetection for Intel Core 2 CPUs
Obtained from: gcc 4.3 (partial rev. 119454; GPLv2) MFC after: 2 weeks
Diffstat (limited to 'contrib/gcc')
-rw-r--r--contrib/gcc/config/i386/driver-i386.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/contrib/gcc/config/i386/driver-i386.c b/contrib/gcc/config/i386/driver-i386.c
index ffcee4e..cb9c6c3 100644
--- a/contrib/gcc/config/i386/driver-i386.c
+++ b/contrib/gcc/config/i386/driver-i386.c
@@ -39,6 +39,7 @@ const char *host_detect_local_cpu (int argc, const char **argv);
#define bit_SSE2 (1 << 26)
#define bit_SSE3 (1 << 0)
+#define bit_SSSE3 (1 << 9)
#define bit_CMPXCHG16B (1 << 13)
#define bit_3DNOW (1 << 31)
@@ -66,7 +67,7 @@ const char *host_detect_local_cpu (int argc, const char **argv)
unsigned int vendor;
unsigned int ext_level;
unsigned char has_mmx = 0, has_3dnow = 0, has_3dnowp = 0, has_sse = 0;
- unsigned char has_sse2 = 0, has_sse3 = 0, has_cmov = 0;
+ unsigned char has_sse2 = 0, has_sse3 = 0, has_ssse3 = 0, has_cmov = 0;
unsigned char has_longmode = 0, has_cmpxchg8b = 0;
unsigned char is_amd = 0;
unsigned int family = 0;
@@ -107,6 +108,7 @@ const char *host_detect_local_cpu (int argc, const char **argv)
has_sse = !!(edx & bit_SSE);
has_sse2 = !!(edx & bit_SSE2);
has_sse3 = !!(ecx & bit_SSE3);
+ has_ssse3 = !!(ecx & bit_SSSE3);
/* We don't care for extended family. */
family = (eax >> 8) & ~(1 << 4);
@@ -148,7 +150,9 @@ const char *host_detect_local_cpu (int argc, const char **argv)
/* We have no idea. Use something reasonable. */
if (arch)
{
- if (has_sse3)
+ if (has_ssse3)
+ cpu = "core2";
+ else if (has_sse3)
{
if (has_longmode)
cpu = "nocona";
@@ -230,6 +234,9 @@ const char *host_detect_local_cpu (int argc, const char **argv)
cpu = "generic";
}
break;
+ case PROCESSOR_GEODE:
+ cpu = "geode";
+ break;
case PROCESSOR_K6:
if (has_3dnow)
cpu = "k6-3";
OpenPOWER on IntegriCloud