[libc] Use different alignment for memcpy between ARM and x86.
authorGuillaume Chatelet <gchatelet@google.com>
Mon, 26 Apr 2021 19:30:00 +0000 (19:30 +0000)
committerGuillaume Chatelet <gchatelet@google.com>
Mon, 26 Apr 2021 19:30:00 +0000 (19:30 +0000)
commitb5f04d81a2c0b01db32ed7c1685be37e6bdce171
treef1f1012d881a0c133f093c681ab59e14f4f03583
parentf8de9aaef2f472ad7572748582444083d31d5a95
[libc] Use different alignment for memcpy between ARM and x86.

Aligned copy used to be 'destination aligned' for x86 but this decision was reverted in D93457 where we noticed that it was better for ARM to be 'source aligned'.
More benchmarking confirmed that it can be up to 30% faster to align copy to destination for x86. This Patch offers both implementations and switches x86 back to destination aligned.
It also fixes alignment to 32 byte on x86.

Differential Revision: https://reviews.llvm.org/D101296
libc/src/string/aarch64/memcpy.cpp
libc/src/string/memcpy.cpp
libc/src/string/memory_utils/memcpy_utils.h
libc/src/string/x86/memcpy.cpp
libc/test/src/string/memory_utils/memcpy_utils_test.cpp