[libc] Add a set of elementary operations
authorGuillaume Chatelet <gchatelet@google.com>
Tue, 15 Jun 2021 07:57:13 +0000 (07:57 +0000)
committerGuillaume Chatelet <gchatelet@google.com>
Tue, 15 Jun 2021 07:57:13 +0000 (07:57 +0000)
commit454d92ac3b3b13f5c8b3f57e03b2d93f0cf60738
treea36011d812dcabef17c7c002891ea92942ac6363
parent6c7be4176703fff69d20acc466a879e080346f30
[libc] Add a set of elementary operations

Resubmission of D100646 now making sure that we handle cases were `__builtin_memcpy_inline` is not available.

Original commit message:
Each of these elementary operations can be assembled to support higher order constructs (Overlapping access, Loop, Aligned Loop).
The patch does not compile yet as it depends on other ones (D100571, D100631) but it allows to get the conversation started.

A self-contained version of this code is available at https://godbolt.org/z/e1x6xdaxM
13 files changed:
libc/src/string/CMakeLists.txt
libc/src/string/aarch64/memcpy.cpp
libc/src/string/memcpy.cpp
libc/src/string/memory_utils/CMakeLists.txt
libc/src/string/memory_utils/elements.h [new file with mode: 0644]
libc/src/string/memory_utils/elements_x86.h [new file with mode: 0644]
libc/src/string/memory_utils/memcpy_utils.h [deleted file]
libc/src/string/memory_utils/memset_utils.h
libc/src/string/x86_64/memcpy.cpp
libc/test/src/string/memory_utils/CMakeLists.txt
libc/test/src/string/memory_utils/elements_test.cpp [new file with mode: 0644]
libc/test/src/string/memory_utils/memcpy_utils_test.cpp [deleted file]
libc/test/src/string/memory_utils/memory_access_test.cpp [new file with mode: 0644]