Backport -march=native support for Ivy Bridge (core-avx-i) and Haswell (core-avx2). http://gcc.gnu.org/PR57927 commit 78a5e928bc94e1ef35dc15853a609863bd10b327 Author: uros Date: Wed Aug 28 08:25:13 2013 +0000 Backport from mainline 2013-08-27 H.J. Lu * config/i386/driver-i386.c (host_detect_local_cpu): Update Haswell processor detection. Backport from mainline 2013-08-27 Christian Widmer PR target/57927 * config/i386/driver-i386.c (host_detect_local_cpu): Add detection of Ivy Bridge and Haswell processors. Assume core-avx2 for unknown AVX2 capable processors. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@202045 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 20 ++++++++++++++++++-- gcc/config/i386/driver-i386.c | 30 ++++++++++++++++++++---------- 2 files changed, 38 insertions(+), 12 deletions(-) --- a/gcc/config/i386/driver-i386.c +++ b/gcc/config/i386/driver-i386.c @@ -638,13 +638,18 @@ const char *host_detect_local_cpu (int argc, const char **argv) /* Atom. */ cpu = "atom"; break; + case 0x0f: + /* Merom. */ + case 0x17: + case 0x1d: + /* Penryn. */ + cpu = "core2"; + break; case 0x1a: case 0x1e: case 0x1f: case 0x2e: /* Nehalem. */ - cpu = "corei7"; - break; case 0x25: case 0x2c: case 0x2f: @@ -656,20 +661,25 @@ const char *host_detect_local_cpu (int argc, const char **argv) /* Sandy Bridge. */ cpu = "corei7-avx"; break; - case 0x17: - case 0x1d: - /* Penryn. */ - cpu = "core2"; + case 0x3a: + case 0x3e: + /* Ivy Bridge. */ + cpu = "core-avx-i"; break; - case 0x0f: - /* Merom. */ - cpu = "core2"; + case 0x3c: + case 0x45: + case 0x46: + /* Haswell. */ + cpu = "core-avx2"; break; default: if (arch) { /* This is unknown family 0x6 CPU. */ - if (has_avx) + if (has_avx2) + /* Assume Haswell. */ + cpu = "core-avx2"; + else if (has_avx) /* Assume Sandy Bridge. */ cpu = "corei7-avx"; else if (has_sse4_2)