2 ms·
Intel has `rep movs` which is recommended for general use, you can beat it for sizes < 128B using a specialized loop. A very good memcpy for general purposes wo
by jeffbee 6y ago
Intel has `rep movs` which is recommended for general use, you can beat it for sizes < 128B using a specialized loop. A very good memcpy for general purposes would just branch over the size to either a specialized small copy or `rep movs` for larger sizes.
The GCC version is just bananas. https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=sysdeps/x86_64/multiarch/memcpy-ssse3.S https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=sysde...
Compare the newer ERMS implementation: https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/x86...
- andrewf 6y agoWhat's weird is that if you git blame a bit, a lot of the elaborate stuff was contributed by Intel.
- jeffbee 6y agoIntel is at least as guilty of chasing misleading benchmarks as anyone else in the history of our field.
- saagarjha 6y agoNo AVX2-optimized version? I'm disappointed… Edit: it's rolled into the erms version.