lkml.org 
[lkml]   [1999]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectMemcopy by 8?
OK, here's my ideas for an optimization: in string-486.h in 2.2.8, the
memcpy function is either implemented into 3 separate functions: memcopy
by 4, 2, and 1 bytes. For this purpose, the number of bytes to be copied
is %ed by 4 and 2. I have two optimizations in mind:
1: Implement a memcpy by 8 for MMX machines that would use the MOVQ
command and an MMX register, and an analogous command on non-MMX
machines (for consistency) that would use a doubled long move.
2: Since the MOD is takes anyways, why not implement memcpy(to,from,n)
as this:
block copy (memcpy by 4 or 8) until n-n%{8,4 (depending on the
implementation)} and then memcpy by bytes for the rest of the array.
Wouldn't this be more efficient, esp. with optimization 1?
Can someone give me their opinion?


-
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.044 / U:0.896 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site