From patchwork Sat Dec 29 16:57:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [RFC,x86] Changes for AVX and AVX2 processors Date: Sat, 29 Dec 2012 06:57:18 -0000 From: Vladimir Yakovlev X-Patchwork-Id: 208675 Message-Id: To: Uros Bizjak Cc: gcc-patches@gcc.gnu.org I did changes. Please take a look. 2012/12/29, Uros Bizjak : > On Sat, Dec 29, 2012 at 6:26 AM, Vladimir Yakovlev > wrote: > >> processor_alias_table contains the same processor type for all >> "corei7", "corei7-avx", "core-avx-i" and "core-avx2". At least, it has >> consequence on checking x86_avx256_split_unaligned_load & >> ix86_tune_mask: for all these processors it results the same. Moreover >> we cannot turn new features on for AVX/AVX2 using >> initial_ix86_tune_features. > > corei7, corei7-avx and core-avx-i are all based on sandybridge (= > PROCESSOR_COREI7) architecture. The only problematic entry is > core-avx2, which should be based on new architecture. I propose > PROCESSOR_HASWELL, in the same way as we have PROCESSOR_NOCONA. > > Uros. > diff --git a/gcc/config/i386/i386-c.c b/gcc/config/i386/i386-c.c index 08e1afe..2d8abd5 100644 --- a/gcc/config/i386/i386-c.c +++ b/gcc/config/i386/i386-c.c @@ -142,11 +142,7 @@ ix86_target_macros_internal (HOST_WIDE_INT isa_flag, def_or_undef (parse_in, "__corei7"); def_or_undef (parse_in, "__corei7__"); break; - case PROCESSOR_CORE_AVX: - def_or_undef (parse_in, "__core_avx"); - def_or_undef (parse_in, "__core_avx__"); - break; - case PROCESSOR_CORE_AVX2: + case PROCESSOR_HASWELL: def_or_undef (parse_in, "__core_avx2"); def_or_undef (parse_in, "__core_avx2__"); break; @@ -240,10 +236,7 @@ ix86_target_macros_internal (HOST_WIDE_INT isa_flag, case PROCESSOR_COREI7: def_or_undef (parse_in, "__tune_corei7__"); break; - case PROCESSOR_CORE_AVX: - def_or_undef (parse_in, "__tune_core_avx__"); - break; - case PROCESSOR_CORE_AVX2: + case PROCESSOR_HASWELL: def_or_undef (parse_in, "__tune_core_avx2__"); break; case PROCESSOR_ATOM: diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 10411da..4adbef6 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -1732,9 +1732,8 @@ const struct processor_costs *ix86_cost = &pentium_cost; #define m_P4_NOCONA (m_PENT4 | m_NOCONA) #define m_CORE2 (1<