76 changes: 38 additions & 38 deletions libc/src/string/memory_utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,34 @@
add_header_library(
memory_utils
HDRS
aarch64/bcmp_implementations.h
aarch64/memcmp_implementations.h
aarch64/memcpy_implementations.h
aarch64/memmove_implementations.h
aarch64/memset_implementations.h
bcmp_implementations.h
bzero_implementations.h
aarch64/inline_bcmp.h
aarch64/inline_memcmp.h
aarch64/inline_memcpy.h
aarch64/inline_memmove.h
aarch64/inline_memset.h
generic/aligned_access.h
generic/byte_per_byte.h
memcmp_implementations.h
memcpy_implementations.h
memmove_implementations.h
memset_implementations.h
inline_bcmp.h
inline_bzero.h
inline_memcmp.h
inline_memcpy.h
inline_memmove.h
inline_memset.h
op_aarch64.h
op_builtin.h
op_generic.h
op_x86.h
riscv/bcmp_implementations.h
riscv/memcmp_implementations.h
riscv/memcpy_implementations.h
riscv/memmove_implementations.h
riscv/memset_implementations.h
riscv/inline_bcmp.h
riscv/inline_memcmp.h
riscv/inline_memcpy.h
riscv/inline_memmove.h
riscv/inline_memset.h
utils.h
x86_64/bcmp_implementations.h
x86_64/memcmp_implementations.h
x86_64/memcpy_implementations.h
x86_64/memmove_implementations.h
x86_64/memset_implementations.h
x86_64/inline_bcmp.h
x86_64/inline_memcmp.h
x86_64/inline_memcpy.h
x86_64/inline_memmove.h
x86_64/inline_memset.h
DEPS
libc.src.__support.common
libc.src.__support.CPP.bit
Expand All @@ -41,59 +41,59 @@ add_header_library(
)

add_header_library(
memcpy_implementation
inline_memcpy
HDRS
memcpy_implementations.h
inline_memcpy.h
DEPS
.memory_utils
)

add_header_library(
memmove_implementation
inline_memmove
HDRS
memmove_implementations.h
inline_memmove.h
DEPS
.memory_utils
)

add_header_library(
memcmp_implementation
inline_memcmp
HDRS
memcmp_implementations.h
inline_memcmp.h
DEPS
.memory_utils
)

add_header_library(
memset_implementation
inline_memset
HDRS
memset_implementations.h
inline_memset.h
DEPS
.memory_utils
)

add_header_library(
bzero_implementation
inline_bzero
HDRS
bzero_implementations.h
inline_bzero.h
DEPS
.memset_implementation
.inline_memset
)

add_header_library(
strcmp_implementation
inline_strcmp
HDRS
strcmp_implementations.h
inline_strcmp.h
)

add_header_library(
strstr_implementation
inline_strstr
HDRS
strstr_implementations.h
inline_strstr.h
)

add_header_library(
memmem_implementation
inline_memmem
HDRS
memmem_implementations.h
inline_memmem.h
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_BCMP_IMPLEMENTATIONS_H
#define LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_BCMP_IMPLEMENTATIONS_H
#ifndef LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_INLINE_BCMP_H
#define LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_INLINE_BCMP_H

#include "src/__support/macros/attributes.h" // LIBC_INLINE
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
Expand Down Expand Up @@ -67,4 +67,4 @@ namespace __llvm_libc {

} // namespace __llvm_libc

#endif // LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_BCMP_IMPLEMENTATIONS_H
#endif // LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_INLINE_BCMP_H
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LIBC_SRC_STRING_MEMORY_UTILS_X86_64_MEMCMP_IMPLEMENTATIONS_H
#define LIBC_SRC_STRING_MEMORY_UTILS_X86_64_MEMCMP_IMPLEMENTATIONS_H
#ifndef LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_MEMCMP_H
#define LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_MEMCMP_H

#include "src/__support/macros/config.h" // LIBC_INLINE
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
Expand Down Expand Up @@ -68,4 +68,4 @@ LIBC_INLINE MemcmpReturnType inline_memcmp_aarch64(CPtr p1, CPtr p2,
}
} // namespace __llvm_libc

#endif // LIBC_SRC_STRING_MEMORY_UTILS_X86_64_MEMCMP_IMPLEMENTATIONS_H
#endif // LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_MEMCMP_H
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_MEMCPY_IMPLEMENTATIONS_H
#define LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_MEMCPY_IMPLEMENTATIONS_H
#ifndef LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_INLINE_MEMCPY_H
#define LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_INLINE_MEMCPY_H

#include "src/__support/macros/config.h" // LIBC_INLINE
#include "src/string/memory_utils/op_builtin.h"
Expand Down Expand Up @@ -45,4 +45,4 @@ inline_memcpy_aarch64(Ptr __restrict dst, CPtr __restrict src, size_t count) {

} // namespace __llvm_libc

#endif // LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_MEMCPY_IMPLEMENTATIONS_H
#endif // LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_INLINE_MEMCPY_H
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_MEMMOVE_IMPLEMENTATIONS_H
#define LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_MEMMOVE_IMPLEMENTATIONS_H
#ifndef LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_INLINE_MEMMOVE_H
#define LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_INLINE_MEMMOVE_H

#include "src/__support/macros/config.h" // LIBC_INLINE
#include "src/string/memory_utils/op_aarch64.h" // aarch64::kNeon
Expand Down Expand Up @@ -50,4 +50,4 @@ LIBC_INLINE void inline_memmove_aarch64(Ptr dst, CPtr src, size_t count) {

} // namespace __llvm_libc

#endif // LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_MEMMOVE_IMPLEMENTATIONS_H
#endif // LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_INLINE_MEMMOVE_H
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_MEMSET_IMPLEMENTATIONS_H
#define LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_MEMSET_IMPLEMENTATIONS_H
#ifndef LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_INLINE_MEMSET_H
#define LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_INLINE_MEMSET_H

#include "src/__support/macros/attributes.h" // LIBC_INLINE
#include "src/string/memory_utils/op_aarch64.h"
Expand Down Expand Up @@ -58,4 +58,4 @@ inline_memset_aarch64(Ptr dst, uint8_t value, size_t count) {

} // namespace __llvm_libc

#endif // LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_MEMSET_IMPLEMENTATIONS_H
#endif // LIBC_SRC_STRING_MEMORY_UTILS_AARCH64_INLINE_MEMSET_H
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_BCMP_IMPLEMENTATIONS_H
#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_BCMP_IMPLEMENTATIONS_H
#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_BCMP_H
#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_BCMP_H

#include "src/__support/common.h"
#include "src/__support/macros/properties/architectures.h" // LIBC_TARGET_ARCH_IS_

#include <stddef.h> // size_t

#if defined(LIBC_TARGET_ARCH_IS_X86)
#include "src/string/memory_utils/x86_64/bcmp_implementations.h"
#include "src/string/memory_utils/x86_64/inline_bcmp.h"
#define LIBC_SRC_STRING_MEMORY_UTILS_BCMP inline_bcmp_x86
#elif defined(LIBC_TARGET_ARCH_IS_AARCH64)
#include "src/string/memory_utils/aarch64/bcmp_implementations.h"
#include "src/string/memory_utils/aarch64/inline_bcmp.h"
#define LIBC_SRC_STRING_MEMORY_UTILS_BCMP inline_bcmp_aarch64
#elif defined(LIBC_TARGET_ARCH_IS_ANY_RISCV)
#include "src/string/memory_utils/riscv/bcmp_implementations.h"
#include "src/string/memory_utils/riscv/inline_bcmp.h"
#define LIBC_SRC_STRING_MEMORY_UTILS_BCMP inline_bcmp_riscv
#elif defined(LIBC_TARGET_ARCH_IS_ARM) || defined(LIBC_TARGET_ARCH_IS_GPU)
#include "src/string/memory_utils/generic/byte_per_byte.h"
Expand All @@ -41,4 +41,4 @@ LIBC_INLINE int inline_bcmp(const void *p1, const void *p2, size_t count) {

#undef LIBC_SRC_STRING_MEMORY_UTILS_BCMP

#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_BCMP_IMPLEMENTATIONS_H
#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_BCMP_H
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_BZERO_IMPLEMENTATIONS_H
#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_BZERO_IMPLEMENTATIONS_H
#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_BZERO_H
#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_BZERO_H

#include "src/__support/common.h"
#include "src/string/memory_utils/memset_implementations.h"
#include "src/string/memory_utils/inline_memset.h"

#include <stddef.h> // size_t

Expand All @@ -26,4 +26,4 @@ LIBC_INLINE static void inline_bzero(void *dst, size_t count) {

} // namespace __llvm_libc

#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_BZERO_IMPLEMENTATIONS_H
#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_BZERO_H
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_MEMCMP_IMPLEMENTATIONS_H
#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_MEMCMP_IMPLEMENTATIONS_H
#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMCMP_H
#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMCMP_H

#include "src/__support/macros/config.h" // LIBC_INLINE
#include "src/__support/macros/properties/architectures.h" // LIBC_TARGET_ARCH_IS_
Expand All @@ -16,13 +16,13 @@
#include <stddef.h> // size_t

#if defined(LIBC_TARGET_ARCH_IS_X86)
#include "src/string/memory_utils/x86_64/memcmp_implementations.h"
#include "src/string/memory_utils/x86_64/inline_memcmp.h"
#define LIBC_SRC_STRING_MEMORY_UTILS_MEMCMP inline_memcmp_x86
#elif defined(LIBC_TARGET_ARCH_IS_AARCH64)
#include "src/string/memory_utils/aarch64/memcmp_implementations.h"
#include "src/string/memory_utils/aarch64/inline_memcmp.h"
#define LIBC_SRC_STRING_MEMORY_UTILS_MEMCMP inline_memcmp_aarch64
#elif defined(LIBC_TARGET_ARCH_IS_ANY_RISCV)
#include "src/string/memory_utils/riscv/memcmp_implementations.h"
#include "src/string/memory_utils/riscv/inline_memcmp.h"
#define LIBC_SRC_STRING_MEMORY_UTILS_MEMCMP inline_memcmp_riscv
#elif defined(LIBC_TARGET_ARCH_IS_ARM) || defined(LIBC_TARGET_ARCH_IS_GPU)
#include "src/string/memory_utils/generic/byte_per_byte.h"
Expand All @@ -42,4 +42,4 @@ LIBC_INLINE int inline_memcmp(const void *p1, const void *p2, size_t count) {

#undef LIBC_SRC_STRING_MEMORY_UTILS_MEMCMP

#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_MEMCMP_IMPLEMENTATIONS_H
#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMCMP_H
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_MEMCPY_IMPLEMENTATIONS_H
#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_MEMCPY_IMPLEMENTATIONS_H
#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMCPY_H
#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMCPY_H

#include "src/__support/macros/config.h" // LIBC_INLINE
#include "src/__support/macros/properties/architectures.h" // LIBC_TARGET_ARCH_IS_
Expand All @@ -19,14 +19,14 @@
#include "src/string/memory_utils/generic/byte_per_byte.h"
#define LIBC_SRC_STRING_MEMORY_UTILS_MEMCPY inline_memcpy_byte_per_byte
#elif defined(LIBC_TARGET_ARCH_IS_X86)
#include "src/string/memory_utils/x86_64/memcpy_implementations.h"
#include "src/string/memory_utils/x86_64/inline_memcpy.h"
#define LIBC_SRC_STRING_MEMORY_UTILS_MEMCPY \
inline_memcpy_x86_maybe_interpose_repmovsb
#elif defined(LIBC_TARGET_ARCH_IS_AARCH64)
#include "src/string/memory_utils/aarch64/memcpy_implementations.h"
#include "src/string/memory_utils/aarch64/inline_memcpy.h"
#define LIBC_SRC_STRING_MEMORY_UTILS_MEMCPY inline_memcpy_aarch64
#elif defined(LIBC_TARGET_ARCH_IS_ANY_RISCV)
#include "src/string/memory_utils/riscv/memcpy_implementations.h"
#include "src/string/memory_utils/riscv/inline_memcpy.h"
#define LIBC_SRC_STRING_MEMORY_UTILS_MEMCPY inline_memcpy_riscv
#elif defined(LIBC_TARGET_ARCH_IS_ARM) || defined(LIBC_TARGET_ARCH_IS_GPU)
#include "src/string/memory_utils/generic/byte_per_byte.h"
Expand All @@ -45,4 +45,4 @@ LIBC_INLINE void inline_memcpy(void *__restrict dst, const void *__restrict src,

} // namespace __llvm_libc

#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_MEMCPY_IMPLEMENTATIONS_H
#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMCPY_H
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_MEMMEM_IMPLEMENTATIONS_H
#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_MEMMEM_IMPLEMENTATIONS_H
#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMMEM_H
#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMMEM_H

#include <stddef.h>

namespace __llvm_libc {

template <typename Comp>
constexpr static void *
memmem_implementation(const void *haystack, size_t haystack_len,
const void *needle, size_t needle_len, Comp &&comp) {
constexpr static void *inline_memmem(const void *haystack, size_t haystack_len,
const void *needle, size_t needle_len,
Comp &&comp) {
// TODO: simple brute force implementation. This can be
// improved upon using well known string matching algorithms.
if (!needle_len)
Expand All @@ -39,4 +39,4 @@ memmem_implementation(const void *haystack, size_t haystack_len,

} // namespace __llvm_libc

#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_MEMMEM_IMPLEMENTATIONS_H
#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMMEM_H
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_MEMMOVE_IMPLEMENTATIONS_H
#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_MEMMOVE_IMPLEMENTATIONS_H
#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMMOVE_H
#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMMOVE_H

#include <stddef.h> // size_t, ptrdiff_t

#if defined(LIBC_TARGET_ARCH_IS_X86)
#include "src/string/memory_utils/x86_64/memmove_implementations.h"
#include "src/string/memory_utils/x86_64/inline_memmove.h"
#define LIBC_SRC_STRING_MEMORY_UTILS_MEMMOVE inline_memmove_x86
#elif defined(LIBC_TARGET_ARCH_IS_AARCH64)
#include "src/string/memory_utils/aarch64/memmove_implementations.h"
#include "src/string/memory_utils/aarch64/inline_memmove.h"
#define LIBC_SRC_STRING_MEMORY_UTILS_MEMMOVE inline_memmove_aarch64
#elif defined(LIBC_TARGET_ARCH_IS_ANY_RISCV)
#include "src/string/memory_utils/riscv/memmove_implementations.h"
#include "src/string/memory_utils/riscv/inline_memmove.h"
#define LIBC_SRC_STRING_MEMORY_UTILS_MEMMOVE inline_memmove_riscv
#elif defined(LIBC_TARGET_ARCH_IS_ARM) || defined(LIBC_TARGET_ARCH_IS_GPU)
#include "src/string/memory_utils/generic/byte_per_byte.h"
Expand All @@ -36,4 +36,4 @@ LIBC_INLINE void inline_memmove(void *dst, const void *src, size_t count) {

} // namespace __llvm_libc

#endif /* LLVM_LIBC_SRC_STRING_MEMORY_UTILS_MEMMOVE_IMPLEMENTATIONS_H */
#endif /* LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMMOVE_H */
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_MEMSET_IMPLEMENTATIONS_H
#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_MEMSET_IMPLEMENTATIONS_H
#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMSET_H
#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMSET_H

#include "src/__support/macros/config.h" // LIBC_INLINE
#include "src/__support/macros/properties/architectures.h" // LIBC_TARGET_ARCH_IS_
Expand All @@ -16,13 +16,13 @@
#include <stddef.h> // size_t

#if defined(LIBC_TARGET_ARCH_IS_X86)
#include "src/string/memory_utils/x86_64/memset_implementations.h"
#include "src/string/memory_utils/x86_64/inline_memset.h"
#define LIBC_SRC_STRING_MEMORY_UTILS_MEMSET inline_memset_x86
#elif defined(LIBC_TARGET_ARCH_IS_AARCH64)
#include "src/string/memory_utils/aarch64/memset_implementations.h"
#include "src/string/memory_utils/aarch64/inline_memset.h"
#define LIBC_SRC_STRING_MEMORY_UTILS_MEMSET inline_memset_aarch64
#elif defined(LIBC_TARGET_ARCH_IS_ANY_RISCV)
#include "src/string/memory_utils/riscv/memset_implementations.h"
#include "src/string/memory_utils/riscv/inline_memset.h"
#define LIBC_SRC_STRING_MEMORY_UTILS_MEMSET inline_memset_riscv
#elif defined(LIBC_TARGET_ARCH_IS_ARM) || defined(LIBC_TARGET_ARCH_IS_GPU)
#include "src/string/memory_utils/generic/byte_per_byte.h"
Expand All @@ -41,4 +41,4 @@ LIBC_INLINE static void inline_memset(void *dst, uint8_t value, size_t count) {

#undef LIBC_SRC_STRING_MEMORY_UTILS_MEMSET

#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_MEMSET_IMPLEMENTATIONS_H
#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_MEMSET_H
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_STRCMP_IMPLEMENTATIONS_H
#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_STRCMP_IMPLEMENTATIONS_H
#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_STRCMP_H
#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_STRCMP_H

#include <stddef.h>

namespace __llvm_libc {

template <typename Comp>
LIBC_INLINE constexpr int
strcmp_implementation(const char *left, const char *right, Comp &&comp) {
LIBC_INLINE constexpr int inline_strcmp(const char *left, const char *right,
Comp &&comp) {
// TODO: Look at benefits for comparing words at a time.
for (; *left && !comp(*left, *right); ++left, ++right)
;
Expand All @@ -24,9 +24,8 @@ strcmp_implementation(const char *left, const char *right, Comp &&comp) {
}

template <typename Comp>
LIBC_INLINE constexpr int strncmp_implementation(const char *left,
const char *right, size_t n,
Comp &&comp) {
LIBC_INLINE constexpr int inline_strncmp(const char *left, const char *right,
size_t n, Comp &&comp) {
if (n == 0)
return 0;

Expand All @@ -42,4 +41,4 @@ LIBC_INLINE constexpr int strncmp_implementation(const char *left,

} // namespace __llvm_libc

#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_STRCMP_IMPLEMENTATIONS_H
#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_STRCMP_H
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_STRSTR_IMPLEMENTATIONS_H
#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_STRSTR_IMPLEMENTATIONS_H
#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_STRSTR_H
#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_STRSTR_H

#include "src/string/memory_utils/memmem_implementations.h"
#include "src/string/memory_utils/inline_memmem.h"
#include "src/string/string_utils.h"
#include <stddef.h>

namespace __llvm_libc {

template <typename Comp>
LIBC_INLINE constexpr char *
strstr_implementation(const char *haystack, const char *needle, Comp &&comp) {
void *result = memmem_implementation(
LIBC_INLINE constexpr char *inline_strstr(const char *haystack,
const char *needle, Comp &&comp) {
void *result = inline_memmem(
static_cast<const void *>(haystack), internal::string_length(haystack),
static_cast<const void *>(needle), internal::string_length(needle), comp);
return static_cast<char *>(result);
}

} // namespace __llvm_libc

#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_STRSTR_IMPLEMENTATIONS_H
#endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_STRSTR_H
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LIBC_SRC_STRING_MEMORY_UTILS_RISCV_BCMP_IMPLEMENTATIONS_H
#define LIBC_SRC_STRING_MEMORY_UTILS_RISCV_BCMP_IMPLEMENTATIONS_H
#ifndef LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_BCMP_H
#define LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_BCMP_H

#include "src/__support/macros/attributes.h" // LIBC_INLINE
#include "src/__support/macros/properties/architectures.h" // LIBC_TARGET_ARCH_IS_RISCV64
Expand All @@ -30,4 +30,4 @@ namespace __llvm_libc {

} // namespace __llvm_libc

#endif // LIBC_SRC_STRING_MEMORY_UTILS_RISCV_BCMP_IMPLEMENTATIONS_H
#endif // LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_BCMP_H
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LIBC_SRC_STRING_MEMORY_UTILS_RISCV_MEMCMP_IMPLEMENTATIONS_H
#define LIBC_SRC_STRING_MEMORY_UTILS_RISCV_MEMCMP_IMPLEMENTATIONS_H
#ifndef LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_MEMCMP_H
#define LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_MEMCMP_H

#include "src/__support/macros/attributes.h" // LIBC_INLINE
#include "src/__support/macros/properties/architectures.h" // LIBC_TARGET_ARCH_IS_RISCV64
Expand All @@ -30,4 +30,4 @@ inline_memcmp_riscv(CPtr p1, CPtr p2, size_t count) {

} // namespace __llvm_libc

#endif // LIBC_SRC_STRING_MEMORY_UTILS_RISCV_MEMCMP_IMPLEMENTATIONS_H
#endif // LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_MEMCMP_H
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LIBC_SRC_STRING_MEMORY_UTILS_RISCV_MEMCPY_IMPLEMENTATIONS_H
#define LIBC_SRC_STRING_MEMORY_UTILS_RISCV_MEMCPY_IMPLEMENTATIONS_H
#ifndef LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_MEMCPY_H
#define LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_MEMCPY_H

#include "src/__support/macros/attributes.h" // LIBC_INLINE
#include "src/__support/macros/properties/architectures.h" // LIBC_TARGET_ARCH_IS_RISCV64
Expand All @@ -30,4 +30,4 @@ inline_memcpy_riscv(Ptr __restrict dst, CPtr __restrict src, size_t count) {

} // namespace __llvm_libc

#endif // LIBC_SRC_STRING_MEMORY_UTILS_RISCV_MEMCPY_IMPLEMENTATIONS_H
#endif // LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_MEMCPY_H
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LIBC_SRC_STRING_MEMORY_UTILS_RISCV_MEMMOVE_IMPLEMENTATIONS_H
#define LIBC_SRC_STRING_MEMORY_UTILS_RISCV_MEMMOVE_IMPLEMENTATIONS_H
#ifndef LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_MEMMOVE_H
#define LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_MEMMOVE_H

#include "src/__support/macros/attributes.h" // LIBC_INLINE
#include "src/__support/macros/properties/architectures.h" // LIBC_TARGET_ARCH_IS_RISCV64
Expand All @@ -24,4 +24,4 @@ inline_memmove_riscv(Ptr __restrict dst, CPtr __restrict src, size_t count) {

} // namespace __llvm_libc

#endif // LIBC_SRC_STRING_MEMORY_UTILS_RISCV_MEMMOVE_IMPLEMENTATIONS_H
#endif // LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_MEMMOVE_H
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LIBC_SRC_STRING_MEMORY_UTILS_RISCV_MEMSET_IMPLEMENTATIONS_H
#define LIBC_SRC_STRING_MEMORY_UTILS_RISCV_MEMSET_IMPLEMENTATIONS_H
#ifndef LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_MEMSET_H
#define LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_MEMSET_H

#include "src/__support/macros/attributes.h" // LIBC_INLINE
#include "src/__support/macros/properties/architectures.h" // LIBC_TARGET_ARCH_IS_RISCV64
Expand All @@ -30,4 +30,4 @@ LIBC_INLINE static void inline_memset_riscv(Ptr dst, uint8_t value,

} // namespace __llvm_libc

#endif // LIBC_SRC_STRING_MEMORY_UTILS_RISCV_MEMSET_IMPLEMENTATIONS_H
#endif // LIBC_SRC_STRING_MEMORY_UTILS_RISCV_INLINE_MEMSET_H
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LIBC_SRC_STRING_MEMORY_UTILS_X86_64_BCMP_IMPLEMENTATIONS_H
#define LIBC_SRC_STRING_MEMORY_UTILS_X86_64_BCMP_IMPLEMENTATIONS_H
#ifndef LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_BCMP_H
#define LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_BCMP_H

#include "src/__support/macros/attributes.h" // LIBC_INLINE
#include "src/string/memory_utils/op_generic.h"
Expand Down Expand Up @@ -90,4 +90,4 @@ inline_bcmp_x86_avx512bw_gt16(CPtr p1, CPtr p2, size_t count) {

} // namespace __llvm_libc

#endif // LIBC_SRC_STRING_MEMORY_UTILS_X86_64_BCMP_IMPLEMENTATIONS_H
#endif // LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_BCMP_H
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LIBC_SRC_STRING_MEMORY_UTILS_X86_64_MEMCMP_IMPLEMENTATIONS_H
#define LIBC_SRC_STRING_MEMORY_UTILS_X86_64_MEMCMP_IMPLEMENTATIONS_H
#ifndef LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_MEMCMP_H
#define LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_MEMCMP_H

#include "src/__support/macros/config.h" // LIBC_INLINE
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
Expand Down Expand Up @@ -90,4 +90,4 @@ LIBC_INLINE MemcmpReturnType inline_memcmp_x86(CPtr p1, CPtr p2, size_t count) {

} // namespace __llvm_libc

#endif // LIBC_SRC_STRING_MEMORY_UTILS_X86_64_MEMCMP_IMPLEMENTATIONS_H
#endif // LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_MEMCMP_H
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LIBC_SRC_STRING_MEMORY_UTILS_X86_64_MEMCPY_IMPLEMENTATIONS_H
#define LIBC_SRC_STRING_MEMORY_UTILS_X86_64_MEMCPY_IMPLEMENTATIONS_H
#ifndef LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_MEMCPY_H
#define LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_MEMCPY_H

#include "src/__support/macros/attributes.h" // LIBC_INLINE_VAR
#include "src/__support/macros/config.h" // LIBC_INLINE
Expand Down Expand Up @@ -199,4 +199,4 @@ inline_memcpy_x86_maybe_interpose_repmovsb(Ptr __restrict dst,

} // namespace __llvm_libc

#endif // LIBC_SRC_STRING_MEMORY_UTILS_X86_64_MEMCPY_IMPLEMENTATIONS_H
#endif // LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_MEMCPY_H
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LIBC_SRC_STRING_MEMORY_UTILS_X86_64_MEMMOVE_IMPLEMENTATIONS_H
#define LIBC_SRC_STRING_MEMORY_UTILS_X86_64_MEMMOVE_IMPLEMENTATIONS_H
#ifndef LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_MEMMOVE_H
#define LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_MEMMOVE_H

#include "src/__support/macros/config.h" // LIBC_INLINE
#include "src/string/memory_utils/op_builtin.h"
Expand Down Expand Up @@ -63,4 +63,4 @@ LIBC_INLINE void inline_memmove_x86(Ptr dst, CPtr src, size_t count) {

} // namespace __llvm_libc

#endif // LIBC_SRC_STRING_MEMORY_UTILS_X86_64_MEMMOVE_IMPLEMENTATIONS_H
#endif // LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_MEMMOVE_H
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LIBC_SRC_STRING_MEMORY_UTILS_X86_64_MEMSET_IMPLEMENTATIONS_H
#define LIBC_SRC_STRING_MEMORY_UTILS_X86_64_MEMSET_IMPLEMENTATIONS_H
#ifndef LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_MEMSET_H
#define LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_MEMSET_H

#include "src/__support/macros/attributes.h" // LIBC_INLINE
#include "src/string/memory_utils/op_generic.h"
Expand Down Expand Up @@ -62,4 +62,4 @@ inline_memset_x86(Ptr dst, uint8_t value, size_t count) {
}
} // namespace __llvm_libc

#endif // LIBC_SRC_STRING_MEMORY_UTILS_X86_64_MEMSET_IMPLEMENTATIONS_H
#endif // LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_MEMSET_H
2 changes: 1 addition & 1 deletion libc/src/string/mempcpy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//

#include "src/string/mempcpy.h"
#include "src/string/memory_utils/memcpy_implementations.h"
#include "src/string/memory_utils/inline_memcpy.h"

#include "src/__support/common.h"
#include <stddef.h> // For size_t.
Expand Down
2 changes: 1 addition & 1 deletion libc/src/string/memset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include "src/string/memset.h"
#include "src/__support/common.h"
#include "src/string/memory_utils/memset_implementations.h"
#include "src/string/memory_utils/inline_memset.h"

namespace __llvm_libc {

Expand Down
2 changes: 1 addition & 1 deletion libc/src/string/stpncpy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//

#include "src/string/stpncpy.h"
#include "src/string/memory_utils/bzero_implementations.h"
#include "src/string/memory_utils/inline_bzero.h"

#include "src/__support/common.h"

Expand Down
4 changes: 2 additions & 2 deletions libc/src/string/strcasecmp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include "src/__support/common.h"
#include "src/__support/ctype_utils.h"
#include "src/string/memory_utils/strcmp_implementations.h"
#include "src/string/memory_utils/inline_strcmp.h"

namespace __llvm_libc {

Expand All @@ -19,7 +19,7 @@ LLVM_LIBC_FUNCTION(int, strcasecmp, (const char *left, const char *right)) {
return __llvm_libc::internal::tolower(a) -
__llvm_libc::internal::tolower(b);
};
return strcmp_implementation(left, right, case_cmp);
return inline_strcmp(left, right, case_cmp);
}

} // namespace __llvm_libc
4 changes: 2 additions & 2 deletions libc/src/string/strcasestr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include "src/__support/common.h"
#include "src/__support/ctype_utils.h"
#include "src/string/memory_utils/strstr_implementations.h"
#include "src/string/memory_utils/inline_strstr.h"

namespace __llvm_libc {

Expand All @@ -22,7 +22,7 @@ LLVM_LIBC_FUNCTION(char *, strcasestr,
return __llvm_libc::internal::tolower(a) -
__llvm_libc::internal::tolower(b);
};
return strstr_implementation(haystack, needle, case_cmp);
return inline_strstr(haystack, needle, case_cmp);
}

} // namespace __llvm_libc
4 changes: 2 additions & 2 deletions libc/src/string/strcmp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
#include "src/string/strcmp.h"

#include "src/__support/common.h"
#include "src/string/memory_utils/strcmp_implementations.h"
#include "src/string/memory_utils/inline_strcmp.h"

namespace __llvm_libc {

LLVM_LIBC_FUNCTION(int, strcmp, (const char *left, const char *right)) {
auto comp = [](char l, char r) -> int { return l - r; };
return strcmp_implementation(left, right, comp);
return inline_strcmp(left, right, comp);
}

} // namespace __llvm_libc
2 changes: 1 addition & 1 deletion libc/src/string/strcpy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//

#include "src/string/strcpy.h"
#include "src/string/memory_utils/memcpy_implementations.h"
#include "src/string/memory_utils/inline_memcpy.h"
#include "src/string/string_utils.h"

#include "src/__support/common.h"
Expand Down
2 changes: 1 addition & 1 deletion libc/src/string/strdup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "src/string/strdup.h"
#include "src/errno/libc_errno.h"
#include "src/string/allocating_string_utils.h"
#include "src/string/memory_utils/memcpy_implementations.h"
#include "src/string/memory_utils/inline_memcpy.h"

#include "src/__support/common.h"

Expand Down
4 changes: 2 additions & 2 deletions libc/src/string/string_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

#include "src/__support/CPP/bitset.h"
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
#include "src/string/memory_utils/bzero_implementations.h"
#include "src/string/memory_utils/memcpy_implementations.h"
#include "src/string/memory_utils/inline_bzero.h"
#include "src/string/memory_utils/inline_memcpy.h"
#include <stddef.h> // For size_t

namespace __llvm_libc {
Expand Down
4 changes: 2 additions & 2 deletions libc/src/string/strncasecmp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include "src/__support/common.h"
#include "src/__support/ctype_utils.h"
#include "src/string/memory_utils/strcmp_implementations.h"
#include "src/string/memory_utils/inline_strcmp.h"

namespace __llvm_libc {

Expand All @@ -20,7 +20,7 @@ LLVM_LIBC_FUNCTION(int, strncasecmp,
return __llvm_libc::internal::tolower(a) -
__llvm_libc::internal::tolower(b);
};
return strncmp_implementation(left, right, n, case_cmp);
return inline_strncmp(left, right, n, case_cmp);
}

} // namespace __llvm_libc
4 changes: 2 additions & 2 deletions libc/src/string/strncmp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "src/string/strncmp.h"

#include "src/__support/common.h"
#include "src/string/memory_utils/strcmp_implementations.h"
#include "src/string/memory_utils/inline_strcmp.h"

#include <stddef.h>

Expand All @@ -18,7 +18,7 @@ namespace __llvm_libc {
LLVM_LIBC_FUNCTION(int, strncmp,
(const char *left, const char *right, size_t n)) {
auto comp = [](char l, char r) -> int { return l - r; };
return strncmp_implementation(left, right, n, comp);
return inline_strncmp(left, right, n, comp);
}

} // namespace __llvm_libc
2 changes: 1 addition & 1 deletion libc/src/string/strndup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//

#include "src/string/strndup.h"
#include "src/string/memory_utils/memcpy_implementations.h"
#include "src/string/memory_utils/inline_memcpy.h"
#include "src/string/string_utils.h"

#include "src/__support/CPP/new.h"
Expand Down
4 changes: 2 additions & 2 deletions libc/src/string/strstr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
#include "src/string/strstr.h"

#include "src/__support/common.h"
#include "src/string/memory_utils/strstr_implementations.h"
#include "src/string/memory_utils/inline_strstr.h"

namespace __llvm_libc {

// TODO: This is a simple brute force implementation. This can be
// improved upon using well known string matching algorithms.
LLVM_LIBC_FUNCTION(char *, strstr, (const char *haystack, const char *needle)) {
auto comp = [](char l, char r) -> int { return l - r; };
return strstr_implementation(haystack, needle, comp);
return inline_strstr(haystack, needle, comp);
}

} // namespace __llvm_libc
2 changes: 1 addition & 1 deletion libc/src/string/strxfrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//

#include "src/string/strxfrm.h"
#include "src/string/memory_utils/memcpy_implementations.h"
#include "src/string/memory_utils/inline_memcpy.h"
#include "src/string/string_utils.h"

#include "src/__support/common.h"
Expand Down
2 changes: 1 addition & 1 deletion libc/startup/linux/aarch64/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ add_startup_object(
libc.src.__support.OSUtil.osutil
libc.src.stdlib.exit
libc.src.stdlib.atexit
libc.src.string.memory_utils.memcpy_implementation
libc.src.string.memory_utils.inline_memcpy
libc.src.unistd.environ
COMPILE_OPTIONS
-fno-omit-frame-pointer
Expand Down
2 changes: 1 addition & 1 deletion libc/startup/linux/aarch64/start.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "src/__support/threads/thread.h"
#include "src/stdlib/atexit.h"
#include "src/stdlib/exit.h"
#include "src/string/memory_utils/memcpy_implementations.h"
#include "src/string/memory_utils/inline_memcpy.h"

#include <arm_acle.h>

Expand Down
2 changes: 1 addition & 1 deletion libc/startup/linux/riscv64/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ add_startup_object(
libc.src.__support.OSUtil.osutil
libc.src.stdlib.exit
libc.src.stdlib.atexit
libc.src.string.memory_utils.memcpy_implementation
libc.src.string.memory_utils.inline_memcpy
libc.src.unistd.environ
COMPILE_OPTIONS
-fno-omit-frame-pointer
Expand Down
2 changes: 1 addition & 1 deletion libc/startup/linux/riscv64/start.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "src/__support/threads/thread.h"
#include "src/stdlib/atexit.h"
#include "src/stdlib/exit.h"
#include "src/string/memory_utils/memcpy_implementations.h"
#include "src/string/memory_utils/inline_memcpy.h"

#include <linux/auxvec.h>
#include <linux/elf.h>
Expand Down
2 changes: 1 addition & 1 deletion libc/startup/linux/x86_64/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ add_startup_object(
libc.src.__support.OSUtil.osutil
libc.src.stdlib.exit
libc.src.stdlib.atexit
libc.src.string.memory_utils.memcpy_implementation
libc.src.string.memory_utils.inline_memcpy
libc.src.unistd.environ
COMPILE_OPTIONS
-fno-omit-frame-pointer
Expand Down
2 changes: 1 addition & 1 deletion libc/startup/linux/x86_64/start.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "src/__support/threads/thread.h"
#include "src/stdlib/atexit.h"
#include "src/stdlib/exit.h"
#include "src/string/memory_utils/memcpy_implementations.h"
#include "src/string/memory_utils/inline_memcpy.h"

#include <asm/prctl.h>
#include <linux/auxvec.h>
Expand Down
4 changes: 2 additions & 2 deletions libc/test/integration/startup/gpu/rpc_stream_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#include "src/__support/GPU/utils.h"
#include "src/__support/RPC/rpc_client.h"
#include "src/__support/integer_to_string.h"
#include "src/string/memory_utils/memcmp_implementations.h"
#include "src/string/memory_utils/memcpy_implementations.h"
#include "src/string/memory_utils/inline_memcmp.h"
#include "src/string/memory_utils/inline_memcpy.h"
#include "src/string/string_utils.h"
#include "test/IntegrationTest/test.h"

Expand Down
48 changes: 24 additions & 24 deletions utils/bazel/llvm-project-overlay/libc/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2012,32 +2012,32 @@ libc_support_library(
],
defines = MEMORY_COPTS,
textual_hdrs = [
"src/string/memory_utils/aarch64/bcmp_implementations.h",
"src/string/memory_utils/aarch64/memcmp_implementations.h",
"src/string/memory_utils/aarch64/memcpy_implementations.h",
"src/string/memory_utils/aarch64/memmove_implementations.h",
"src/string/memory_utils/aarch64/memset_implementations.h",
"src/string/memory_utils/bcmp_implementations.h",
"src/string/memory_utils/bzero_implementations.h",
"src/string/memory_utils/aarch64/inline_bcmp.h",
"src/string/memory_utils/aarch64/inline_memcmp.h",
"src/string/memory_utils/aarch64/inline_memcpy.h",
"src/string/memory_utils/aarch64/inline_memmove.h",
"src/string/memory_utils/aarch64/inline_memset.h",
"src/string/memory_utils/generic/aligned_access.h",
"src/string/memory_utils/generic/byte_per_byte.h",
"src/string/memory_utils/memcmp_implementations.h",
"src/string/memory_utils/memcpy_implementations.h",
"src/string/memory_utils/memmem_implementations.h",
"src/string/memory_utils/memmove_implementations.h",
"src/string/memory_utils/memset_implementations.h",
"src/string/memory_utils/riscv/bcmp_implementations.h",
"src/string/memory_utils/riscv/memcmp_implementations.h",
"src/string/memory_utils/riscv/memcpy_implementations.h",
"src/string/memory_utils/riscv/memmove_implementations.h",
"src/string/memory_utils/riscv/memset_implementations.h",
"src/string/memory_utils/strcmp_implementations.h",
"src/string/memory_utils/strstr_implementations.h",
"src/string/memory_utils/x86_64/bcmp_implementations.h",
"src/string/memory_utils/x86_64/memcmp_implementations.h",
"src/string/memory_utils/x86_64/memcpy_implementations.h",
"src/string/memory_utils/x86_64/memmove_implementations.h",
"src/string/memory_utils/x86_64/memset_implementations.h",
"src/string/memory_utils/inline_bcmp.h",
"src/string/memory_utils/inline_bzero.h",
"src/string/memory_utils/inline_memcmp.h",
"src/string/memory_utils/inline_memcpy.h",
"src/string/memory_utils/inline_memmem.h",
"src/string/memory_utils/inline_memmove.h",
"src/string/memory_utils/inline_memset.h",
"src/string/memory_utils/inline_strcmp.h",
"src/string/memory_utils/inline_strstr.h",
"src/string/memory_utils/riscv/inline_bcmp.h",
"src/string/memory_utils/riscv/inline_memcmp.h",
"src/string/memory_utils/riscv/inline_memcpy.h",
"src/string/memory_utils/riscv/inline_memmove.h",
"src/string/memory_utils/riscv/inline_memset.h",
"src/string/memory_utils/x86_64/inline_bcmp.h",
"src/string/memory_utils/x86_64/inline_memcmp.h",
"src/string/memory_utils/x86_64/inline_memcpy.h",
"src/string/memory_utils/x86_64/inline_memmove.h",
"src/string/memory_utils/x86_64/inline_memset.h",
],
deps = [
":__support_common",
Expand Down