public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hjl dot tools at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/37948] [4.4 Regression] IRA generates slower code for -mtune=core2
Date: Wed, 29 Oct 2008 05:46:00 -0000	[thread overview]
Message-ID: <20081029054456.10968.qmail@sourceware.org> (raw)
In-Reply-To: <bug-37948-682@http.gcc.gnu.org/bugzilla/>



------- Comment #1 from hjl dot tools at gmail dot com  2008-10-29 05:44 -------
It looks like the cost of loading/storing FP values aren't appropriate for
Core 2. With this patch:

[hjl@gnu-6 i386]$ diff -up i386.c.foo i386.c
--- i386.c.foo  2008-10-28 21:56:19.000000000 -0700
+++ i386.c      2008-10-28 22:01:53.000000000 -0700
@@ -990,9 +990,9 @@ struct processor_costs core2_cost = {
                                           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
+  {12, 12, 12},                                /* cost of loading fp registers
                                           in SFmode, DFmode and XFmode */
-  {4, 4, 4},                           /* cost of storing fp registers
+  {6, 6, 8},                           /* cost of storing fp registers
                                           in SFmode, DFmode and XFmode */
   2,                                   /* cost of moving MMX register */
   {6, 6},                              /* cost of loading MMX registers
@@ -1000,9 +1000,9 @@ struct processor_costs core2_cost = {
   {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
+  {8, 8, 8},                           /* cost of loading SSE registers
                                           in SImode, DImode and TImode */
-  {4, 4, 4},                           /* cost of storing SSE registers
+  {8, 8, 8},                           /* cost of storing SSE registers
                                           in SImode, DImode and TImode */
   2,                                   /* MMX or SSE register to integer */
   32,                                  /* size of l1 cache.  */
[hjl@gnu-6 i386]$

I got

[hjl@gnu-6 gcc]$  ./xgcc -B./ -m32 -O2 /tmp/foo.c -o core2.sse -mtune=core2 
-msse3 -mfpmath=sse
[hjl@gnu-6 gcc]$  ./xgcc -B./ -m32 -O2 /tmp/foo.c -o core2 -mtune=core2
[hjl@gnu-6 gcc]$ ./xgcc -B./ -m32 -O2 /tmp/foo.c -o o2  -msse3 -mfpmath=sse
[hjl@gnu-6 gcc]$  ./xgcc -B./ -m32 -O2 /tmp/foo.c -o o2.sse
[hjl@gnu-6 gcc]$ time ./o2

real    0m7.163s
user    0m7.161s
sys     0m0.001s
[hjl@gnu-6 gcc]$ time ./core2

real    0m7.833s
user    0m7.829s
sys     0m0.001s
[hjl@gnu-6 gcc]$ time ./o2.sse

real    0m7.795s
user    0m7.794s
sys     0m0.000s
[hjl@gnu-6 gcc]$ time ./core2.sse

real    0m7.339s
user    0m7.337s
sys     0m0.001s
[hjl@gnu-6 gcc]$

But even with this patch, IRA still generates slower codes:

[hjl@gnu-6 gcc]$ ./xgcc -B./ -m32 -O2 /tmp/foo.c -o core2.noira -mtune=core2
-fno-ira
[hjl@gnu-6 gcc]$ time ./core2.noira

real    0m7.444s
user    0m7.441s
sys     0m0.001s
[hjl@gnu-6 gcc]$ ./xgcc -B./ -m32 -O2 /tmp/foo.c -o core2.sse.noira
-mtune=core2 -fno-ira -msse3 -mfpmath=sse
[hjl@gnu-6 gcc]$ time ./core2.sse.noira

real    0m7.229s
user    0m7.224s
sys     0m0.000s
[hjl@gnu-6 gcc]$


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37948


  reply	other threads:[~2008-10-29  5:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-29  5:39 [Bug rtl-optimization/37948] New: " hjl dot tools at gmail dot com
2008-10-29  5:46 ` hjl dot tools at gmail dot com [this message]
2008-10-29  7:18 ` [Bug rtl-optimization/37948] " bonzini at gnu dot org
2008-10-29  7:25   ` Andrew Thomas Pinski
2008-10-29  7:26 ` pinskia at gmail dot com
2008-10-29 13:08 ` hjl dot tools at gmail dot com
2008-10-29 14:50 ` rguenth at gcc dot gnu dot org
2008-10-30 21:08 ` rguenth at gcc dot gnu dot org
2008-10-30 22:53 ` hjl dot tools at gmail dot com
2008-11-04 19:37 ` [Bug rtl-optimization/37948] [4.4 Regression] IRA generates slower code hjl dot tools at gmail dot com
2008-11-10 16:13 ` vmakarov at redhat dot com
2008-11-10 23:24 ` vmakarov at gcc dot gnu dot org
2008-11-11  0:02 ` hjl at gcc dot gnu dot org
2008-12-06 22:07 ` steven at gcc dot gnu dot org
2008-12-10  3:03 ` Joey dot ye at intel dot com
2008-12-10  5:04 ` hjl dot tools at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081029054456.10968.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).