#ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_MEMCMP_H
#define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_X86_64_INLINE_MEMCMP_H
#include "src/__support/macros/attributes.h"
#include "src/__support/macros/optimization.h"
#include "src/string/memory_utils/op_generic.h"
#include "src/string/memory_utils/op_x86.h"
#include "src/string/memory_utils/utils.h"
namespace LIBC_NAMESPACE_DECL {
[[maybe_unused]] LIBC_INLINE MemcmpReturnType
inline_memcmp_generic_gt16(CPtr p1, CPtr p2, size_t count) { … }
#if defined(__SSE4_1__)
[[maybe_unused]] LIBC_INLINE MemcmpReturnType
inline_memcmp_x86_sse41_gt16(CPtr p1, CPtr p2, size_t count) {
return generic::Memcmp<__m128i>::loop_and_tail_align_above(384, p1, p2,
count);
}
#endif
#if defined(__AVX2__)
[[maybe_unused]] LIBC_INLINE MemcmpReturnType
inline_memcmp_x86_avx2_gt16(CPtr p1, CPtr p2, size_t count) {
if (count <= 32)
return generic::Memcmp<__m128i>::head_tail(p1, p2, count);
if (count <= 64)
return generic::Memcmp<__m256i>::head_tail(p1, p2, count);
return generic::Memcmp<__m256i>::loop_and_tail_align_above(384, p1, p2,
count);
}
#endif
#if defined(__AVX512BW__)
[[maybe_unused]] LIBC_INLINE MemcmpReturnType
inline_memcmp_x86_avx512bw_gt16(CPtr p1, CPtr p2, size_t count) {
if (count <= 32)
return generic::Memcmp<__m128i>::head_tail(p1, p2, count);
if (count <= 64)
return generic::Memcmp<__m256i>::head_tail(p1, p2, count);
if (count <= 128)
return generic::Memcmp<__m512i>::head_tail(p1, p2, count);
return generic::Memcmp<__m512i>::loop_and_tail_align_above(384, p1, p2,
count);
}
#endif
LIBC_INLINE MemcmpReturnType inline_memcmp_x86(CPtr p1, CPtr p2, size_t count) { … }
}
#endif