lkml.org 
[lkml]   [1999]   [May]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] optimised memmove() for alpha
Here is an untested fix to the memmove patch.

I think the code looks quite ugly with tests everywhere to see which
direction we are going in. Perhaps it would be better to split out
separate functions for that, and have memcpy just use the 'up' versions.

Tim.
*/

--- memcpy.c.orig Fri May 28 21:47:22 1999
+++ memcpy.c Fri May 28 21:49:17 1999
@@ -106,11 +106,13 @@
n -= 8;
while (n >= 0) {
unsigned long tmp;
+ if (dir <= 0) s -= 8;
__asm__("ldq %0,%1":"=r" (tmp):"m" (*(unsigned long *) s));
n -= 8;
- (dir > 0) ? (s += 8) : (s -= 8);
+ if (dir > 0) s += 8;
+ else d -= 8;
*(unsigned long *) d = tmp;
- (dir > 0) ? (d += 8) : (d -= 8);
+ if (dir > 0) d += 8;
}
n += 8;
DO_REST_ALIGNED(d,s,n);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.033 / U:2.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site