public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* K6 optimization && compiler builtins
@ 1997-12-15 14:36 Ronald Wahl
  1997-12-15 15:07 ` Jeffrey A Law
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Ronald Wahl @ 1997-12-15 14:36 UTC (permalink / raw)
  To: egcs

Hi,

At the moment I'm playing with the string/memory routines of libc which
are written in assembler. On a K6 (somtimes PPro also, Pentium not testet)
I can get a performance gain of 10-40% (!). Now my question: If I use one
of the string/memory functions (e.g. memcmp) in my programs, which one
will be uses - the compiler builtin or the one in the libc? If the builtin
is used - is it possible to include my optimized versions (if ready)?

ron

-- 
\ Ronald Wahl --- rwa@informatik.tu-chemnitz.de   \
 \ WWW: http://www.tu-chemnitz.de/~row             \
  \ Talk: rwa@goliath.csn.tu-chemnitz.de            \
   \ PGP key available by finger to my email address \



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: K6 optimization && compiler builtins
  1997-12-15 14:36 K6 optimization && compiler builtins Ronald Wahl
@ 1997-12-15 15:07 ` Jeffrey A Law
  1997-12-15 16:48   ` amylaar
  1997-12-16  4:42 ` Marc Lehmann
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Jeffrey A Law @ 1997-12-15 15:07 UTC (permalink / raw)
  To: Ronald.Wahl; +Cc: egcs

  In message <Pine.LNX.3.96.971215232539.25052A-100000@goliath.csn.tu-chemnitz.
de>you write:
  > Hi,
  > 
  > At the moment I'm playing with the string/memory routines of libc which
  > are written in assembler. On a K6 (somtimes PPro also, Pentium not testet)
  > I can get a performance gain of 10-40% (!). Now my question: If I use one
  > of the string/memory functions (e.g. memcmp) in my programs, which one
  > will be uses - the compiler builtin or the one in the libc? If the builtin
  > is used - is it possible to include my optimized versions (if ready)?
For the x86, the compiler builtin will be used for memcpy of a constant
number of bytes, I think the compiler builtin will always be used for memcmp.

This can/will differ for other cpus.

jeff



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: K6 optimization && compiler builtins
  1997-12-15 15:07 ` Jeffrey A Law
@ 1997-12-15 16:48   ` amylaar
  0 siblings, 0 replies; 7+ messages in thread
From: amylaar @ 1997-12-15 16:48 UTC (permalink / raw)
  To: Jeffrey A Law; +Cc: Ronald.Wahl, egcs

> For the x86, the compiler builtin will be used for memcpy of a constant
> number of bytes, I think the compiler builtin will always be used for memcmp.

Well, always unless waived by -fno-builtin ;-)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: K6 optimization && compiler builtins
  1997-12-15 14:36 K6 optimization && compiler builtins Ronald Wahl
  1997-12-15 15:07 ` Jeffrey A Law
@ 1997-12-16  4:42 ` Marc Lehmann
  1997-12-16  6:34 ` Oleg Krivosheev
       [not found] ` <19971216002155.49135.cygnus.egcs@cerebro.laendle>
  3 siblings, 0 replies; 7+ messages in thread
From: Marc Lehmann @ 1997-12-16  4:42 UTC (permalink / raw)
  To: egcs

On Mon, Dec 15, 1997 at 11:36:17PM +0100, Ronald Wahl wrote:
> Hi,
> 
> At the moment I'm playing with the string/memory routines of libc which
> are written in assembler. On a K6 (somtimes PPro also, Pentium not testet)
> I can get a performance gain of 10-40% (!). Now my question: If I use one
> of the string/memory functions (e.g. memcmp) in my programs, which one
> will be uses - the compiler builtin or the one in the libc? If the builtin

I guess the compiler builtins will be used (Why not try it out?),
btw, I have a version of strlen that's about 30% faster on
pentiums than the one currently in gcc.

anybody wants to hack it into i386.md?


      -----==-                                              |
      ----==-- _                                            |
      ---==---(_)__  __ ____  __       Marc Lehmann       +--
      --==---/ / _ \/ // /\ \/ /       pcg@goof.com       |e|
      -=====/_/_//_/\_,_/ /_/\_\                          --+
    The choice of a GNU generation                        |
                                                          |

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: K6 optimization && compiler builtins
  1997-12-15 14:36 K6 optimization && compiler builtins Ronald Wahl
  1997-12-15 15:07 ` Jeffrey A Law
  1997-12-16  4:42 ` Marc Lehmann
@ 1997-12-16  6:34 ` Oleg Krivosheev
  1997-12-16  7:04   ` Ronald Wahl
       [not found] ` <19971216002155.49135.cygnus.egcs@cerebro.laendle>
  3 siblings, 1 reply; 7+ messages in thread
From: Oleg Krivosheev @ 1997-12-16  6:34 UTC (permalink / raw)
  To: Ronald Wahl; +Cc: egcs

hi,

On Mon, 15 Dec 1997, Ronald Wahl wrote:

> Date: Mon, 15 Dec 1997 23:36:17 +0100 (CET)
> From: Ronald Wahl <Ronald.Wahl@informatik.tu-chemnitz.de>
> Reply-To: egcs@cygnus.com
> To: egcs@cygnus.com
> Subject: K6 optimization && compiler builtins
> 
> Hi,
> 
> At the moment I'm playing with the string/memory routines of libc which
> are written in assembler. On a K6 (somtimes PPro also, Pentium not testet)
> I can get a performance gain of 10-40% (!). Now my question: If I use one
> of the string/memory functions (e.g. memcmp) in my programs, which one
> will be uses - the compiler builtin or the one in the libc? 

i believe compiler built-in will be used if known
number of bytes to be copied. I checked once 
what's going on while memcpy double.
Gcc substituted few inlined assembelr instructions
instead of function calls. It was on SPARC though...
Sorry, don't know about x86.

> If the builtin
> is used - is it possible to include my optimized versions (if ready)?

do you have patch against latest snapshot ?

OK


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: K6 optimization && compiler builtins
  1997-12-16  6:34 ` Oleg Krivosheev
@ 1997-12-16  7:04   ` Ronald Wahl
  0 siblings, 0 replies; 7+ messages in thread
From: Ronald Wahl @ 1997-12-16  7:04 UTC (permalink / raw)
  To: Oleg Krivosheev; +Cc: egcs

On Mon, 15 Dec 1997, Oleg Krivosheev wrote:

> > If the builtin
> > is used - is it possible to include my optimized versions (if ready)?
> 
> do you have patch against latest snapshot ?

At the moment no. I'm patching the libc (and linux-kernel) versions
currently. After this I will look at the compiler.

ron

-- 
\ Ronald Wahl --- rwa@informatik.tu-chemnitz.de   \
 \ WWW: http://www.tu-chemnitz.de/~row             \
  \ Talk: rwa@goliath.csn.tu-chemnitz.de            \
   \ PGP key available by finger to my email address \


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: K6 optimization && compiler builtins
       [not found] ` <19971216002155.49135.cygnus.egcs@cerebro.laendle>
@ 1997-12-17 13:35   ` Stan Cox
  0 siblings, 0 replies; 7+ messages in thread
From: Stan Cox @ 1997-12-17 13:35 UTC (permalink / raw)
  To: egcs

> I have a version of strlen that's about 30% faster on

I would be interested to look at it.
-- 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~1997-12-17 13:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-12-15 14:36 K6 optimization && compiler builtins Ronald Wahl
1997-12-15 15:07 ` Jeffrey A Law
1997-12-15 16:48   ` amylaar
1997-12-16  4:42 ` Marc Lehmann
1997-12-16  6:34 ` Oleg Krivosheev
1997-12-16  7:04   ` Ronald Wahl
     [not found] ` <19971216002155.49135.cygnus.egcs@cerebro.laendle>
1997-12-17 13:35   ` Stan Cox

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).