3 ms·
This article is old: March 9, 2009 1:00 AM PDT Nowadays glibc has modern SSE code and the kernel uses "rep movsb". The kernel can store and restore FPU state i
by wolf550e 15y ago
This article is old: March 9, 2009 1:00 AM PDT
Nowadays glibc has modern SSE code and the kernel uses "rep movsb". The kernel can store and restore FPU state if the copy is long and doing SSE/AVX is worth it. Someone on the Linux kernel mailing list measured that performance depends on src and dest being 64-byte aligned compared to each other: if they are aligned, "rep movsb" is faster than SSE.
The thread: https://lkml.org/lkml/2011/9/1/229 https://lkml.org/lkml/2011/9/1/229
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=arch/x86/lib/memcpy_64.S;hb=HEAD http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git...
http://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/x86_64/multiarch/memcpy-ssse3.S;hb=HEAD http://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/x86_...