From: mkuvyrkov Date: Thu, 2 Dec 2010 15:47:08 +0000 (+0000) Subject: Define tuning for Core 2 and Core i7. X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=commitdiff_plain;h=9a51684228b88f3f16f62d81c19f7e1a08f0ff1d Define tuning for Core 2 and Core i7. * config/i386/i386-c.c (ix86_target_macros_internal): Update. * config/i386/i386.c (core2_cost): Delete, use generic costs instead. (m_CORE2): Replace with m_CORE2_{32,64}. (m_CORE2I7{,_32,_64}): New macros. (m_GENERIC32, m_GENERIC64): Update. (initial_ix86_tune_features, x86_accumulate_outgoing_args,) (x86_arch_always_fancy_math_387): Set m_CORE2I7_32 iff m_GENERIC32 and set m_CORE2I7_64 iff m_GENERIC64. (processor_target_table): Use generic costs for Core 2 and Core i7. (ix86_option_override_internal): Update entries for Core 2 and Core i7. (ix86_issue_rate): Remove entry for Core 2. (ia32_multipass_dfa_lookahead, ix86_sched_init_global): Update. * config/i386/i386.h (TARGET_CORE2_32, TARGET_CORE2_64): New macros. (TARGET_CORE2): Update. (PROCESSOR_CORE2_32, PROCESSOR_CORE2_64): New constants. (PROCESSOR_CORE2): Remove. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167374 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b3a28872739..6d851c1350d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,24 @@ +2010-12-02 Maxim Kuvyrkov + + Define tuning for Core 2 and Core i7. + + * config/i386/i386-c.c (ix86_target_macros_internal): Update. + * config/i386/i386.c (core2_cost): Delete, use generic costs instead. + (m_CORE2): Replace with m_CORE2_{32,64}. + (m_CORE2I7{,_32,_64}): New macros. + (m_GENERIC32, m_GENERIC64): Update. + (initial_ix86_tune_features, x86_accumulate_outgoing_args,) + (x86_arch_always_fancy_math_387): Set m_CORE2I7_32 iff m_GENERIC32 and + set m_CORE2I7_64 iff m_GENERIC64. + (processor_target_table): Use generic costs for Core 2 and Core i7. + (ix86_option_override_internal): Update entries for Core 2 and Core i7. + (ix86_issue_rate): Remove entry for Core 2. + (ia32_multipass_dfa_lookahead, ix86_sched_init_global): Update. + * config/i386/i386.h (TARGET_CORE2_32, TARGET_CORE2_64): New macros. + (TARGET_CORE2): Update. + (PROCESSOR_CORE2_32, PROCESSOR_CORE2_64): New constants. + (PROCESSOR_CORE2): Remove. + 2010-12-02 Richard Guenther * lto-streamer.h (LTO_major_version): Bump to 2. diff --git a/gcc/config/i386/i386-c.c b/gcc/config/i386/i386-c.c index ca3517726cd..6adf6136791 100644 --- a/gcc/config/i386/i386-c.c +++ b/gcc/config/i386/i386-c.c @@ -118,7 +118,8 @@ ix86_target_macros_internal (int isa_flag, def_or_undef (parse_in, "__nocona"); def_or_undef (parse_in, "__nocona__"); break; - case PROCESSOR_CORE2: + case PROCESSOR_CORE2_32: + case PROCESSOR_CORE2_64: def_or_undef (parse_in, "__core2"); def_or_undef (parse_in, "__core2__"); break; @@ -199,7 +200,8 @@ ix86_target_macros_internal (int isa_flag, case PROCESSOR_NOCONA: def_or_undef (parse_in, "__tune_nocona__"); break; - case PROCESSOR_CORE2: + case PROCESSOR_CORE2_32: + case PROCESSOR_CORE2_64: def_or_undef (parse_in, "__tune_core2__"); break; case PROCESSOR_COREI7_32: diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index a66a0c4778b..93c105dd658 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -1410,79 +1410,6 @@ struct processor_costs nocona_cost = { }; static const -struct processor_costs core2_cost = { - COSTS_N_INSNS (1), /* cost of an add instruction */ - COSTS_N_INSNS (1) + 1, /* cost of a lea instruction */ - COSTS_N_INSNS (1), /* variable shift costs */ - COSTS_N_INSNS (1), /* constant shift costs */ - {COSTS_N_INSNS (3), /* cost of starting multiply for QI */ - COSTS_N_INSNS (3), /* HI */ - COSTS_N_INSNS (3), /* SI */ - COSTS_N_INSNS (3), /* DI */ - COSTS_N_INSNS (3)}, /* other */ - 0, /* cost of multiply per each bit set */ - {COSTS_N_INSNS (22), /* cost of a divide/mod for QI */ - COSTS_N_INSNS (22), /* HI */ - COSTS_N_INSNS (22), /* SI */ - COSTS_N_INSNS (22), /* DI */ - COSTS_N_INSNS (22)}, /* other */ - COSTS_N_INSNS (1), /* cost of movsx */ - COSTS_N_INSNS (1), /* cost of movzx */ - 8, /* "large" insn */ - 16, /* MOVE_RATIO */ - 2, /* cost for loading QImode using movzbl */ - {6, 6, 6}, /* cost of loading integer registers - in QImode, HImode and SImode. - Relative to reg-reg move (2). */ - {4, 4, 4}, /* cost of storing integer registers */ - 2, /* cost of reg,reg fld/fst */ - {6, 6, 6}, /* cost of loading fp registers - in SFmode, DFmode and XFmode */ - {4, 4, 4}, /* cost of storing fp registers - in SFmode, DFmode and XFmode */ - 2, /* cost of moving MMX register */ - {6, 6}, /* cost of loading MMX registers - in SImode and DImode */ - {4, 4}, /* cost of storing MMX registers - in SImode and DImode */ - 2, /* cost of moving SSE register */ - {6, 6, 6}, /* cost of loading SSE registers - in SImode, DImode and TImode */ - {4, 4, 4}, /* cost of storing SSE registers - in SImode, DImode and TImode */ - 2, /* MMX or SSE register to integer */ - 32, /* size of l1 cache. */ - 2048, /* size of l2 cache. */ - 128, /* size of prefetch block */ - 8, /* number of parallel prefetches */ - 3, /* Branch cost */ - COSTS_N_INSNS (3), /* cost of FADD and FSUB insns. */ - COSTS_N_INSNS (5), /* cost of FMUL instruction. */ - COSTS_N_INSNS (32), /* cost of FDIV instruction. */ - COSTS_N_INSNS (1), /* cost of FABS instruction. */ - COSTS_N_INSNS (1), /* cost of FCHS instruction. */ - COSTS_N_INSNS (58), /* cost of FSQRT instruction. */ - {{libcall, {{11, loop}, {-1, rep_prefix_4_byte}}}, - {libcall, {{32, loop}, {64, rep_prefix_4_byte}, - {8192, rep_prefix_8_byte}, {-1, libcall}}}}, - {{libcall, {{8, loop}, {15, unrolled_loop}, - {2048, rep_prefix_4_byte}, {-1, libcall}}}, - {libcall, {{24, loop}, {32, unrolled_loop}, - {8192, rep_prefix_8_byte}, {-1, libcall}}}}, - 1, /* scalar_stmt_cost. */ - 1, /* scalar load_cost. */ - 1, /* scalar_store_cost. */ - 1, /* vec_stmt_cost. */ - 1, /* vec_to_scalar_cost. */ - 1, /* scalar_to_vec_cost. */ - 1, /* vec_align_load_cost. */ - 2, /* vec_unalign_load_cost. */ - 1, /* vec_store_cost. */ - 3, /* cond_taken_branch_cost. */ - 1, /* cond_not_taken_branch_cost. */ -}; - -static const struct processor_costs atom_cost = { COSTS_N_INSNS (1), /* cost of an add instruction */ COSTS_N_INSNS (1) + 1, /* cost of a lea instruction */ @@ -1713,9 +1640,13 @@ const struct processor_costs *ix86_cost = &pentium_cost; #define m_PPRO (1<