1#include "LibcFunctionPrototypes.h"
2#include "llvm/ADT/ArrayRef.h"
3#include <cstddef>
4
5namespace LIBC_NAMESPACE {
6
7extern void *memcpy(void *__restrict, const void *__restrict, size_t);
8extern void *memmove(void *, const void *, size_t);
9extern void *memset(void *, int, size_t);
10extern void bzero(void *, size_t);
11extern int memcmp(const void *, const void *, size_t);
12extern int bcmp(const void *, const void *, size_t);
13
14} // namespace LIBC_NAMESPACE
15
16// List of implementations to test.
17
18using llvm::libc_benchmarks::BzeroConfiguration;
19using llvm::libc_benchmarks::MemcmpOrBcmpConfiguration;
20using llvm::libc_benchmarks::MemcpyConfiguration;
21using llvm::libc_benchmarks::MemmoveConfiguration;
22using llvm::libc_benchmarks::MemsetConfiguration;
23
24llvm::ArrayRef<MemcpyConfiguration> getMemcpyConfigurations() {
25 static constexpr MemcpyConfiguration kMemcpyConfigurations[] = {
26 {LIBC_NAMESPACE::memcpy, "LIBC_NAMESPACE::memcpy"}};
27 return llvm::ArrayRef(kMemcpyConfigurations);
28}
29llvm::ArrayRef<MemmoveConfiguration> getMemmoveConfigurations() {
30 static constexpr MemmoveConfiguration kMemmoveConfigurations[] = {
31 {LIBC_NAMESPACE::memmove, "LIBC_NAMESPACE::memmove"}};
32 return llvm::ArrayRef(kMemmoveConfigurations);
33}
34llvm::ArrayRef<MemcmpOrBcmpConfiguration> getMemcmpConfigurations() {
35 static constexpr MemcmpOrBcmpConfiguration kMemcmpConfiguration[] = {
36 {LIBC_NAMESPACE::memcmp, "LIBC_NAMESPACE::memcmp"}};
37 return llvm::ArrayRef(kMemcmpConfiguration);
38}
39llvm::ArrayRef<MemcmpOrBcmpConfiguration> getBcmpConfigurations() {
40 static constexpr MemcmpOrBcmpConfiguration kBcmpConfigurations[] = {
41 {LIBC_NAMESPACE::bcmp, "LIBC_NAMESPACE::bcmp"}};
42 return llvm::ArrayRef(kBcmpConfigurations);
43}
44llvm::ArrayRef<MemsetConfiguration> getMemsetConfigurations() {
45 static constexpr MemsetConfiguration kMemsetConfigurations[] = {
46 {LIBC_NAMESPACE::memset, "LIBC_NAMESPACE::memset"}};
47 return llvm::ArrayRef(kMemsetConfigurations);
48}
49llvm::ArrayRef<BzeroConfiguration> getBzeroConfigurations() {
50 static constexpr BzeroConfiguration kBzeroConfigurations[] = {
51 {LIBC_NAMESPACE::bzero, "LIBC_NAMESPACE::bzero"}};
52 return llvm::ArrayRef(kBzeroConfigurations);
53}
54

source code of libc/benchmarks/LibcDefaultImplementations.cpp