From: Andi Kleen <ak@colin2.muc.de>
To: Andi Kleen <ak@muc.de>, akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Modernize i386 string.h
Date: 20 Jan 2004 02:39:45 +0100
Date: Tue, 20 Jan 2004 02:39:45 +0100 [thread overview]
Message-ID: <20040120013945.GA76524@colin2.muc.de> (raw)
In-Reply-To: <20040120004954.GA3545@twiddle.net>
On Mon, Jan 19, 2004 at 04:49:54PM -0800, Richard Henderson wrote:
> On Sun, Jan 18, 2004 at 09:09:19PM +0100, Andi Kleen wrote:
> > +#define __HAVE_ARCH_MEMCPY 1
> > +extern void *__memcpy(void *to, const void *from, size_t len);
> > +#define memcpy(dst,src,len) \
> > + ({ size_t __len = (len); \
> > + void *__ret; \
> > + if (__builtin_constant_p(len) && __len >= 128) \
> > + __ret = __memcpy((dst),(src),__len); \
> > + else \
> > + __ret = __builtin_memcpy((dst),(src),__len); \
> > + __ret; })
>
> Why not just __builtin_memcpy? Or indeed, why bother defining
> anything at all, since the compiler will infer __builtin_memcpy
> from the external symbol memcpy.
I was considering that when I moved the code over from x86-64.
On x86-64 (in gcc 3.1 timeframe) I did it originally this way
because memcpy didn't have this "use external for big copies" logic.
I wasn't sure if gcc 3.3 handles it now correctly. If you can
confirm that it does I will happily remove it.
-Andi
next prev parent reply other threads:[~2004-01-20 1:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-18 20:09 [PATCH] Modernize i386 string.h Andi Kleen
2004-01-19 14:26 ` Jeff Garzik
2004-01-19 15:06 ` Richard B. Johnson
2004-01-19 15:10 ` Andi Kleen
2004-01-20 0:49 ` Richard Henderson
2004-01-20 1:39 ` Andi Kleen [this message]
2004-01-20 2:04 ` Rusty Russell
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=20040120013945.GA76524@colin2.muc.de \
--to=ak@colin2.muc.de \
--cc=ak@muc.de \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.