#include "LibcFunctionPrototypes.h" #include "llvm/ADT/ArrayRef.h" #include namespace LIBC_NAMESPACE { extern void *memcpy(void *__restrict, const void *__restrict, size_t); extern void *memmove(void *, const void *, size_t); extern void *memset(void *, int, size_t); extern void bzero(void *, size_t); extern int memcmp(const void *, const void *, size_t); extern int bcmp(const void *, const void *, size_t); } // namespace LIBC_NAMESPACE // List of implementations to test. using llvm::libc_benchmarks::BzeroConfiguration; using llvm::libc_benchmarks::MemcmpOrBcmpConfiguration; using llvm::libc_benchmarks::MemcpyConfiguration; using llvm::libc_benchmarks::MemmoveConfiguration; using llvm::libc_benchmarks::MemsetConfiguration; llvm::ArrayRef getMemcpyConfigurations() { static constexpr MemcpyConfiguration kMemcpyConfigurations[] = { {LIBC_NAMESPACE::memcpy, "LIBC_NAMESPACE::memcpy"}}; return llvm::ArrayRef(kMemcpyConfigurations); } llvm::ArrayRef getMemmoveConfigurations() { static constexpr MemmoveConfiguration kMemmoveConfigurations[] = { {LIBC_NAMESPACE::memmove, "LIBC_NAMESPACE::memmove"}}; return llvm::ArrayRef(kMemmoveConfigurations); } llvm::ArrayRef getMemcmpConfigurations() { static constexpr MemcmpOrBcmpConfiguration kMemcmpConfiguration[] = { {LIBC_NAMESPACE::memcmp, "LIBC_NAMESPACE::memcmp"}}; return llvm::ArrayRef(kMemcmpConfiguration); } llvm::ArrayRef getBcmpConfigurations() { static constexpr MemcmpOrBcmpConfiguration kBcmpConfigurations[] = { {LIBC_NAMESPACE::bcmp, "LIBC_NAMESPACE::bcmp"}}; return llvm::ArrayRef(kBcmpConfigurations); } llvm::ArrayRef getMemsetConfigurations() { static constexpr MemsetConfiguration kMemsetConfigurations[] = { {LIBC_NAMESPACE::memset, "LIBC_NAMESPACE::memset"}}; return llvm::ArrayRef(kMemsetConfigurations); } llvm::ArrayRef getBzeroConfigurations() { static constexpr BzeroConfiguration kBzeroConfigurations[] = { {LIBC_NAMESPACE::bzero, "LIBC_NAMESPACE::bzero"}}; return llvm::ArrayRef(kBzeroConfigurations); }