Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Show me your strcpy

Name: Anonymous 2010-05-13 20:16

Here is my string copy function: http://pastebin.com/f7gBfsDY

<Nola> it took agner fog 3 years to write a strcpy
<Nola> why are you guys all lamers
<Nola> would you write some lame ass thing that loops and copies Chars
<Nola> that version is gonna be 10x faster than your C loop


Three years, motherfuckers.  Have you optimized your hand-coded assembly strcpy() today?

Name: Anonymous 2010-05-13 21:20

meh, I'm just fine with rep cmpsb/rep movsd/b(with /4/%4/&3 for the bytes) variant. That's what I use when I write it in asm, and it's also what msvc usually uses. I've seen the mmx/sse strcpy/memcpy/memset versions used in some other libraries, but IMO they're much more complex, and a lot more bloated/huge. I'd like to see some benchmarks/cycle counts (on a few CPUs), so I'd know if these overly complex versions are really worth it.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List