Re:Echo – Assembly program that prints the first positional ...
by exDM69 on Monday January 02, 2017 @07:07AM
(#13300682)
> They were the fastest way to do string operations on those early CPUs, but I don't think this the case on modern CPUs.
Modern CPUs still have a fast path for string operations, and I recall hearing that they even had some improvements not too long ago (in Sandy Bridge or other recent arch).
CPUs may be smart enough to detect a memcpy done with a loop, but REPxx is the preferred way - even on modern CPUs.
Modern CPUs still have a fast path for string operations, and I recall hearing that they even had some improvements not too long ago (in Sandy Bridge or other recent arch).
CPUs may be smart enough to detect a memcpy done with a loop, but REPxx is the preferred way - even on modern CPUs.