xref: /llvm-project/libc/test/src/math/performance_testing/exp10f16_perf.cpp (revision 59338ad8c5154769ec8225db0386956161f99fce)
1*59338ad8SOverMighty //===-- Performance test for exp10f16 -------------------------------------===//
2*59338ad8SOverMighty //
3*59338ad8SOverMighty // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*59338ad8SOverMighty // See https://llvm.org/LICENSE.txt for license information.
5*59338ad8SOverMighty // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*59338ad8SOverMighty //
7*59338ad8SOverMighty //===----------------------------------------------------------------------===//
8*59338ad8SOverMighty 
9*59338ad8SOverMighty #include "SingleInputSingleOutputPerf.h"
10*59338ad8SOverMighty 
11*59338ad8SOverMighty #include "src/math/exp10f16.h"
12*59338ad8SOverMighty 
13*59338ad8SOverMighty // LLVM libc might be the only libc implementation with support for float16 math
14*59338ad8SOverMighty // functions currently. We can't compare our float16 functions against the
15*59338ad8SOverMighty // system libc, so we compare them against this placeholder function.
16*59338ad8SOverMighty static float16 placeholderf16(float16 x) { return x; }
17*59338ad8SOverMighty 
18*59338ad8SOverMighty int main() {
19*59338ad8SOverMighty   SINGLE_INPUT_SINGLE_OUTPUT_PERF_EX(float16, LIBC_NAMESPACE::exp10f16,
20*59338ad8SOverMighty                                      ::placeholderf16, 20'000,
21*59338ad8SOverMighty                                      "exp10f16_perf.log")
22*59338ad8SOverMighty }
23