skdb icon indicating copy to clipboard operation
skdb copied to clipboard

[skc] optimize 32 bit memcpy for unaligned destinations

Open jberdine opened this issue 1 year ago • 0 comments

The current 32 bit implementation of memcpy performs word-by-word copies tacitly assuming that the source and destination are word-aligned. For the use of memcpy to concatenate strings, the destination need not be aligned. It may be faster to use an implementation that maintaines a "carry" word across loop iterations so that word-width reads and writes are both performed, and the word to write is calculated as a bitwise combination of the carry word from the previous iteration and the word read in the current iteration.

If SKIP_String_concat2 or SKIP_String_concatN shows up while profiling, this optimization could be worthwhile.

jberdine avatar May 01 '24 09:05 jberdine