Fast Approximation to memcpy()

Started by
29 comments, last by MikeWillHugYou 7 years, 5 months ago

because, Thats my man!

Advertisement

I remember reading in Andre Lamothe's "Tricks of the Game Programming Gurus" where he solved a similar problem to memset using the asm instructor "rep stow", copying 2 bytes at a time instead of one (with boundaries solved separately).

Spiro's answer took the same idea to the next level. The real winner in my book.

Also, using a double/long long pointer if there aren't vector instructions by toss-dev.

Your link is broken.
Of course, approximating std::memcpy() was a joke, which is why it is in Coding Horrors.

In any case, I optimized it and wrote a faster-in-all-cases version for PlayStation 4.
Already have one 2 or 3 times faster on my Windows® machine, and will make one for Xbox One soon.


L. Spiro

How much for the Windows version?


The biggest problem is the last few bytes since the CPU is really tired by the time it reaches them.


This topic is closed to new replies.

Advertisement