[libc-commits] [libc] d99bb01 - [libc][NFC] Clean up test/src/math/differential_testing folder, renaming it to performance_testing. (#84646)
via libc-commits
libc-commits at lists.llvm.org
Mon Mar 11 08:38:43 PDT 2024
Author: lntue
Date: 2024-03-11T11:38:39-04:00
New Revision: d99bb01422a984e50043588a6bfafd2c6ce0b7e7
URL: https://github.com/llvm/llvm-project/commit/d99bb01422a984e50043588a6bfafd2c6ce0b7e7
DIFF: https://github.com/llvm/llvm-project/commit/d99bb01422a984e50043588a6bfafd2c6ce0b7e7.diff
LOG: [libc][NFC] Clean up test/src/math/differential_testing folder, renaming it to performance_testing. (#84646)
Removing all the diff tests.
Added:
libc/test/src/math/performance_testing/BinaryOpSingleOutputPerf.h
libc/test/src/math/performance_testing/CMakeLists.txt
libc/test/src/math/performance_testing/SingleInputSingleOutputPerf.h
libc/test/src/math/performance_testing/Timer.cpp
libc/test/src/math/performance_testing/Timer.h
libc/test/src/math/performance_testing/ceilf_perf.cpp
libc/test/src/math/performance_testing/cosf_perf.cpp
libc/test/src/math/performance_testing/exp2f_perf.cpp
libc/test/src/math/performance_testing/expf_perf.cpp
libc/test/src/math/performance_testing/expm1f_perf.cpp
libc/test/src/math/performance_testing/fabsf_perf.cpp
libc/test/src/math/performance_testing/floorf_perf.cpp
libc/test/src/math/performance_testing/fmod_perf.cpp
libc/test/src/math/performance_testing/fmodf_perf.cpp
libc/test/src/math/performance_testing/hypot_perf.cpp
libc/test/src/math/performance_testing/hypotf_perf.cpp
libc/test/src/math/performance_testing/log10f_perf.cpp
libc/test/src/math/performance_testing/log1pf_perf.cpp
libc/test/src/math/performance_testing/log2f_perf.cpp
libc/test/src/math/performance_testing/logbf_perf.cpp
libc/test/src/math/performance_testing/logf_perf.cpp
libc/test/src/math/performance_testing/nearbyintf_perf.cpp
libc/test/src/math/performance_testing/rintf_perf.cpp
libc/test/src/math/performance_testing/roundf_perf.cpp
libc/test/src/math/performance_testing/sinf_perf.cpp
libc/test/src/math/performance_testing/sqrtf_perf.cpp
libc/test/src/math/performance_testing/truncf_perf.cpp
Modified:
libc/docs/math/index.rst
libc/src/math/docs/add_math_function.md
libc/test/src/math/CMakeLists.txt
Removed:
libc/test/src/math/differential_testing/BinaryOpSingleOutputDiff.h
libc/test/src/math/differential_testing/CMakeLists.txt
libc/test/src/math/differential_testing/SingleInputSingleOutputDiff.h
libc/test/src/math/differential_testing/Timer.cpp
libc/test/src/math/differential_testing/Timer.h
libc/test/src/math/differential_testing/ceilf_diff.cpp
libc/test/src/math/differential_testing/ceilf_perf.cpp
libc/test/src/math/differential_testing/cosf_diff.cpp
libc/test/src/math/differential_testing/cosf_perf.cpp
libc/test/src/math/differential_testing/exp2f_diff.cpp
libc/test/src/math/differential_testing/exp2f_perf.cpp
libc/test/src/math/differential_testing/expf_diff.cpp
libc/test/src/math/differential_testing/expf_perf.cpp
libc/test/src/math/differential_testing/expm1f_diff.cpp
libc/test/src/math/differential_testing/expm1f_perf.cpp
libc/test/src/math/differential_testing/fabsf_diff.cpp
libc/test/src/math/differential_testing/fabsf_perf.cpp
libc/test/src/math/differential_testing/floorf_diff.cpp
libc/test/src/math/differential_testing/floorf_perf.cpp
libc/test/src/math/differential_testing/fmod_diff.cpp
libc/test/src/math/differential_testing/fmod_perf.cpp
libc/test/src/math/differential_testing/fmodf_diff.cpp
libc/test/src/math/differential_testing/fmodf_perf.cpp
libc/test/src/math/differential_testing/hypot_diff.cpp
libc/test/src/math/differential_testing/hypot_perf.cpp
libc/test/src/math/differential_testing/hypotf_diff.cpp
libc/test/src/math/differential_testing/hypotf_perf.cpp
libc/test/src/math/differential_testing/log10f_perf.cpp
libc/test/src/math/differential_testing/log1pf_perf.cpp
libc/test/src/math/differential_testing/log2f_diff.cpp
libc/test/src/math/differential_testing/log2f_perf.cpp
libc/test/src/math/differential_testing/logbf_diff.cpp
libc/test/src/math/differential_testing/logbf_perf.cpp
libc/test/src/math/differential_testing/logf_diff.cpp
libc/test/src/math/differential_testing/logf_perf.cpp
libc/test/src/math/differential_testing/nearbyintf_diff.cpp
libc/test/src/math/differential_testing/nearbyintf_perf.cpp
libc/test/src/math/differential_testing/rintf_diff.cpp
libc/test/src/math/differential_testing/rintf_perf.cpp
libc/test/src/math/differential_testing/roundf_diff.cpp
libc/test/src/math/differential_testing/roundf_perf.cpp
libc/test/src/math/differential_testing/sinf_diff.cpp
libc/test/src/math/differential_testing/sinf_perf.cpp
libc/test/src/math/differential_testing/sqrtf_diff.cpp
libc/test/src/math/differential_testing/sqrtf_perf.cpp
libc/test/src/math/differential_testing/truncf_diff.cpp
libc/test/src/math/differential_testing/truncf_perf.cpp
################################################################################
diff --git a/libc/docs/math/index.rst b/libc/docs/math/index.rst
index 7f2a1b2f3e2824..b22ed5127c179e 100644
--- a/libc/docs/math/index.rst
+++ b/libc/docs/math/index.rst
@@ -567,13 +567,13 @@ Legends:
Performance
===========
-* Simple performance testings are located at: `libc/test/src/math/
diff erential_testing <https://github.com/llvm/llvm-project/tree/main/libc/test/src/math/
diff erential_testing>`_.
+* Simple performance testings are located at: `libc/test/src/math/performance_testing <https://github.com/llvm/llvm-project/tree/main/libc/test/src/math/performance_testing>`_.
* We also use the *perf* tool from the `CORE-MATH <https://core-math.gitlabpages.inria.fr/>`_
project: `link <https://gitlab.inria.fr/core-math/core-math/-/tree/master>`_.
The performance results from the CORE-MATH's perf tool are reported in the
table below, using the system library as reference (such as the `GNU C library <https://www.gnu.org/software/libc/>`_
- on Linux). Fmod performance results obtained with "
diff erential_testing".
+ on Linux). Fmod performance results obtained with "performance_testing".
+--------------+-------------------------------+-------------------------------+-------------------------------------+----------------------------------------------------------------------+
| <Func> | Reciprocal throughput (clk) | Latency (clk) | Testing ranges | Testing configuration |
diff --git a/libc/src/math/docs/add_math_function.md b/libc/src/math/docs/add_math_function.md
index 6f08bf037c578e..f8bc8a3bdd8b1d 100644
--- a/libc/src/math/docs/add_math_function.md
+++ b/libc/src/math/docs/add_math_function.md
@@ -129,11 +129,11 @@ implementation (which is very often glibc).
- Add a performance test to:
```
- libc/test/src/math/
diff erential_testing/<func>_perf.cpp
+ libc/test/src/math/performance_testing/<func>_perf.cpp
```
- Add the corresponding entry point to:
```
- libc/test/src/math/
diff erential_testing/CMakeLists.txt
+ libc/test/src/math/performance_testing/CMakeLists.txt
```
## Build and Run
@@ -189,8 +189,8 @@ implementation (which is very often glibc).
- Build and Run performance test:
```
- $ ninja libc.test.src.math.
diff erential_testing.<func>_perf
- $ projects/libc/test/src/math/
diff erential_testing/libc.test.src.math.
diff erential_testing.<func>_perf
+ $ ninja libc.test.src.math.performance_testing.<func>_perf
+ $ projects/libc/test/src/math/performance_testing/libc.test.src.math.performance_testing.<func>_perf
$ cat <func>_perf.log
```
diff --git a/libc/test/src/math/CMakeLists.txt b/libc/test/src/math/CMakeLists.txt
index ad7dfdb3dfd9ec..b8a4aafcd97aa2 100644
--- a/libc/test/src/math/CMakeLists.txt
+++ b/libc/test/src/math/CMakeLists.txt
@@ -1721,5 +1721,5 @@ add_subdirectory(smoke)
if(NOT LLVM_LIBC_FULL_BUILD)
add_subdirectory(exhaustive)
- add_subdirectory(
diff erential_testing)
+ add_subdirectory(performance_testing)
endif()
diff --git a/libc/test/src/math/
diff erential_testing/ceilf_
diff .cpp b/libc/test/src/math/
diff erential_testing/ceilf_
diff .cpp
deleted file mode 100644
index 7c0bb1e95a03fd..00000000000000
--- a/libc/test/src/math/
diff erential_testing/ceilf_
diff .cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-//===-- Differential test for ceilf----------------------------------------===//
-//
-// 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 "SingleInputSingleOutputDiff.h"
-
-#include "src/math/ceilf.h"
-
-#include <math.h>
-
-SINGLE_INPUT_SINGLE_OUTPUT_DIFF(float, LIBC_NAMESPACE::ceilf, ::ceilf,
- "ceilf_
diff .log")
diff --git a/libc/test/src/math/
diff erential_testing/cosf_
diff .cpp b/libc/test/src/math/
diff erential_testing/cosf_
diff .cpp
deleted file mode 100644
index ee3102384a8e6b..00000000000000
--- a/libc/test/src/math/
diff erential_testing/cosf_
diff .cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-//===-- Differential test for cosf ----------------------------------------===//
-//
-// 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 "SingleInputSingleOutputDiff.h"
-
-#include "src/math/cosf.h"
-
-#include <math.h>
-
-SINGLE_INPUT_SINGLE_OUTPUT_DIFF(float, LIBC_NAMESPACE::cosf, ::cosf,
- "cosf_
diff .log")
diff --git a/libc/test/src/math/
diff erential_testing/exp2f_
diff .cpp b/libc/test/src/math/
diff erential_testing/exp2f_
diff .cpp
deleted file mode 100644
index 545c6de320fc7c..00000000000000
--- a/libc/test/src/math/
diff erential_testing/exp2f_
diff .cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-//===-- Differential test for exp2f----------------------------------------===//
-//
-// 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 "SingleInputSingleOutputDiff.h"
-
-#include "src/math/exp2f.h"
-
-#include <math.h>
-
-SINGLE_INPUT_SINGLE_OUTPUT_DIFF(float, LIBC_NAMESPACE::exp2f, ::exp2f,
- "exp2f_
diff .log")
diff --git a/libc/test/src/math/
diff erential_testing/expf_
diff .cpp b/libc/test/src/math/
diff erential_testing/expf_
diff .cpp
deleted file mode 100644
index 7c2e90744bc915..00000000000000
--- a/libc/test/src/math/
diff erential_testing/expf_
diff .cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-//===-- Differential test for expf ----------------------------------------===//
-//
-// 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 "SingleInputSingleOutputDiff.h"
-
-#include "src/math/expf.h"
-
-#include <math.h>
-
-SINGLE_INPUT_SINGLE_OUTPUT_DIFF(float, LIBC_NAMESPACE::expf, ::expf,
- "expf_
diff .log")
diff --git a/libc/test/src/math/
diff erential_testing/expm1f_
diff .cpp b/libc/test/src/math/
diff erential_testing/expm1f_
diff .cpp
deleted file mode 100644
index 3cbd8a99690fb4..00000000000000
--- a/libc/test/src/math/
diff erential_testing/expm1f_
diff .cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-//===-- Differential test for expm1f --------------------------------------===//
-//
-// 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 "SingleInputSingleOutputDiff.h"
-
-#include "src/math/expm1f.h"
-
-#include <math.h>
-
-SINGLE_INPUT_SINGLE_OUTPUT_DIFF(float, LIBC_NAMESPACE::expm1f, ::expm1f,
- "expm1f_
diff .log")
diff --git a/libc/test/src/math/
diff erential_testing/fabsf_
diff .cpp b/libc/test/src/math/
diff erential_testing/fabsf_
diff .cpp
deleted file mode 100644
index 9bf9eff888fb51..00000000000000
--- a/libc/test/src/math/
diff erential_testing/fabsf_
diff .cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-//===-- Differential test for fabsf----------------------------------------===//
-//
-// 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 "SingleInputSingleOutputDiff.h"
-
-#include "src/math/fabsf.h"
-
-#include <math.h>
-
-SINGLE_INPUT_SINGLE_OUTPUT_DIFF(float, LIBC_NAMESPACE::fabsf, ::fabsf,
- "fabsf_
diff .log")
diff --git a/libc/test/src/math/
diff erential_testing/floorf_
diff .cpp b/libc/test/src/math/
diff erential_testing/floorf_
diff .cpp
deleted file mode 100644
index 6d72927b5010c5..00000000000000
--- a/libc/test/src/math/
diff erential_testing/floorf_
diff .cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-//===-- Differential test for floorf---------------------------------------===//
-//
-// 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 "SingleInputSingleOutputDiff.h"
-
-#include "src/math/floorf.h"
-
-#include <math.h>
-
-SINGLE_INPUT_SINGLE_OUTPUT_DIFF(float, LIBC_NAMESPACE::floorf, ::floorf,
- "floorf_
diff .log")
diff --git a/libc/test/src/math/
diff erential_testing/fmod_
diff .cpp b/libc/test/src/math/
diff erential_testing/fmod_
diff .cpp
deleted file mode 100644
index 026e529c6cae2a..00000000000000
--- a/libc/test/src/math/
diff erential_testing/fmod_
diff .cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-//===-- Differential test for fmod ----------------------------------------===//
-//
-// 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 "BinaryOpSingleOutputDiff.h"
-
-#include "src/math/fmod.h"
-
-#include <math.h>
-
-BINARY_OP_SINGLE_OUTPUT_DIFF(double, LIBC_NAMESPACE::fmod, ::fmod,
- "fmod_
diff .log")
diff --git a/libc/test/src/math/
diff erential_testing/fmodf_
diff .cpp b/libc/test/src/math/
diff erential_testing/fmodf_
diff .cpp
deleted file mode 100644
index 7029b1ee42cd0e..00000000000000
--- a/libc/test/src/math/
diff erential_testing/fmodf_
diff .cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-//===-- Differential test for fmodf ---------------------------------------===//
-//
-// 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 "BinaryOpSingleOutputDiff.h"
-
-#include "src/math/fmodf.h"
-
-#include <math.h>
-
-BINARY_OP_SINGLE_OUTPUT_DIFF(float, LIBC_NAMESPACE::fmodf, ::fmodf,
- "fmodf_
diff .log")
diff --git a/libc/test/src/math/
diff erential_testing/hypot_
diff .cpp b/libc/test/src/math/
diff erential_testing/hypot_
diff .cpp
deleted file mode 100644
index c61e589bdb2dff..00000000000000
--- a/libc/test/src/math/
diff erential_testing/hypot_
diff .cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-//===-- Differential test for hypot ---------------------------------------===//
-//
-// 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 "BinaryOpSingleOutputDiff.h"
-
-#include "src/math/hypot.h"
-
-#include <math.h>
-
-BINARY_OP_SINGLE_OUTPUT_DIFF(double, LIBC_NAMESPACE::hypot, ::hypot,
- "hypot_
diff .log")
diff --git a/libc/test/src/math/
diff erential_testing/hypotf_
diff .cpp b/libc/test/src/math/
diff erential_testing/hypotf_
diff .cpp
deleted file mode 100644
index d1c70fc2b6edbd..00000000000000
--- a/libc/test/src/math/
diff erential_testing/hypotf_
diff .cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-//===-- Differential test for hypotf --------------------------------------===//
-//
-// 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 "BinaryOpSingleOutputDiff.h"
-
-#include "src/math/hypotf.h"
-
-#include <math.h>
-
-BINARY_OP_SINGLE_OUTPUT_DIFF(float, LIBC_NAMESPACE::hypotf, ::hypotf,
- "hypotf_
diff .log")
diff --git a/libc/test/src/math/
diff erential_testing/log2f_
diff .cpp b/libc/test/src/math/
diff erential_testing/log2f_
diff .cpp
deleted file mode 100644
index aef431dce48701..00000000000000
--- a/libc/test/src/math/
diff erential_testing/log2f_
diff .cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-//===-- Differential test for log2f ---------------------------------------===//
-//
-// 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 "SingleInputSingleOutputDiff.h"
-
-#include "src/math/log2f.h"
-
-#include <math.h>
-
-SINGLE_INPUT_SINGLE_OUTPUT_DIFF(float, LIBC_NAMESPACE::log2f, ::log2f,
- "log2f_
diff .log")
diff --git a/libc/test/src/math/
diff erential_testing/logbf_
diff .cpp b/libc/test/src/math/
diff erential_testing/logbf_
diff .cpp
deleted file mode 100644
index 37441eb40a4dfa..00000000000000
--- a/libc/test/src/math/
diff erential_testing/logbf_
diff .cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-//===-- Differential test for logbf----------------------------------------===//
-//
-// 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 "SingleInputSingleOutputDiff.h"
-
-#include "src/math/logbf.h"
-
-#include <math.h>
-
-SINGLE_INPUT_SINGLE_OUTPUT_DIFF(float, LIBC_NAMESPACE::logbf, ::logbf,
- "logbf_
diff .log")
diff --git a/libc/test/src/math/
diff erential_testing/logf_
diff .cpp b/libc/test/src/math/
diff erential_testing/logf_
diff .cpp
deleted file mode 100644
index 4ed1307f712081..00000000000000
--- a/libc/test/src/math/
diff erential_testing/logf_
diff .cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-//===-- Differential test for logf ----------------------------------------===//
-//
-// 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 "SingleInputSingleOutputDiff.h"
-
-#include "src/math/logf.h"
-
-#include <math.h>
-
-SINGLE_INPUT_SINGLE_OUTPUT_DIFF(float, LIBC_NAMESPACE::logf, ::logf,
- "logf_
diff .log")
diff --git a/libc/test/src/math/
diff erential_testing/nearbyintf_
diff .cpp b/libc/test/src/math/
diff erential_testing/nearbyintf_
diff .cpp
deleted file mode 100644
index 14200116883db4..00000000000000
--- a/libc/test/src/math/
diff erential_testing/nearbyintf_
diff .cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-//===-- Differential test for nearbyintf-----------------------------------===//
-//
-// 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 "SingleInputSingleOutputDiff.h"
-
-#include "src/math/nearbyintf.h"
-
-#include <math.h>
-
-SINGLE_INPUT_SINGLE_OUTPUT_DIFF(float, LIBC_NAMESPACE::nearbyintf, ::nearbyintf,
- "nearbyintf_
diff .log")
diff --git a/libc/test/src/math/
diff erential_testing/rintf_
diff .cpp b/libc/test/src/math/
diff erential_testing/rintf_
diff .cpp
deleted file mode 100644
index e60f66085e5d70..00000000000000
--- a/libc/test/src/math/
diff erential_testing/rintf_
diff .cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-//===-- Differential test for rintf----------------------------------------===//
-//
-// 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 "SingleInputSingleOutputDiff.h"
-
-#include "src/math/rintf.h"
-
-#include <math.h>
-
-SINGLE_INPUT_SINGLE_OUTPUT_DIFF(float, LIBC_NAMESPACE::rintf, ::rintf,
- "rintf_
diff .log")
diff --git a/libc/test/src/math/
diff erential_testing/roundf_
diff .cpp b/libc/test/src/math/
diff erential_testing/roundf_
diff .cpp
deleted file mode 100644
index e1401a01af3574..00000000000000
--- a/libc/test/src/math/
diff erential_testing/roundf_
diff .cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-//===-- Differential test for roundf---------------------------------------===//
-//
-// 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 "SingleInputSingleOutputDiff.h"
-
-#include "src/math/roundf.h"
-
-#include <math.h>
-
-SINGLE_INPUT_SINGLE_OUTPUT_DIFF(float, LIBC_NAMESPACE::roundf, ::roundf,
- "roundf_
diff .log")
diff --git a/libc/test/src/math/
diff erential_testing/sinf_
diff .cpp b/libc/test/src/math/
diff erential_testing/sinf_
diff .cpp
deleted file mode 100644
index cb4557e6796b55..00000000000000
--- a/libc/test/src/math/
diff erential_testing/sinf_
diff .cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-//===-- Differential test for sinf ----------------------------------------===//
-//
-// 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 "SingleInputSingleOutputDiff.h"
-
-#include "src/math/sinf.h"
-
-#include <math.h>
-
-SINGLE_INPUT_SINGLE_OUTPUT_DIFF(float, LIBC_NAMESPACE::sinf, ::sinf,
- "sinf_
diff .log")
diff --git a/libc/test/src/math/
diff erential_testing/sqrtf_
diff .cpp b/libc/test/src/math/
diff erential_testing/sqrtf_
diff .cpp
deleted file mode 100644
index 22ddeaac9caf99..00000000000000
--- a/libc/test/src/math/
diff erential_testing/sqrtf_
diff .cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-//===-- Differential test for sqrtf----------------------------------------===//
-//
-// 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 "SingleInputSingleOutputDiff.h"
-
-#include "src/math/sqrtf.h"
-
-#include <math.h>
-
-SINGLE_INPUT_SINGLE_OUTPUT_DIFF(float, LIBC_NAMESPACE::sqrtf, ::sqrtf,
- "sqrtf_
diff .log")
diff --git a/libc/test/src/math/
diff erential_testing/truncf_
diff .cpp b/libc/test/src/math/
diff erential_testing/truncf_
diff .cpp
deleted file mode 100644
index 7f6ac4e6a92694..00000000000000
--- a/libc/test/src/math/
diff erential_testing/truncf_
diff .cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-//===-- Differential test for truncf---------------------------------------===//
-//
-// 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 "SingleInputSingleOutputDiff.h"
-
-#include "src/math/truncf.h"
-
-#include <math.h>
-
-SINGLE_INPUT_SINGLE_OUTPUT_DIFF(float, LIBC_NAMESPACE::truncf, ::truncf,
- "truncf_
diff .log")
diff --git a/libc/test/src/math/
diff erential_testing/BinaryOpSingleOutputDiff.h b/libc/test/src/math/performance_testing/BinaryOpSingleOutputPerf.h
similarity index 70%
rename from libc/test/src/math/
diff erential_testing/BinaryOpSingleOutputDiff.h
rename to libc/test/src/math/performance_testing/BinaryOpSingleOutputPerf.h
index 48572e78e5153e..68d37b46b77c73 100644
--- a/libc/test/src/math/
diff erential_testing/BinaryOpSingleOutputDiff.h
+++ b/libc/test/src/math/performance_testing/BinaryOpSingleOutputPerf.h
@@ -7,14 +7,14 @@
//===----------------------------------------------------------------------===//
#include "src/__support/FPUtil/FPBits.h"
-#include "test/src/math/
diff erential_testing/Timer.h"
+#include "test/src/math/performance_testing/Timer.h"
#include <fstream>
namespace LIBC_NAMESPACE {
namespace testing {
-template <typename T> class BinaryOpSingleOutputDiff {
+template <typename T> class BinaryOpSingleOutputPerf {
using FPBits = fputil::FPBits<T>;
using StorageType = typename FPBits::StorageType;
static constexpr StorageType UIntMax =
@@ -23,40 +23,6 @@ template <typename T> class BinaryOpSingleOutputDiff {
public:
typedef T Func(T, T);
- static uint64_t run_
diff _in_range(Func myFunc, Func otherFunc,
- StorageType startingBit,
- StorageType endingBit, StorageType N,
- std::ofstream &log) {
- uint64_t result = 0;
- if (endingBit < startingBit) {
- return result;
- }
-
- StorageType step = (endingBit - startingBit) / N;
- for (StorageType bitsX = startingBit, bitsY = endingBit;;
- bitsX += step, bitsY -= step) {
- T x = T(FPBits(bitsX));
- T y = T(FPBits(bitsY));
- FPBits myBits = FPBits(myFunc(x, y));
- FPBits otherBits = FPBits(otherFunc(x, y));
- if (myBits.uintval() != otherBits.uintval()) {
- result++;
- log << " Input: " << bitsX << ", " << bitsY << " (" << x << ", "
- << y << ")\n"
- << " My result: " << myBits.uintval() << " (" << myBits.get_val()
- << ")\n"
- << "Other result: " << otherBits.uintval() << " ("
- << otherBits.get_val() << ")\n"
- << '\n';
- }
-
- if (endingBit - bitsX < step) {
- break;
- }
- }
- return result;
- }
-
static void run_perf_in_range(Func myFunc, Func otherFunc,
StorageType startingBit, StorageType endingBit,
StorageType N, std::ofstream &log) {
@@ -69,8 +35,8 @@ template <typename T> class BinaryOpSingleOutputDiff {
StorageType step = (endingBit - startingBit) / N;
for (StorageType bitsX = startingBit, bitsY = endingBit;;
bitsX += step, bitsY -= step) {
- T x = T(FPBits(bitsX));
- T y = T(FPBits(bitsY));
+ T x = FPBits(bitsX).get_val();
+ T y = FPBits(bitsY).get_val();
result = func(x, y);
if (endingBit - bitsX < step) {
break;
@@ -110,12 +76,12 @@ template <typename T> class BinaryOpSingleOutputDiff {
log << " Performance tests with inputs in denormal range:\n";
run_perf_in_range(myFunc, otherFunc, /* startingBit= */ StorageType(0),
/* endingBit= */ FPBits::max_subnormal().uintval(),
- 1'000'001, log);
+ 10'000'001, log);
log << "\n Performance tests with inputs in normal range:\n";
run_perf_in_range(myFunc, otherFunc,
/* startingBit= */ FPBits::min_normal().uintval(),
/* endingBit= */ FPBits::max_normal().uintval(),
- 100'000'001, log);
+ 10'000'001, log);
log << "\n Performance tests with inputs in normal range with exponents "
"close to each other:\n";
run_perf_in_range(
@@ -148,16 +114,9 @@ template <typename T> class BinaryOpSingleOutputDiff {
} // namespace testing
} // namespace LIBC_NAMESPACE
-#define BINARY_OP_SINGLE_OUTPUT_DIFF(T, myFunc, otherFunc, filename) \
- int main() { \
- LIBC_NAMESPACE::testing::BinaryOpSingleOutputDiff<T>::run_
diff ( \
- &myFunc, &otherFunc, filename); \
- return 0; \
- }
-
#define BINARY_OP_SINGLE_OUTPUT_PERF(T, myFunc, otherFunc, filename) \
int main() { \
- LIBC_NAMESPACE::testing::BinaryOpSingleOutputDiff<T>::run_perf( \
+ LIBC_NAMESPACE::testing::BinaryOpSingleOutputPerf<T>::run_perf( \
&myFunc, &otherFunc, filename); \
return 0; \
}
diff --git a/libc/test/src/math/
diff erential_testing/CMakeLists.txt b/libc/test/src/math/performance_testing/CMakeLists.txt
similarity index 56%
rename from libc/test/src/math/
diff erential_testing/CMakeLists.txt
rename to libc/test/src/math/performance_testing/CMakeLists.txt
index 878f81f1d573c8..d20c2eb303a7cc 100644
--- a/libc/test/src/math/
diff erential_testing/CMakeLists.txt
+++ b/libc/test/src/math/performance_testing/CMakeLists.txt
@@ -4,28 +4,28 @@ add_library(
Timer.h
)
-# A convenience target to build all
diff erential tests.
-add_custom_target(libc-math-
diff erential-tests)
+# A convenience target to build all performance tests.
+add_custom_target(libc-math-performance-tests)
-function(add_
diff _binary target_name)
+function(add_perf_binary target_name)
cmake_parse_arguments(
- "DIFF"
+ "PERF"
"" # No optional arguments
"SUITE;CXX_STANDARD" # Single value arguments
"SRCS;HDRS;DEPENDS;COMPILE_OPTIONS" # Multi-value arguments
${ARGN}
)
- if(NOT DIFF_SRCS)
- message(FATAL_ERROR "'add_
diff _binary' target requires a SRCS list of .cpp "
+ if(NOT PERF_SRCS)
+ message(FATAL_ERROR "'add_perf_binary' target requires a SRCS list of .cpp "
"files.")
endif()
- if(NOT DIFF_DEPENDS)
- message(FATAL_ERROR "'add_
diff _binary' target requires a DEPENDS list of "
+ if(NOT PERF_DEPENDS)
+ message(FATAL_ERROR "'add_perf_binary' target requires a DEPENDS list of "
"'add_entrypoint_object' targets.")
endif()
get_fq_target_name(${target_name} fq_target_name)
- get_fq_deps_list(fq_deps_list ${DIFF_DEPENDS})
+ get_fq_deps_list(fq_deps_list ${PERF_DEPENDS})
get_object_files_for_test(
link_object_files skipped_entrypoints_list ${fq_deps_list})
if(skipped_entrypoints_list)
@@ -40,18 +40,18 @@ function(add_
diff _binary target_name)
add_executable(
${fq_target_name}
EXCLUDE_FROM_ALL
- ${DIFF_SRCS}
- ${DIFF_HDRS}
+ ${PERF_SRCS}
+ ${PERF_HDRS}
)
target_include_directories(
${fq_target_name}
PRIVATE
${LIBC_SOURCE_DIR}
)
- if(DIFF_COMPILE_OPTIONS)
+ if(PERF_COMPILE_OPTIONS)
target_compile_options(
${fq_target_name}
- PRIVATE ${DIFF_COMPILE_OPTIONS}
+ PRIVATE ${PERF_COMPILE_OPTIONS}
)
endif()
@@ -62,11 +62,11 @@ function(add_
diff _binary target_name)
set_target_properties(${fq_target_name}
PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
- if(DIFF_CXX_STANDARD)
+ if(PERF_CXX_STANDARD)
set_target_properties(
${fq_target_name}
PROPERTIES
- CXX_STANDARD ${DIFF_CXX_STANDARD}
+ CXX_STANDARD ${PERF_CXX_STANDARD}
)
endif()
@@ -75,31 +75,22 @@ function(add_
diff _binary target_name)
libc.src.__support.FPUtil.fp_bits
${fq_deps_list}
)
- add_dependencies(libc-math-
diff erential-tests ${fq_target_name})
+ add_dependencies(libc-math-performance-tests ${fq_target_name})
endfunction()
add_header_library(
single_input_single_output_
diff
HDRS
- SingleInputSingleOutputDiff.h
+ SingleInputSingleOutputPerf.h
)
add_header_library(
binary_op_single_output_
diff
HDRS
- BinaryOpSingleOutputDiff.h
+ BinaryOpSingleOutputPerf.h
)
-add_
diff _binary(
- sinf_
diff
- SRCS
- sinf_
diff .cpp
- DEPENDS
- .single_input_single_output_
diff
- libc.src.math.sinf
-)
-
-add_
diff _binary(
+add_perf_binary(
sinf_perf
SRCS
sinf_perf.cpp
@@ -110,16 +101,7 @@ add_
diff _binary(
-fno-builtin
)
-add_
diff _binary(
- cosf_
diff
- SRCS
- cosf_
diff .cpp
- DEPENDS
- .single_input_single_output_
diff
- libc.src.math.cosf
-)
-
-add_
diff _binary(
+add_perf_binary(
cosf_perf
SRCS
cosf_perf.cpp
@@ -130,16 +112,7 @@ add_
diff _binary(
-fno-builtin
)
-add_
diff _binary(
- expm1f_
diff
- SRCS
- expm1f_
diff .cpp
- DEPENDS
- .single_input_single_output_
diff
- libc.src.math.expm1f
-)
-
-add_
diff _binary(
+add_perf_binary(
expm1f_perf
SRCS
expm1f_perf.cpp
@@ -150,16 +123,7 @@ add_
diff _binary(
-fno-builtin
)
-add_
diff _binary(
- ceilf_
diff
- SRCS
- ceilf_
diff .cpp
- DEPENDS
- .single_input_single_output_
diff
- libc.src.math.ceilf
-)
-
-add_
diff _binary(
+add_perf_binary(
ceilf_perf
SRCS
ceilf_perf.cpp
@@ -170,16 +134,7 @@ add_
diff _binary(
-fno-builtin
)
-add_
diff _binary(
- exp2f_
diff
- SRCS
- exp2f_
diff .cpp
- DEPENDS
- .single_input_single_output_
diff
- libc.src.math.exp2f
-)
-
-add_
diff _binary(
+add_perf_binary(
exp2f_perf
SRCS
exp2f_perf.cpp
@@ -190,16 +145,7 @@ add_
diff _binary(
-fno-builtin
)
-add_
diff _binary(
- expf_
diff
- SRCS
- expf_
diff .cpp
- DEPENDS
- .single_input_single_output_
diff
- libc.src.math.expf
-)
-
-add_
diff _binary(
+add_perf_binary(
expf_perf
SRCS
expf_perf.cpp
@@ -210,16 +156,7 @@ add_
diff _binary(
-fno-builtin
)
-add_
diff _binary(
- fabsf_
diff
- SRCS
- fabsf_
diff .cpp
- DEPENDS
- .single_input_single_output_
diff
- libc.src.math.fabsf
-)
-
-add_
diff _binary(
+add_perf_binary(
fabsf_perf
SRCS
fabsf_perf.cpp
@@ -230,16 +167,7 @@ add_
diff _binary(
-fno-builtin
)
-add_
diff _binary(
- floorf_
diff
- SRCS
- floorf_
diff .cpp
- DEPENDS
- .single_input_single_output_
diff
- libc.src.math.floorf
-)
-
-add_
diff _binary(
+add_perf_binary(
floorf_perf
SRCS
floorf_perf.cpp
@@ -250,7 +178,7 @@ add_
diff _binary(
-fno-builtin
)
-add_
diff _binary(
+add_perf_binary(
log10f_perf
SRCS
log10f_perf.cpp
@@ -261,7 +189,7 @@ add_
diff _binary(
-fno-builtin
)
-add_
diff _binary(
+add_perf_binary(
log1pf_perf
SRCS
log1pf_perf.cpp
@@ -272,18 +200,7 @@ add_
diff _binary(
-fno-builtin
)
-add_
diff _binary(
- log2f_
diff
- SRCS
- log2f_
diff .cpp
- DEPENDS
- .single_input_single_output_
diff
- libc.src.math.log2f
- COMPILE_OPTIONS
- -fno-builtin
-)
-
-add_
diff _binary(
+add_perf_binary(
log2f_perf
SRCS
log2f_perf.cpp
@@ -294,18 +211,7 @@ add_
diff _binary(
-fno-builtin
)
-add_
diff _binary(
- logf_
diff
- SRCS
- logf_
diff .cpp
- DEPENDS
- .single_input_single_output_
diff
- libc.src.math.logf
- COMPILE_OPTIONS
- -fno-builtin
-)
-
-add_
diff _binary(
+add_perf_binary(
logf_perf
SRCS
logf_perf.cpp
@@ -316,16 +222,7 @@ add_
diff _binary(
-fno-builtin
)
-add_
diff _binary(
- logbf_
diff
- SRCS
- logbf_
diff .cpp
- DEPENDS
- .single_input_single_output_
diff
- libc.src.math.logbf
-)
-
-add_
diff _binary(
+add_perf_binary(
logbf_perf
SRCS
logbf_perf.cpp
@@ -336,16 +233,7 @@ add_
diff _binary(
-fno-builtin
)
-add_
diff _binary(
- nearbyintf_
diff
- SRCS
- nearbyintf_
diff .cpp
- DEPENDS
- .single_input_single_output_
diff
- libc.src.math.nearbyintf
-)
-
-add_
diff _binary(
+add_perf_binary(
nearbyintf_perf
SRCS
nearbyintf_perf.cpp
@@ -356,16 +244,7 @@ add_
diff _binary(
-fno-builtin
)
-add_
diff _binary(
- rintf_
diff
- SRCS
- rintf_
diff .cpp
- DEPENDS
- .single_input_single_output_
diff
- libc.src.math.rintf
-)
-
-add_
diff _binary(
+add_perf_binary(
rintf_perf
SRCS
rintf_perf.cpp
@@ -376,16 +255,7 @@ add_
diff _binary(
-fno-builtin
)
-add_
diff _binary(
- roundf_
diff
- SRCS
- roundf_
diff .cpp
- DEPENDS
- .single_input_single_output_
diff
- libc.src.math.roundf
-)
-
-add_
diff _binary(
+add_perf_binary(
roundf_perf
SRCS
roundf_perf.cpp
@@ -396,16 +266,7 @@ add_
diff _binary(
-fno-builtin
)
-add_
diff _binary(
- sqrtf_
diff
- SRCS
- sqrtf_
diff .cpp
- DEPENDS
- .single_input_single_output_
diff
- libc.src.math.sqrtf
-)
-
-add_
diff _binary(
+add_perf_binary(
sqrtf_perf
SRCS
sqrtf_perf.cpp
@@ -416,16 +277,7 @@ add_
diff _binary(
-fno-builtin
)
-add_
diff _binary(
- truncf_
diff
- SRCS
- truncf_
diff .cpp
- DEPENDS
- .single_input_single_output_
diff
- libc.src.math.truncf
-)
-
-add_
diff _binary(
+add_perf_binary(
truncf_perf
SRCS
truncf_perf.cpp
@@ -436,18 +288,7 @@ add_
diff _binary(
-fno-builtin
)
-add_
diff _binary(
- hypotf_
diff
- SRCS
- hypotf_
diff .cpp
- DEPENDS
- .binary_op_single_output_
diff
- libc.src.math.hypotf
- COMPILE_OPTIONS
- -fno-builtin
-)
-
-add_
diff _binary(
+add_perf_binary(
hypotf_perf
SRCS
hypotf_perf.cpp
@@ -458,18 +299,7 @@ add_
diff _binary(
-fno-builtin
)
-add_
diff _binary(
- hypot_
diff
- SRCS
- hypot_
diff .cpp
- DEPENDS
- .binary_op_single_output_
diff
- libc.src.math.hypot
- COMPILE_OPTIONS
- -fno-builtin
-)
-
-add_
diff _binary(
+add_perf_binary(
hypot_perf
SRCS
hypot_perf.cpp
@@ -480,16 +310,7 @@ add_
diff _binary(
-fno-builtin
)
-add_
diff _binary(
- fmodf_
diff
- SRCS
- fmodf_
diff .cpp
- DEPENDS
- .single_input_single_output_
diff
- libc.src.math.fmodf
-)
-
-add_
diff _binary(
+add_perf_binary(
fmodf_perf
SRCS
fmodf_perf.cpp
@@ -500,16 +321,7 @@ add_
diff _binary(
-fno-builtin
)
-add_
diff _binary(
- fmod_
diff
- SRCS
- fmod_
diff .cpp
- DEPENDS
- .single_input_single_output_
diff
- libc.src.math.fmod
-)
-
-add_
diff _binary(
+add_perf_binary(
fmod_perf
SRCS
fmod_perf.cpp
diff --git a/libc/test/src/math/
diff erential_testing/SingleInputSingleOutputDiff.h b/libc/test/src/math/performance_testing/SingleInputSingleOutputPerf.h
similarity index 64%
rename from libc/test/src/math/
diff erential_testing/SingleInputSingleOutputDiff.h
rename to libc/test/src/math/performance_testing/SingleInputSingleOutputPerf.h
index 5e8310e889dc67..b5b38313a69ca9 100644
--- a/libc/test/src/math/
diff erential_testing/SingleInputSingleOutputDiff.h
+++ b/libc/test/src/math/performance_testing/SingleInputSingleOutputPerf.h
@@ -7,14 +7,14 @@
//===----------------------------------------------------------------------===//
#include "src/__support/FPUtil/FPBits.h"
-#include "test/src/math/
diff erential_testing/Timer.h"
+#include "test/src/math/performance_testing/Timer.h"
#include <fstream>
namespace LIBC_NAMESPACE {
namespace testing {
-template <typename T> class SingleInputSingleOutputDiff {
+template <typename T> class SingleInputSingleOutputPerf {
using FPBits = fputil::FPBits<T>;
using StorageType = typename FPBits::StorageType;
static constexpr StorageType UIntMax =
@@ -23,40 +23,18 @@ template <typename T> class SingleInputSingleOutputDiff {
public:
typedef T Func(T);
- static void runDiff(Func myFunc, Func otherFunc, const char *logFile) {
- StorageType
diff Count = 0;
- std::ofstream log(logFile);
- log << "Starting
diff for values from 0 to " << UIntMax << '\n'
- << "Only
diff ering results will be logged.\n\n";
- for (StorageType bits = 0;; ++bits) {
- T x = T(FPBits(bits));
- T myResult = myFunc(x);
- T otherResult = otherFunc(x);
- StorageType myBits = FPBits(myResult).uintval();
- StorageType otherBits = FPBits(otherResult).uintval();
- if (myBits != otherBits) {
- ++
diff Count;
- log << " Input: " << bits << " (" << x << ")\n"
- << " My result: " << myBits << " (" << myResult << ")\n"
- << "Other result: " << otherBits << " (" << otherResult << ")\n"
- << '\n';
- }
- if (bits == UIntMax)
- break;
- }
- log << "Total number of
diff ering results: " <<
diff Count << '\n';
- }
-
static void runPerfInRange(Func myFunc, Func otherFunc,
StorageType startingBit, StorageType endingBit,
std::ofstream &log) {
auto runner = [=](Func func) {
+ constexpr StorageType N = 10'010'001;
+ StorageType step = (endingBit - startingBit) / N;
+ if (step == 0)
+ step = 1;
volatile T result;
- for (StorageType bits = startingBit;; ++bits) {
- T x = T(FPBits(bits));
+ for (StorageType bits = startingBit; bits < endingBit; bits += step) {
+ T x = FPBits(bits).get_val();
result = func(x);
- if (bits == endingBit)
- break;
}
};
@@ -104,16 +82,9 @@ template <typename T> class SingleInputSingleOutputDiff {
} // namespace testing
} // namespace LIBC_NAMESPACE
-#define SINGLE_INPUT_SINGLE_OUTPUT_DIFF(T, myFunc, otherFunc, filename) \
- int main() { \
- LIBC_NAMESPACE::testing::SingleInputSingleOutputDiff<T>::runDiff( \
- &myFunc, &otherFunc, filename); \
- return 0; \
- }
-
#define SINGLE_INPUT_SINGLE_OUTPUT_PERF(T, myFunc, otherFunc, filename) \
int main() { \
- LIBC_NAMESPACE::testing::SingleInputSingleOutputDiff<T>::runPerf( \
+ LIBC_NAMESPACE::testing::SingleInputSingleOutputPerf<T>::runPerf( \
&myFunc, &otherFunc, filename); \
return 0; \
}
diff --git a/libc/test/src/math/
diff erential_testing/Timer.cpp b/libc/test/src/math/performance_testing/Timer.cpp
similarity index 100%
rename from libc/test/src/math/
diff erential_testing/Timer.cpp
rename to libc/test/src/math/performance_testing/Timer.cpp
diff --git a/libc/test/src/math/
diff erential_testing/Timer.h b/libc/test/src/math/performance_testing/Timer.h
similarity index 77%
rename from libc/test/src/math/
diff erential_testing/Timer.h
rename to libc/test/src/math/performance_testing/Timer.h
index 0d9518c37d9e0f..2327ede260ab9d 100644
--- a/libc/test/src/math/
diff erential_testing/Timer.h
+++ b/libc/test/src/math/performance_testing/Timer.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_LIBC_TEST_SRC_MATH_DIFFERENTIAL_TESTING_TIMER_H
-#define LLVM_LIBC_TEST_SRC_MATH_DIFFERENTIAL_TESTING_TIMER_H
+#ifndef LLVM_LIBC_TEST_SRC_MATH_PERFORMACE_TESTING_TIMER_H
+#define LLVM_LIBC_TEST_SRC_MATH_PERFORMACE_TESTING_TIMER_H
#include <stdint.h>
@@ -30,4 +30,4 @@ class Timer {
} // namespace testing
} // namespace LIBC_NAMESPACE
-#endif // LLVM_LIBC_TEST_SRC_MATH_DIFFERENTIAL_TESTING_TIMER_H
+#endif // LLVM_LIBC_TEST_SRC_MATH_PERFORMANCE_TESTING_TIMER_H
diff --git a/libc/test/src/math/
diff erential_testing/ceilf_perf.cpp b/libc/test/src/math/performance_testing/ceilf_perf.cpp
similarity index 92%
rename from libc/test/src/math/
diff erential_testing/ceilf_perf.cpp
rename to libc/test/src/math/performance_testing/ceilf_perf.cpp
index c304231e0678de..04e96f6fb2dccc 100644
--- a/libc/test/src/math/
diff erential_testing/ceilf_perf.cpp
+++ b/libc/test/src/math/performance_testing/ceilf_perf.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "SingleInputSingleOutputDiff.h"
+#include "SingleInputSingleOutputPerf.h"
#include "src/math/ceilf.h"
diff --git a/libc/test/src/math/
diff erential_testing/cosf_perf.cpp b/libc/test/src/math/performance_testing/cosf_perf.cpp
similarity index 92%
rename from libc/test/src/math/
diff erential_testing/cosf_perf.cpp
rename to libc/test/src/math/performance_testing/cosf_perf.cpp
index 981a94133b8040..1501b8bf254044 100644
--- a/libc/test/src/math/
diff erential_testing/cosf_perf.cpp
+++ b/libc/test/src/math/performance_testing/cosf_perf.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "SingleInputSingleOutputDiff.h"
+#include "SingleInputSingleOutputPerf.h"
#include "src/math/cosf.h"
diff --git a/libc/test/src/math/
diff erential_testing/exp2f_perf.cpp b/libc/test/src/math/performance_testing/exp2f_perf.cpp
similarity index 92%
rename from libc/test/src/math/
diff erential_testing/exp2f_perf.cpp
rename to libc/test/src/math/performance_testing/exp2f_perf.cpp
index 4aae5220e6a516..19a70ac6569aa4 100644
--- a/libc/test/src/math/
diff erential_testing/exp2f_perf.cpp
+++ b/libc/test/src/math/performance_testing/exp2f_perf.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "SingleInputSingleOutputDiff.h"
+#include "SingleInputSingleOutputPerf.h"
#include "src/math/exp2f.h"
diff --git a/libc/test/src/math/
diff erential_testing/expf_perf.cpp b/libc/test/src/math/performance_testing/expf_perf.cpp
similarity index 92%
rename from libc/test/src/math/
diff erential_testing/expf_perf.cpp
rename to libc/test/src/math/performance_testing/expf_perf.cpp
index c34173b21b4f60..4b743514023d12 100644
--- a/libc/test/src/math/
diff erential_testing/expf_perf.cpp
+++ b/libc/test/src/math/performance_testing/expf_perf.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "SingleInputSingleOutputDiff.h"
+#include "SingleInputSingleOutputPerf.h"
#include "src/math/expf.h"
diff --git a/libc/test/src/math/
diff erential_testing/expm1f_perf.cpp b/libc/test/src/math/performance_testing/expm1f_perf.cpp
similarity index 92%
rename from libc/test/src/math/
diff erential_testing/expm1f_perf.cpp
rename to libc/test/src/math/performance_testing/expm1f_perf.cpp
index 3c25ef81d4808c..128ab351d86db1 100644
--- a/libc/test/src/math/
diff erential_testing/expm1f_perf.cpp
+++ b/libc/test/src/math/performance_testing/expm1f_perf.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "SingleInputSingleOutputDiff.h"
+#include "SingleInputSingleOutputPerf.h"
#include "src/math/expm1f.h"
diff --git a/libc/test/src/math/
diff erential_testing/fabsf_perf.cpp b/libc/test/src/math/performance_testing/fabsf_perf.cpp
similarity index 92%
rename from libc/test/src/math/
diff erential_testing/fabsf_perf.cpp
rename to libc/test/src/math/performance_testing/fabsf_perf.cpp
index f9f9cea72c6dae..b6c6add75d230c 100644
--- a/libc/test/src/math/
diff erential_testing/fabsf_perf.cpp
+++ b/libc/test/src/math/performance_testing/fabsf_perf.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "SingleInputSingleOutputDiff.h"
+#include "SingleInputSingleOutputPerf.h"
#include "src/math/fabsf.h"
diff --git a/libc/test/src/math/
diff erential_testing/floorf_perf.cpp b/libc/test/src/math/performance_testing/floorf_perf.cpp
similarity index 92%
rename from libc/test/src/math/
diff erential_testing/floorf_perf.cpp
rename to libc/test/src/math/performance_testing/floorf_perf.cpp
index abd1cd7885ffd2..0f1087b3c8236b 100644
--- a/libc/test/src/math/
diff erential_testing/floorf_perf.cpp
+++ b/libc/test/src/math/performance_testing/floorf_perf.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "SingleInputSingleOutputDiff.h"
+#include "SingleInputSingleOutputPerf.h"
#include "src/math/floorf.h"
diff --git a/libc/test/src/math/
diff erential_testing/fmod_perf.cpp b/libc/test/src/math/performance_testing/fmod_perf.cpp
similarity index 93%
rename from libc/test/src/math/
diff erential_testing/fmod_perf.cpp
rename to libc/test/src/math/performance_testing/fmod_perf.cpp
index 219ee7860a242b..fa9b4c6b41287b 100644
--- a/libc/test/src/math/
diff erential_testing/fmod_perf.cpp
+++ b/libc/test/src/math/performance_testing/fmod_perf.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "BinaryOpSingleOutputDiff.h"
+#include "BinaryOpSingleOutputPerf.h"
#include "src/math/fmod.h"
diff --git a/libc/test/src/math/
diff erential_testing/fmodf_perf.cpp b/libc/test/src/math/performance_testing/fmodf_perf.cpp
similarity index 93%
rename from libc/test/src/math/
diff erential_testing/fmodf_perf.cpp
rename to libc/test/src/math/performance_testing/fmodf_perf.cpp
index c2927bb1ea9d9f..f13f02e2439da3 100644
--- a/libc/test/src/math/
diff erential_testing/fmodf_perf.cpp
+++ b/libc/test/src/math/performance_testing/fmodf_perf.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "BinaryOpSingleOutputDiff.h"
+#include "BinaryOpSingleOutputPerf.h"
#include "src/math/fmodf.h"
diff --git a/libc/test/src/math/
diff erential_testing/hypot_perf.cpp b/libc/test/src/math/performance_testing/hypot_perf.cpp
similarity index 93%
rename from libc/test/src/math/
diff erential_testing/hypot_perf.cpp
rename to libc/test/src/math/performance_testing/hypot_perf.cpp
index 01a72e6fbc3d79..393697b7540330 100644
--- a/libc/test/src/math/
diff erential_testing/hypot_perf.cpp
+++ b/libc/test/src/math/performance_testing/hypot_perf.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "BinaryOpSingleOutputDiff.h"
+#include "BinaryOpSingleOutputPerf.h"
#include "src/math/hypot.h"
diff --git a/libc/test/src/math/
diff erential_testing/hypotf_perf.cpp b/libc/test/src/math/performance_testing/hypotf_perf.cpp
similarity index 93%
rename from libc/test/src/math/
diff erential_testing/hypotf_perf.cpp
rename to libc/test/src/math/performance_testing/hypotf_perf.cpp
index ed57b186f889ba..f711729377dacf 100644
--- a/libc/test/src/math/
diff erential_testing/hypotf_perf.cpp
+++ b/libc/test/src/math/performance_testing/hypotf_perf.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "BinaryOpSingleOutputDiff.h"
+#include "BinaryOpSingleOutputPerf.h"
#include "src/math/hypotf.h"
diff --git a/libc/test/src/math/
diff erential_testing/log10f_perf.cpp b/libc/test/src/math/performance_testing/log10f_perf.cpp
similarity index 92%
rename from libc/test/src/math/
diff erential_testing/log10f_perf.cpp
rename to libc/test/src/math/performance_testing/log10f_perf.cpp
index 60c1161a31cf96..32a31b93252855 100644
--- a/libc/test/src/math/
diff erential_testing/log10f_perf.cpp
+++ b/libc/test/src/math/performance_testing/log10f_perf.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "SingleInputSingleOutputDiff.h"
+#include "SingleInputSingleOutputPerf.h"
#include "src/math/log10f.h"
diff --git a/libc/test/src/math/
diff erential_testing/log1pf_perf.cpp b/libc/test/src/math/performance_testing/log1pf_perf.cpp
similarity index 92%
rename from libc/test/src/math/
diff erential_testing/log1pf_perf.cpp
rename to libc/test/src/math/performance_testing/log1pf_perf.cpp
index 5cd523d82184cc..18c168423b87d1 100644
--- a/libc/test/src/math/
diff erential_testing/log1pf_perf.cpp
+++ b/libc/test/src/math/performance_testing/log1pf_perf.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "SingleInputSingleOutputDiff.h"
+#include "SingleInputSingleOutputPerf.h"
#include "src/math/log1pf.h"
diff --git a/libc/test/src/math/
diff erential_testing/log2f_perf.cpp b/libc/test/src/math/performance_testing/log2f_perf.cpp
similarity index 92%
rename from libc/test/src/math/
diff erential_testing/log2f_perf.cpp
rename to libc/test/src/math/performance_testing/log2f_perf.cpp
index ee899394c421ed..c4c4dbf4d9f554 100644
--- a/libc/test/src/math/
diff erential_testing/log2f_perf.cpp
+++ b/libc/test/src/math/performance_testing/log2f_perf.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "SingleInputSingleOutputDiff.h"
+#include "SingleInputSingleOutputPerf.h"
#include "src/math/log2f.h"
diff --git a/libc/test/src/math/
diff erential_testing/logbf_perf.cpp b/libc/test/src/math/performance_testing/logbf_perf.cpp
similarity index 92%
rename from libc/test/src/math/
diff erential_testing/logbf_perf.cpp
rename to libc/test/src/math/performance_testing/logbf_perf.cpp
index 89d5bd13f9316b..eefd64b8ae913f 100644
--- a/libc/test/src/math/
diff erential_testing/logbf_perf.cpp
+++ b/libc/test/src/math/performance_testing/logbf_perf.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "SingleInputSingleOutputDiff.h"
+#include "SingleInputSingleOutputPerf.h"
#include "src/math/logbf.h"
diff --git a/libc/test/src/math/
diff erential_testing/logf_perf.cpp b/libc/test/src/math/performance_testing/logf_perf.cpp
similarity index 92%
rename from libc/test/src/math/
diff erential_testing/logf_perf.cpp
rename to libc/test/src/math/performance_testing/logf_perf.cpp
index f1b3f986bd40a3..53f4f50e09efe4 100644
--- a/libc/test/src/math/
diff erential_testing/logf_perf.cpp
+++ b/libc/test/src/math/performance_testing/logf_perf.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "SingleInputSingleOutputDiff.h"
+#include "SingleInputSingleOutputPerf.h"
#include "src/math/logf.h"
diff --git a/libc/test/src/math/
diff erential_testing/nearbyintf_perf.cpp b/libc/test/src/math/performance_testing/nearbyintf_perf.cpp
similarity index 93%
rename from libc/test/src/math/
diff erential_testing/nearbyintf_perf.cpp
rename to libc/test/src/math/performance_testing/nearbyintf_perf.cpp
index 9c5736fb4ab048..ae708dd2132432 100644
--- a/libc/test/src/math/
diff erential_testing/nearbyintf_perf.cpp
+++ b/libc/test/src/math/performance_testing/nearbyintf_perf.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "SingleInputSingleOutputDiff.h"
+#include "SingleInputSingleOutputPerf.h"
#include "src/math/nearbyintf.h"
diff --git a/libc/test/src/math/
diff erential_testing/rintf_perf.cpp b/libc/test/src/math/performance_testing/rintf_perf.cpp
similarity index 92%
rename from libc/test/src/math/
diff erential_testing/rintf_perf.cpp
rename to libc/test/src/math/performance_testing/rintf_perf.cpp
index 432e5da77f3789..6347ac9149af6e 100644
--- a/libc/test/src/math/
diff erential_testing/rintf_perf.cpp
+++ b/libc/test/src/math/performance_testing/rintf_perf.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "SingleInputSingleOutputDiff.h"
+#include "SingleInputSingleOutputPerf.h"
#include "src/math/rintf.h"
diff --git a/libc/test/src/math/
diff erential_testing/roundf_perf.cpp b/libc/test/src/math/performance_testing/roundf_perf.cpp
similarity index 92%
rename from libc/test/src/math/
diff erential_testing/roundf_perf.cpp
rename to libc/test/src/math/performance_testing/roundf_perf.cpp
index 091c7b2b86800f..36becacba07cb5 100644
--- a/libc/test/src/math/
diff erential_testing/roundf_perf.cpp
+++ b/libc/test/src/math/performance_testing/roundf_perf.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "SingleInputSingleOutputDiff.h"
+#include "SingleInputSingleOutputPerf.h"
#include "src/math/roundf.h"
diff --git a/libc/test/src/math/
diff erential_testing/sinf_perf.cpp b/libc/test/src/math/performance_testing/sinf_perf.cpp
similarity index 92%
rename from libc/test/src/math/
diff erential_testing/sinf_perf.cpp
rename to libc/test/src/math/performance_testing/sinf_perf.cpp
index 7247bca2853d88..43ba60e1ef76a4 100644
--- a/libc/test/src/math/
diff erential_testing/sinf_perf.cpp
+++ b/libc/test/src/math/performance_testing/sinf_perf.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "SingleInputSingleOutputDiff.h"
+#include "SingleInputSingleOutputPerf.h"
#include "src/math/sinf.h"
diff --git a/libc/test/src/math/
diff erential_testing/sqrtf_perf.cpp b/libc/test/src/math/performance_testing/sqrtf_perf.cpp
similarity index 92%
rename from libc/test/src/math/
diff erential_testing/sqrtf_perf.cpp
rename to libc/test/src/math/performance_testing/sqrtf_perf.cpp
index 5ae586ba31267d..71325518533b60 100644
--- a/libc/test/src/math/
diff erential_testing/sqrtf_perf.cpp
+++ b/libc/test/src/math/performance_testing/sqrtf_perf.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "SingleInputSingleOutputDiff.h"
+#include "SingleInputSingleOutputPerf.h"
#include "src/math/sqrtf.h"
diff --git a/libc/test/src/math/
diff erential_testing/truncf_perf.cpp b/libc/test/src/math/performance_testing/truncf_perf.cpp
similarity index 92%
rename from libc/test/src/math/
diff erential_testing/truncf_perf.cpp
rename to libc/test/src/math/performance_testing/truncf_perf.cpp
index e07db1320fddd7..ff74c6b4eb64df 100644
--- a/libc/test/src/math/
diff erential_testing/truncf_perf.cpp
+++ b/libc/test/src/math/performance_testing/truncf_perf.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "SingleInputSingleOutputDiff.h"
+#include "SingleInputSingleOutputPerf.h"
#include "src/math/truncf.h"
More information about the libc-commits
mailing list