diff --git a/libc/benchmarks/LibcDefaultImplementations.cpp b/libc/benchmarks/LibcDefaultImplementations.cpp --- a/libc/benchmarks/LibcDefaultImplementations.cpp +++ b/libc/benchmarks/LibcDefaultImplementations.cpp @@ -15,7 +15,7 @@ // List of implementations to test. using llvm::libc_benchmarks::BzeroConfiguration; -using llvm::libc_benchmarks::MemcmpConfiguration; +using llvm::libc_benchmarks::MemcmpOrBcmpConfiguration; using llvm::libc_benchmarks::MemcpyConfiguration; using llvm::libc_benchmarks::MemsetConfiguration; @@ -24,13 +24,13 @@ {__llvm_libc::memcpy, "__llvm_libc::memcpy"}}; return llvm::makeArrayRef(kMemcpyConfigurations); } -llvm::ArrayRef getMemcmpConfigurations() { - static constexpr MemcmpConfiguration kMemcmpConfigurations[] = { +llvm::ArrayRef getMemcmpConfigurations() { + static constexpr MemcmpOrBcmpConfiguration kMemcmpConfiguration[] = { {__llvm_libc::memcmp, "__llvm_libc::memcmp"}}; - return llvm::makeArrayRef(kMemcmpConfigurations); + return llvm::makeArrayRef(kMemcmpConfiguration); } -llvm::ArrayRef getBcmpConfigurations() { - static constexpr MemcmpConfiguration kBcmpConfigurations[] = { +llvm::ArrayRef getBcmpConfigurations() { + static constexpr MemcmpOrBcmpConfiguration kBcmpConfigurations[] = { {__llvm_libc::bcmp, "__llvm_libc::bcmp"}}; return llvm::makeArrayRef(kBcmpConfigurations); } @@ -43,4 +43,4 @@ static constexpr BzeroConfiguration kBzeroConfigurations[] = { {__llvm_libc::bzero, "__llvm_libc::bzero"}}; return llvm::makeArrayRef(kBzeroConfigurations); -} \ No newline at end of file +} diff --git a/libc/benchmarks/LibcFunctionPrototypes.h b/libc/benchmarks/LibcFunctionPrototypes.h --- a/libc/benchmarks/LibcFunctionPrototypes.h +++ b/libc/benchmarks/LibcFunctionPrototypes.h @@ -26,9 +26,9 @@ llvm::StringRef Name; }; -using MemcmpFunction = int (*)(const void *, const void *, size_t); -struct MemcmpConfiguration { - MemcmpFunction Function; +using MemcmpOrBcmpFunction = int (*)(const void *, const void *, size_t); +struct MemcmpOrBcmpConfiguration { + MemcmpOrBcmpFunction Function; llvm::StringRef Name; }; diff --git a/libc/benchmarks/LibcMemoryBenchmark.h b/libc/benchmarks/LibcMemoryBenchmark.h --- a/libc/benchmarks/LibcMemoryBenchmark.h +++ b/libc/benchmarks/LibcMemoryBenchmark.h @@ -238,9 +238,9 @@ return getMemcmpSizeDistributions(); } - inline int Call(ParameterType Parameter, MemcmpFunction Memcmp) { - return Memcmp(LhsBuffer + Parameter.OffsetBytes, - RhsBuffer + Parameter.OffsetBytes, Parameter.SizeBytes); + inline int Call(ParameterType Parameter, MemcmpOrBcmpFunction MemcmpOrBcmp) { + return MemcmpOrBcmp(LhsBuffer + Parameter.OffsetBytes, + RhsBuffer + Parameter.OffsetBytes, Parameter.SizeBytes); } private: diff --git a/libc/benchmarks/LibcMemoryGoogleBenchmarkMain.cpp b/libc/benchmarks/LibcMemoryGoogleBenchmarkMain.cpp --- a/libc/benchmarks/LibcMemoryGoogleBenchmarkMain.cpp +++ b/libc/benchmarks/LibcMemoryGoogleBenchmarkMain.cpp @@ -15,7 +15,7 @@ using llvm::libc_benchmarks::BzeroConfiguration; using llvm::libc_benchmarks::ComparisonSetup; using llvm::libc_benchmarks::CopySetup; -using llvm::libc_benchmarks::MemcmpConfiguration; +using llvm::libc_benchmarks::MemcmpOrBcmpConfiguration; using llvm::libc_benchmarks::MemcpyConfiguration; using llvm::libc_benchmarks::MemorySizeDistribution; using llvm::libc_benchmarks::MemsetConfiguration; @@ -94,12 +94,12 @@ BENCHMARK_MEMORY_FUNCTION(BM_Memcpy, CopySetup, MemcpyConfiguration, getMemcpyConfigurations()); -extern llvm::ArrayRef getMemcmpConfigurations(); -BENCHMARK_MEMORY_FUNCTION(BM_Memcmp, ComparisonSetup, MemcmpConfiguration, +extern llvm::ArrayRef getMemcmpConfigurations(); +BENCHMARK_MEMORY_FUNCTION(BM_Memcmp, ComparisonSetup, MemcmpOrBcmpConfiguration, getMemcmpConfigurations()); -extern llvm::ArrayRef getBcmpConfigurations(); -BENCHMARK_MEMORY_FUNCTION(BM_Bcmp, ComparisonSetup, MemcmpConfiguration, +extern llvm::ArrayRef getBcmpConfigurations(); +BENCHMARK_MEMORY_FUNCTION(BM_Bcmp, ComparisonSetup, MemcmpOrBcmpConfiguration, getBcmpConfigurations()); extern llvm::ArrayRef getMemsetConfigurations();