Message ID | 4CB82839.5050609@codesourcery.com |
---|---|
State | New |
Headers | show |
On Fri, Oct 15, 2010 at 3:08 AM, Maxim Kuvyrkov <maxim@codesourcery.com> wrote: > + 0001-Basic-support-for-Core-i7.patch > > Baseline. > > The patch makes GCC recognize "corei7" for -mtune= and -march= options. > The patch sets tuning for Core i7 to that of -mtune=generic or > -mtune=generic64 depending on the {-m32/-m64} option. The generic CPU is > special in the sense that has different tuning for 32-bit and 64-bit modes. > The patch adds same capability to use different tuning for different ABI > for Core i7. > I don't think it is needed. We added GENERIC32/GENRIC64 so that we can tune for 32bit/64bit in i386.c and *.md. PTA_TUNE32 is only used in ix86_option_override_internal where we know we are compiling for 32bit or 64bit. We can use TARGET_64BIT instead of adding PTA_TUNE32.
On Fri, Oct 15, 2010 at 3:08 AM, Maxim Kuvyrkov <maxim@codesourcery.com> wrote: > [Resending without printed out version of the spreadsheet to fit into > gcc-patches@ size requirements.] > > I've been investigating performance regressions for Core 2 and Core i7 > processors. The impact of certain small tuning changes on x86 performance > maybe interesting to a wider audience, so here is my results and analysis. > > Attached is a tar of the patch set I tested. Most of these patches are > dissections from earlier Bernd's work for Core 2/i7. > > + 0001-Basic-support-for-Core-i7.patch > + 0002-Enable-Core-i7-architectural-features.patch > ? 0003-Extend-Core-2-tune-features-to-Core-i7.patch > ? 0004-Tweak-tuning-for-Core-i7.patch > + 0005-Add-PROMOTE_HI_CONSTANTS-tuning.patch > + 0006-Define-Core-i7-costs.patch > + 0007-Use-64-bit-alignment-for-Core-i7-32-bit-mode.patch > + 0008-Configure-bits-for-Core-i7.patch > + 0009-Core-i7-DFA-model.patch > ? 0010-Define-issue_rate-for-Core-i7.patch > + 0011-Model-Core-i7-pipeline-domains.patch > - 0012-Update-Core-2-tuning.patch > + 0013-Use-Core-2-DFA-model-for-Core-2.patch > + 0014-Update-PentiumPro-tuning.patch > - 0015-Handle-privileged-insns.patch > + 0016-Model-Core2-i7-decoder-bottleneck.patch > Hi Maxim, I will try your patches on Core 2 and Core i7 with SPEC CPU 2K/2006. Unfortunately, gcc has been failing SPEC CPU 2K/2006 for several weeks now: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45720 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45865 My performance comparison may not be complete.
On 10/16/10 3:04 AM, H.J. Lu wrote: > On Fri, Oct 15, 2010 at 3:08 AM, Maxim Kuvyrkov<maxim@codesourcery.com> wrote: >> [Resending without printed out version of the spreadsheet to fit into >> gcc-patches@ size requirements.] >> >> I've been investigating performance regressions for Core 2 and Core i7 >> processors. The impact of certain small tuning changes on x86 performance >> maybe interesting to a wider audience, so here is my results and analysis. >> >> Attached is a tar of the patch set I tested. Most of these patches are >> dissections from earlier Bernd's work for Core 2/i7. >> >> + 0001-Basic-support-for-Core-i7.patch >> + 0002-Enable-Core-i7-architectural-features.patch >> ? 0003-Extend-Core-2-tune-features-to-Core-i7.patch >> ? 0004-Tweak-tuning-for-Core-i7.patch >> + 0005-Add-PROMOTE_HI_CONSTANTS-tuning.patch >> + 0006-Define-Core-i7-costs.patch >> + 0007-Use-64-bit-alignment-for-Core-i7-32-bit-mode.patch >> + 0008-Configure-bits-for-Core-i7.patch >> + 0009-Core-i7-DFA-model.patch >> ? 0010-Define-issue_rate-for-Core-i7.patch >> + 0011-Model-Core-i7-pipeline-domains.patch >> - 0012-Update-Core-2-tuning.patch >> + 0013-Use-Core-2-DFA-model-for-Core-2.patch >> + 0014-Update-PentiumPro-tuning.patch >> - 0015-Handle-privileged-insns.patch >> + 0016-Model-Core2-i7-decoder-bottleneck.patch >> > > Hi Maxim, > > I will try your patches on Core 2 and Core i7 with SPEC CPU 2K/2006. > Unfortunately, gcc has been failing SPEC CPU 2K/2006 for several > weeks now: FYI, I did the benchmarking against rev. 165150 dated Oct. 8. I should have been lucky to capture a window of GCC mainline being OK. Thanks,
On Fri, Oct 15, 2010 at 3:58 PM, H.J. Lu <hjl.tools@gmail.com> wrote: > On Fri, Oct 15, 2010 at 3:08 AM, Maxim Kuvyrkov <maxim@codesourcery.com> wrote: > >> + 0001-Basic-support-for-Core-i7.patch >> >> Baseline. >> >> The patch makes GCC recognize "corei7" for -mtune= and -march= options. >> The patch sets tuning for Core i7 to that of -mtune=generic or >> -mtune=generic64 depending on the {-m32/-m64} option. The generic CPU is >> special in the sense that has different tuning for 32-bit and 64-bit modes. >> The patch adds same capability to use different tuning for different ABI >> for Core i7. >> > > I don't think it is needed. We added GENERIC32/GENRIC64 so that > we can tune for 32bit/64bit in i386.c and *.md. PTA_TUNE32 is only > used in ix86_option_override_internal where we know we are compiling > for 32bit or 64bit. We can use TARGET_64BIT instead of adding > PTA_TUNE32. > > This patch removes PTA_TUNE32: http://git.kernel.org/?p=devel/gcc/hjl/x86.git;a=patch;h=39b88e72a06b52cebb2749433c874332da3a184d
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 33510a7..08837e1 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -2852,7 +2852,8 @@ ix86_option_override_internal (bool main_args_p) PTA_LWP = 1 << 23, PTA_FSGSBASE = 1 << 24, PTA_RDRND = 1 << 25, - PTA_F16C = 1 << 26 + PTA_F16C = 1 << 26, + PTA_TUNE32 = 1 << 27 }; static struct pta @@ -2894,6 +2895,10 @@ ix86_option_override_internal (bool main_args_p) {"core2", PROCESSOR_CORE2, CPU_CORE2, PTA_64BIT | PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3 | PTA_SSSE3 | PTA_CX16}, + {"corei7", PROCESSOR_GENERIC32, CPU_PENTIUMPRO, + PTA_TUNE32}, + {"", PROCESSOR_GENERIC64, CPU_GENERIC64, + PTA_64BIT}, {"atom", PROCESSOR_ATOM, CPU_ATOM, PTA_64BIT | PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3 | PTA_SSSE3 | PTA_CX16 | PTA_MOVBE}, @@ -3127,6 +3132,16 @@ ix86_option_override_internal (bool main_args_p) for (i = 0; i < pta_size; i++) if (! strcmp (ix86_arch_string, processor_alias_table[i].name)) { + if (TARGET_64BIT && (processor_alias_table[i].flags & PTA_TUNE32)) + /* Switch to the next entry which has tuning parameters for 64-bit + mode. */ + { + ++i; + gcc_assert (i < pta_size + && processor_alias_table[i].name[0] == '\0' + && !(processor_alias_table[i].flags & PTA_TUNE32)); + } + ix86_schedule = processor_alias_table[i].schedule; ix86_arch = processor_alias_table[i].processor; /* Default cpu tuning to the architecture. */ @@ -3231,6 +3246,16 @@ ix86_option_override_internal (bool main_args_p) for (i = 0; i < pta_size; i++) if (! strcmp (ix86_tune_string, processor_alias_table[i].name)) { + if (TARGET_64BIT && (processor_alias_table[i].flags & PTA_TUNE32)) + /* Switch to the next entry which has tuning parameters for 64-bit + mode. */ + { + ++i; + gcc_assert (i < pta_size + && processor_alias_table[i].name[0] == '\0' + && !(processor_alias_table[i].flags & PTA_TUNE32)); + } + ix86_schedule = processor_alias_table[i].schedule; ix86_tune = processor_alias_table[i].processor; if (TARGET_64BIT && !(processor_alias_table[i].flags & PTA_64BIT))