Saturday, September 5, 2009

I've noticed that there is a bug in the memcpy routine, here's an example of the test I ran. The first test varies the copy length, the second the destination address

I expect to see output like this:
ABCDEFGHIJ ABCDEFGHIJ
ABCDEFGHI BCDEFGHIJ
ABCDEFGH CDEFGHIJ
ABCDEFG DEFGHIJ
ABCDEF EFGHIJ
ABCDE FGHIJ
ABCD GHIJ
ABC HIJ
AB IJ
A J

I actually see this:
ABCDEFGHIJ ABCDEFGHIJ
ABCDEFGH ABCDEFGH
ABCDEFGH CDEFGHIJ
ABCDEF CDEFGH
ABCDEF EFGHIJ
ABCD EFGH
ABCD GHIJ
AB GH
AB IJ
(empty) (empty)

I did another test, and using byte-copies with the screen buffer slows the system back down, losing us our 20% bump. So I need to get memcpy (and memset, which uses a similar method) working.

word memcpy test 2, don't append "\n"
ABCDEFGHIJ
ABCDEFGHJ
CDEFGHIJ
CDEFGHJ
EFGHIJ
EFGHJ
GHIJ
GHJ
IJ
J

So it looks like the lowest-order bit is being ignored for word copies.

After fixing memcpy, test runs for 0-A00 time
TIME Description
83.64 first pass, working memcpy

No comments:

Post a Comment