Mercurial > hg > CbC > CbC_gcc
diff gcc/config/i386/driver-i386.c @ 67:f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author | nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 22 Mar 2011 17:18:12 +0900 |
parents | b7f97abdc517 |
children | 04ced10e8804 |
line wrap: on
line diff
--- a/gcc/config/i386/driver-i386.c Tue May 25 18:58:51 2010 +0900 +++ b/gcc/config/i386/driver-i386.c Tue Mar 22 17:18:12 2011 +0900 @@ -1,5 +1,5 @@ /* Subroutines for the gcc driver. - Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc. + Copyright (C) 2006, 2007, 2008, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -21,7 +21,6 @@ #include "system.h" #include "coretypes.h" #include "tm.h" -#include <stdlib.h> const char *host_detect_local_cpu (int argc, const char **argv); @@ -397,6 +396,7 @@ unsigned int has_popcnt = 0, has_aes = 0, has_avx = 0; unsigned int has_pclmul = 0, has_abm = 0, has_lwp = 0; unsigned int has_fma4 = 0, has_xop = 0; + unsigned int has_bmi = 0, has_tbm = 0; bool arch; @@ -463,10 +463,15 @@ has_lwp = ecx & bit_LWP; has_fma4 = ecx & bit_FMA4; has_xop = ecx & bit_XOP; + has_tbm = ecx & bit_TBM; has_longmode = edx & bit_LM; has_3dnowp = edx & bit_3DNOWP; has_3dnow = edx & bit_3DNOW; + + __cpuid (0x7, eax, ebx, ecx, edx); + + has_bmi = ebx & bit_BMI; } if (!arch) @@ -495,6 +500,8 @@ processor = PROCESSOR_GEODE; else if (has_xop) processor = PROCESSOR_BDVER1; + else if (has_sse4a && has_ssse3) + processor = PROCESSOR_BTVER1; else if (has_sse4a) processor = PROCESSOR_AMDFAM10; else if (has_sse2 || has_longmode) @@ -554,21 +561,26 @@ case 0x1e: case 0x1f: case 0x2e: - /* FIXME: Optimize for Nehalem. */ - cpu = "core2"; + /* Nehalem. */ + cpu = "corei7"; break; case 0x25: + case 0x2c: case 0x2f: - /* FIXME: Optimize for Westmere. */ - cpu = "core2"; + /* Westmere. */ + cpu = "corei7"; + break; + case 0x2a: + /* Sandy Bridge. */ + cpu = "corei7-avx"; break; case 0x17: case 0x1d: - /* Penryn. FIXME: -mtune=core2 is slower than -mtune=generic */ + /* Penryn. */ cpu = "core2"; break; case 0x0f: - /* Merom. FIXME: -mtune=core2 is slower than -mtune=generic */ + /* Merom. */ cpu = "core2"; break; default: @@ -637,6 +649,9 @@ case PROCESSOR_BDVER1: cpu = "bdver1"; break; + case PROCESSOR_BTVER1: + cpu = "btver1"; + break; default: /* Use something reasonable. */ @@ -686,6 +701,10 @@ options = concat (options, " -mfma4", NULL); if (has_xop) options = concat (options, " -mxop", NULL); + if (has_bmi) + options = concat (options, " -mbmi", NULL); + if (has_tbm) + options = concat (options, " -mtbm", NULL); if (has_avx) options = concat (options, " -mavx", NULL);