[Workflow] Roll back some settings since they caused more issues
[llvm-project.git] / libc / benchmarks / LibcDefaultImplementations.cpp
blob95077cd6591530e14359de8da7835c2cb5f2d453
1 #include "LibcFunctionPrototypes.h"
2 #include "llvm/ADT/ArrayRef.h"
3 #include <cstddef>
5 namespace __llvm_libc {
7 extern void *memcpy(void *__restrict, const void *__restrict, size_t);
8 extern void *memmove(void *, const void *, size_t);
9 extern void *memset(void *, int, size_t);
10 extern void bzero(void *, size_t);
11 extern int memcmp(const void *, const void *, size_t);
12 extern int bcmp(const void *, const void *, size_t);
14 } // namespace __llvm_libc
16 // List of implementations to test.
18 using llvm::libc_benchmarks::BzeroConfiguration;
19 using llvm::libc_benchmarks::MemcmpOrBcmpConfiguration;
20 using llvm::libc_benchmarks::MemcpyConfiguration;
21 using llvm::libc_benchmarks::MemmoveConfiguration;
22 using llvm::libc_benchmarks::MemsetConfiguration;
24 llvm::ArrayRef<MemcpyConfiguration> getMemcpyConfigurations() {
25 static constexpr MemcpyConfiguration kMemcpyConfigurations[] = {
26 {__llvm_libc::memcpy, "__llvm_libc::memcpy"}};
27 return llvm::ArrayRef(kMemcpyConfigurations);
29 llvm::ArrayRef<MemmoveConfiguration> getMemmoveConfigurations() {
30 static constexpr MemmoveConfiguration kMemmoveConfigurations[] = {
31 {__llvm_libc::memmove, "__llvm_libc::memmove"}};
32 return llvm::ArrayRef(kMemmoveConfigurations);
34 llvm::ArrayRef<MemcmpOrBcmpConfiguration> getMemcmpConfigurations() {
35 static constexpr MemcmpOrBcmpConfiguration kMemcmpConfiguration[] = {
36 {__llvm_libc::memcmp, "__llvm_libc::memcmp"}};
37 return llvm::ArrayRef(kMemcmpConfiguration);
39 llvm::ArrayRef<MemcmpOrBcmpConfiguration> getBcmpConfigurations() {
40 static constexpr MemcmpOrBcmpConfiguration kBcmpConfigurations[] = {
41 {__llvm_libc::bcmp, "__llvm_libc::bcmp"}};
42 return llvm::ArrayRef(kBcmpConfigurations);
44 llvm::ArrayRef<MemsetConfiguration> getMemsetConfigurations() {
45 static constexpr MemsetConfiguration kMemsetConfigurations[] = {
46 {__llvm_libc::memset, "__llvm_libc::memset"}};
47 return llvm::ArrayRef(kMemsetConfigurations);
49 llvm::ArrayRef<BzeroConfiguration> getBzeroConfigurations() {
50 static constexpr BzeroConfiguration kBzeroConfigurations[] = {
51 {__llvm_libc::bzero, "__llvm_libc::bzero"}};
52 return llvm::ArrayRef(kBzeroConfigurations);