xref: /llvm-project/libc/test/src/math/performance_testing/fmul_perf.cpp (revision a205a854e06d36c1d0def3e3bc3743defdb6abc1)
1 //===-- Performance test for the fmul function ----------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #include "BinaryOpSingleOutputPerf.h"
10 #include "src/__support/FPUtil/generic/mul.h"
11 #include "src/math/fmul.h"
12 
13 static constexpr size_t DOUBLE_ROUNDS = 40;
14 
15 float fmul_placeholder_binary(double x, double y) {
16   return LIBC_NAMESPACE::fputil::generic::mul<float>(x, y);
17 }
18 
19 int main() {
20   BINARY_OP_SINGLE_OUTPUT_PERF_EX(float, double, LIBC_NAMESPACE::fmul,
21                                   fmul_placeholder_binary, DOUBLE_ROUNDS,
22                                   "fmul_perf.log")
23   return 0;
24 }
25