diff --git a/libc/test/src/math/performance_testing/CMakeLists.txt b/libc/test/src/math/performance_testing/CMakeLists.txt index 60c074a248f72..f1399663a6cf3 100644 --- a/libc/test/src/math/performance_testing/CMakeLists.txt +++ b/libc/test/src/math/performance_testing/CMakeLists.txt @@ -475,6 +475,18 @@ add_perf_binary( libc.src.math.fminimum_numf16 COMPILE_OPTIONS -fno-builtin + ) + +add_perf_binary( + fadd_perf + SRCS + fadd_perf.cpp + DEPENDS + .binary_op_single_output_diff + libc.src.math.fadd + libc.src.__support.FPUtil.fp_bits + COMPILE_OPTIONS + -fno-builtin ) add_perf_binary( diff --git a/libc/test/src/math/performance_testing/fadd_perf.cpp b/libc/test/src/math/performance_testing/fadd_perf.cpp new file mode 100644 index 0000000000000..a80c27b6068a1 --- /dev/null +++ b/libc/test/src/math/performance_testing/fadd_perf.cpp @@ -0,0 +1,23 @@ +//===-- Performance test for the fadd function ----------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "BinaryOpSingleOutputPerf.h" +#include "src/math/fadd.h" + +static constexpr size_t DOUBLE_ROUNDS = 40; + +float fadd_placeholder_binary(double x, double y) { + return static_cast(x + y); +} + +int main() { + BINARY_OP_SINGLE_OUTPUT_PERF_EX(float, double, LIBC_NAMESPACE::fadd, + fadd_placeholder_binary, DOUBLE_ROUNDS, + "fadd_perf.log") + return 0; +}