[PATCH] msvcrt: Import memmove from musl

Paul Gofman pgofman at codeweavers.com
Fri Aug 21 07:02:38 CDT 2020


On 8/21/20 14:51, Gabriel Ivăncescu wrote:
> FWIW "rep movsb" is supposedly the fastest when transferring larger 
> blocks (I think more than 128 bytes?) on recent CPUs. The cool thing 
> is that the CPU handles everything, no matter the alignment or "memcpy 
> vs memmove", so it's by far the simplest, and since it knows about the 
> alignment requirements of that particular CPU it can optimize it 
> internally itself.
>
> Same story with "rep stosb" for memset. Unfortunately these are very 
> slow on older CPUs. I think there's a CPUID flag that says whether 
> they are fast, we could use that.
>
Yeah, that is (__cpuid(7):EBX & (1 << 9)).





More information about the wine-devel mailing list