public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Denys Vlasenko" <vda.linux@googlemail.com>
To: "Agner Fog" <agner@agner.org>
Cc: "Raksit Ashok" <raksit@google.com>,
	dclarke@opensolaris.org, gcc@gcc.gnu.org,
	 	TimothyPrince@sbcglobal.net
Subject: Re: gcc will become the best optimizing x86 compiler
Date: Wed, 30 Jul 2008 16:40:00 -0000	[thread overview]
Message-ID: <1158166a0807300908o5dcc101dqd39c1fc1ef477806@mail.gmail.com> (raw)
In-Reply-To: <1158166a0807300857y3edad25cyd3b4731e2d8e2073@mail.gmail.com>

On Wed, Jul 30, 2008 at 5:57 PM, Denys Vlasenko
<vda.linux@googlemail.com> wrote:
> On Fri, Jul 25, 2008 at 9:08 AM, Agner Fog <agner@agner.org> wrote:
>> Raksit Ashok wrote:
>>>There is a more optimized version for 64-bit:
>>>http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libc/amd64/gen/memcpy.s
>>>I think this looks similar to your implementation, Agner.
>>
>> Yes it is similar to my code.
>
> 3164 line source file which implements memcpy().
> You got to be kidding.
> How much of L1 icache it blows away in the process?
> I bet it performs wonderfully on microbenchmarks though.
>
>   2991                 .balign 16               # sadistic alignment strikes again
>   2992 L(bkPxQx):      .int L(bkP0Q0)-L(bkPxQx) # why use two bytes when
> we can use four?
>
> Seriously. What possible reason there can be to align
> a randomly accessed data table to 16 bytes?
> 4 bytes I understand, but 16?

I'm afraid I sounded a bit confrontational above, here comes the
clarification. I have nothing against making code faster.
But there should be some balance between -O999 mindset
and -Os midset. If you just found a tweak which gives you 1.2%
speedup in microbencmark but code grew 4 times bigger, *stop*.
Think about it.

"We unrolled the loop two gazillion times and it's 3% faster now"
is a similarly bad idea.

I must admit that I didn't look too closely at
http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libc/amd64/gen/memcpy.s
but at the first glance it sure looks like someone
got carried away a bit.
--
vda

  reply	other threads:[~2008-07-30 16:09 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-23 14:59 Is cross-section inlining valid behaviour? Bingfeng Mei
2008-07-23 15:07 ` Richard Guenther
2008-07-23 15:14 ` Dave Korn
2008-07-23 15:31   ` Bingfeng Mei
2008-07-23 17:25 ` gcc will become the best optimizing x86 compiler Agner Fog
2008-07-23 17:33   ` Tim Prince
2008-07-24  8:04   ` Dennis Clarke
2008-07-24  9:41     ` Agner Fog
2008-07-24 10:10       ` Dave Korn
2008-07-24 13:20         ` Basile STARYNKEVITCH
2008-07-24 13:31           ` Dave Korn
2008-07-24 13:59           ` Agner Fog
2008-07-24 14:40             ` Richard Guenther
2008-07-28 10:57             ` Andrew Haley
2008-07-24 15:02           ` Joseph S. Myers
2008-07-24 16:26             ` Agner Fog
2008-07-24 17:17             ` Basile STARYNKEVITCH
2008-07-24 17:21       ` Raksit Ashok
2008-07-25  7:23         ` Agner Fog
2008-07-26  0:23           ` Michael Meissner
2008-07-26 17:49             ` Agner Fog
2008-07-28 11:45             ` Agner Fog
2008-07-28 14:40               ` Daniel Jacobowitz
2008-07-28 17:37                 ` Dennis Clarke
2008-07-28 17:54                   ` Paolo Carlini
2008-07-28 18:31                     ` Dennis Clarke
2008-07-28 18:37                       ` Ian Lance Taylor
2008-07-28 19:44                       ` Dave Korn
2008-07-28 21:40                         ` Dennis Clarke
2008-07-29  1:31                       ` Gerald Pfeifer
2008-07-29  6:29                         ` Agner Fog
2008-07-29  9:24                           ` Ben Elliston
2008-07-31  8:12                             ` Christopher Faylor
2008-07-28 17:19               ` Michael Matz
2008-07-29  6:15                 ` Agner Fog
2008-07-29  9:31                   ` Richard Guenther
2008-07-29  9:55                     ` Steven Bosscher
2008-07-29 13:09                       ` Joseph S. Myers
2008-07-29 14:11                   ` Michael Matz
2008-07-29 14:45                   ` Tim Prince
2008-07-30 16:37           ` Denys Vlasenko
2008-07-30 16:40             ` Denys Vlasenko [this message]
2008-07-30 17:52               ` Agner Fog
2008-07-30 22:42                 ` Dennis Clarke
2008-07-31  2:57                 ` Denys Vlasenko
2008-07-31  8:18                   ` Agner Fog
2008-07-31 11:00                     ` Dave Korn
2008-07-24 10:09   ` Zoltán Kócsi
2008-07-30 15:34 Eus
2008-07-30 16:09 ` Dennis Clarke

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=1158166a0807300908o5dcc101dqd39c1fc1ef477806@mail.gmail.com \
    --to=vda.linux@googlemail.com \
    --cc=TimothyPrince@sbcglobal.net \
    --cc=agner@agner.org \
    --cc=dclarke@opensolaris.org \
    --cc=gcc@gcc.gnu.org \
    --cc=raksit@google.com \
    /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).