Efficient scather-gather-copy



Hi,

I'm in the unlucky situation to convert mails from the "\n"-lineendings
to "\r\n"-ones.

I'm doing the rest of the program in C, but I hope to be able to use
some special CPU-capatibilities via inline-assembly to make this
_really_ fast.

If I'm not mistaken, I have to count the lines, alloc
sizeof(mail)+num_of_lines(mail), copy each line seperately with a space
between them to the buffer and replace the "\n" through "\r\n".

Is there something MMX, SSE et. al. could do for me? I'm pretty sure to
have seen a MMX-powered memcpy somewhere so I think it should be able to
help me at least a bit. It would be perfect to be able to supply a array
of sources and destinations, but I guess that would be wishful thinking.

Could anyone point me in the right direction?

TIA,
-hs

.