Replacing C's memcpy with a D implementation

David Nadlinger code at klickverbot.at
Sun Jun 17 16:22:40 UTC 2018


On Monday, 11 June 2018 at 03:34:59 UTC, Basile B. wrote:
> - default linux: 
> https://github.com/gcc-mirror/gcc/blob/master/libgcc/memcpy.c

To see what is executed when you call memcpy() on a regular 
GNU/Linux distro, you'd want to have a look at glibc instead. For 
example, the AVX2 and AVX512 implementations are in

    sysdeps/x86_64/multiarch/memmove-avx512-no-vzeroupper.S

and

   sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S,

as forwarded to by memmove-avx2-unaligned-erms.S and 
memmove-avx512-unaligned-erms.S.

(Pop quiz: Why might a separate "no-vzeroupper" variant be a good 
idea?)

  — David




More information about the Digitalmars-d mailing list