[libc] New version of the mem* framework
authorGuillaume Chatelet <gchatelet@google.com>
Tue, 4 Oct 2022 08:49:02 +0000 (08:49 +0000)
committerGuillaume Chatelet <gchatelet@google.com>
Wed, 12 Oct 2022 15:26:26 +0000 (15:26 +0000)
commit4c19439d249256db720e323a446e39d05496732f
tree2dab116d139e6097be5dfc61c68e55ee0ae00499
parentd71ad4108056d685f48407447095d8d92fd7685d
[libc] New version of the mem* framework

This version is more composable and also simpler at the expense of being more explicit and more verbose.
This patch is not meant to be submitted but gives an idea of the change.
Codegen can be checked in https://godbolt.org/z/6z1dEoWbs by removing the "static inline" before individual functions.

Unittests are coming.

Suggested review order:
 - utils
 - op_base
 - op_builtin
 - op_generic
 - op_x86 / op_aarch64
 - *_implementations.h

Differential Revision: https://reviews.llvm.org/D135134
26 files changed:
libc/src/stdio/printf_core/string_writer.cpp
libc/src/string/bcmp.cpp
libc/src/string/memcmp.cpp
libc/src/string/memmove.cpp
libc/src/string/memory_utils/CMakeLists.txt
libc/src/string/memory_utils/README.md [new file with mode: 0644]
libc/src/string/memory_utils/bcmp_implementations.h
libc/src/string/memory_utils/elements.h [deleted file]
libc/src/string/memory_utils/elements_aarch64.h [deleted file]
libc/src/string/memory_utils/elements_x86.h [deleted file]
libc/src/string/memory_utils/memcmp_implementations.h
libc/src/string/memory_utils/memcpy_implementations.h
libc/src/string/memory_utils/memset_implementations.h
libc/src/string/memory_utils/op_aarch64.h [new file with mode: 0644]
libc/src/string/memory_utils/op_builtin.h [new file with mode: 0644]
libc/src/string/memory_utils/op_generic.h [new file with mode: 0644]
libc/src/string/memory_utils/op_x86.h [new file with mode: 0644]
libc/src/string/memory_utils/utils.h
libc/src/string/memset.cpp
libc/test/src/string/bcmp_test.cpp
libc/test/src/string/memmove_test.cpp
libc/test/src/string/memory_utils/CMakeLists.txt
libc/test/src/string/memory_utils/elements_test.cpp [deleted file]
libc/test/src/string/memory_utils/memory_access_test.cpp [deleted file]
libc/test/src/string/memory_utils/utils_test.cpp
utils/bazel/llvm-project-overlay/libc/BUILD.bazel