3 ms·
A fast memcpy used to be complicated to implement but these days I heard a simple rep movsb will do the trick. This assumes that the source register point
by im3w1l 7y ago
A fast memcpy used to be complicated to implement but these days I heard a simple
rep movsb
will do the trick. This assumes that the source register points to source, destination register points to destination and counter register is set to number of bytes to copy.
- pizlonator 7y agoI wish that was true but my data says it isn't: - A verbose SIMD copy loop is often faster even on modern Intel CPUs that have the more modern rep implementation. - A simple byte copy loop will beat both SIMD and rep when you're copying smaller amounts at a time.