From: Mike Frysinger Date: Fri, 9 Oct 2009 06:26:58 -0400 Subject: [U-Boot] =?iso-8859-1?q?=5BPATCH_V2_1/3=5D_memcpy=3A_copy_one_wor?= =?iso-8859-1?q?d_at_a_time=09if=09possible?= In-Reply-To: <4ACF0C44.9040101@mimc.co.uk> References: <4ACEBF19.4010902@free.fr> <4ACF0C44.9040101@mimc.co.uk> Message-ID: <200910090627.00401.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Friday 09 October 2009 06:11:16 Mark Jackson wrote: > Chris Moore wrote: > > I agree wholeheartedly with the idea but shouldn't it be more like this > > (untested) code : > > > > void * memcpy(void *dest, const void *src, size_t count) > > > > { > > char *d8, *s8; > > unsigned long *dl = dest, *sl = src; > > In here, would it be overkill to add byte copying until data is aligned, > and then fall into the aligned copy code. both addresses have to be unaligned the same ... if ((ulong)dl & (sizeof(*dl) - 1) == (ulong)sl & (sizeof(*sl) - 1)) > In that case, you'd still gain a speed increase if you're starting at an > unaligned address ? now it's a question of how often does this come up and is it worth the code size increase ? -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. Url : http://lists.denx.de/pipermail/u-boot/attachments/20091009/fe1b4c85/attachment.pgp