diff --git a/libc/test/src/math/differential_testing/CMakeLists.txt b/libc/test/src/math/differential_testing/CMakeLists.txt --- a/libc/test/src/math/differential_testing/CMakeLists.txt +++ b/libc/test/src/math/differential_testing/CMakeLists.txt @@ -127,6 +127,166 @@ -fno-builtin ) +add_diff_binary( + ceilf_diff + SRCS + ceilf_diff.cpp + DEPENDS + .single_input_single_output_diff + libc.src.math.ceilf +) + +add_diff_binary( + ceilf_perf + SRCS + ceilf_perf.cpp + DEPENDS + .single_input_single_output_diff + libc.src.math.ceilf + COMPILE_OPTIONS + -fno-builtin +) + +add_diff_binary( + expf_diff + SRCS + expf_diff.cpp + DEPENDS + .single_input_single_output_diff + libc.src.math.expf +) + +add_diff_binary( + expf_perf + SRCS + expf_perf.cpp + DEPENDS + .single_input_single_output_diff + libc.src.math.expf + COMPILE_OPTIONS + -fno-builtin +) + +add_diff_binary( + fabsf_diff + SRCS + fabsf_diff.cpp + DEPENDS + .single_input_single_output_diff + libc.src.math.fabsf +) + +add_diff_binary( + fabsf_perf + SRCS + fabsf_perf.cpp + DEPENDS + .single_input_single_output_diff + libc.src.math.fabsf + COMPILE_OPTIONS + -fno-builtin +) + +add_diff_binary( + floorf_diff + SRCS + floorf_diff.cpp + DEPENDS + .single_input_single_output_diff + libc.src.math.floorf +) + +add_diff_binary( + floorf_perf + SRCS + floorf_perf.cpp + DEPENDS + .single_input_single_output_diff + libc.src.math.floorf + COMPILE_OPTIONS + -fno-builtin +) + +add_diff_binary( + logbf_diff + SRCS + logbf_diff.cpp + DEPENDS + .single_input_single_output_diff + libc.src.math.logbf +) + +add_diff_binary( + logbf_perf + SRCS + logbf_perf.cpp + DEPENDS + .single_input_single_output_diff + libc.src.math.logbf + COMPILE_OPTIONS + -fno-builtin +) + +add_diff_binary( + nearbyintf_diff + SRCS + nearbyintf_diff.cpp + DEPENDS + .single_input_single_output_diff + libc.src.math.nearbyintf +) + +add_diff_binary( + nearbyintf_perf + SRCS + nearbyintf_perf.cpp + DEPENDS + .single_input_single_output_diff + libc.src.math.nearbyintf + COMPILE_OPTIONS + -fno-builtin +) + +add_diff_binary( + rintf_diff + SRCS + rintf_diff.cpp + DEPENDS + .single_input_single_output_diff + libc.src.math.rintf +) + +add_diff_binary( + rintf_perf + SRCS + rintf_perf.cpp + DEPENDS + .single_input_single_output_diff + libc.src.math.rintf + COMPILE_OPTIONS + -fno-builtin +) + +add_diff_binary( + roundf_diff + SRCS + roundf_diff.cpp + DEPENDS + .single_input_single_output_diff + libc.src.math.roundf +) + +add_diff_binary( + roundf_perf + SRCS + roundf_perf.cpp + DEPENDS + .single_input_single_output_diff + libc.src.math.roundf + COMPILE_OPTIONS + -fno-builtin +) + add_diff_binary( sqrtf_diff SRCS @@ -146,3 +306,23 @@ COMPILE_OPTIONS -fno-builtin ) + +add_diff_binary( + truncf_diff + SRCS + truncf_diff.cpp + DEPENDS + .single_input_single_output_diff + libc.src.math.truncf +) + +add_diff_binary( + truncf_perf + SRCS + truncf_perf.cpp + DEPENDS + .single_input_single_output_diff + libc.src.math.truncf + COMPILE_OPTIONS + -fno-builtin +) diff --git a/libc/test/src/math/differential_testing/ceilf_diff.cpp b/libc/test/src/math/differential_testing/ceilf_diff.cpp new file mode 100644 --- /dev/null +++ b/libc/test/src/math/differential_testing/ceilf_diff.cpp @@ -0,0 +1,16 @@ +//===-- 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 + +SINGLE_INPUT_SINGLE_OUTPUT_DIFF(float, __llvm_libc::ceilf, ::ceilf, + "ceilf_diff.log") diff --git a/libc/test/src/math/differential_testing/ceilf_perf.cpp b/libc/test/src/math/differential_testing/ceilf_perf.cpp new file mode 100644 --- /dev/null +++ b/libc/test/src/math/differential_testing/ceilf_perf.cpp @@ -0,0 +1,17 @@ +//===-- 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 + +SINGLE_INPUT_SINGLE_OUTPUT_PERF(float, __llvm_libc::ceilf, ::ceilf, + "ceilf_perf.log") diff --git a/libc/test/src/math/differential_testing/expf_diff.cpp b/libc/test/src/math/differential_testing/expf_diff.cpp new file mode 100644 --- /dev/null +++ b/libc/test/src/math/differential_testing/expf_diff.cpp @@ -0,0 +1,16 @@ +//===-- 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 + +SINGLE_INPUT_SINGLE_OUTPUT_DIFF(float, __llvm_libc::expf, ::expf, + "expf_diff.log") diff --git a/libc/test/src/math/differential_testing/expf_perf.cpp b/libc/test/src/math/differential_testing/expf_perf.cpp new file mode 100644 --- /dev/null +++ b/libc/test/src/math/differential_testing/expf_perf.cpp @@ -0,0 +1,16 @@ +//===-- 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 + +SINGLE_INPUT_SINGLE_OUTPUT_PERF(float, __llvm_libc::expf, ::expf, + "expf_perf.log") diff --git a/libc/test/src/math/differential_testing/fabsf_diff.cpp b/libc/test/src/math/differential_testing/fabsf_diff.cpp new file mode 100644 --- /dev/null +++ b/libc/test/src/math/differential_testing/fabsf_diff.cpp @@ -0,0 +1,17 @@ +//===-- 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 + +SINGLE_INPUT_SINGLE_OUTPUT_DIFF(float, __llvm_libc::fabsf, ::fabsf, + "fabsf_diff.log") diff --git a/libc/test/src/math/differential_testing/fabsf_perf.cpp b/libc/test/src/math/differential_testing/fabsf_perf.cpp new file mode 100644 --- /dev/null +++ b/libc/test/src/math/differential_testing/fabsf_perf.cpp @@ -0,0 +1,17 @@ +//===-- 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 + +SINGLE_INPUT_SINGLE_OUTPUT_PERF(float, __llvm_libc::fabsf, ::fabsf, + "fabsf_perf.log") diff --git a/libc/test/src/math/differential_testing/floorf_diff.cpp b/libc/test/src/math/differential_testing/floorf_diff.cpp new file mode 100644 --- /dev/null +++ b/libc/test/src/math/differential_testing/floorf_diff.cpp @@ -0,0 +1,17 @@ +//===-- 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 + +SINGLE_INPUT_SINGLE_OUTPUT_DIFF(float, __llvm_libc::floorf, ::floorf, + "floorf_diff.log") diff --git a/libc/test/src/math/differential_testing/floorf_perf.cpp b/libc/test/src/math/differential_testing/floorf_perf.cpp new file mode 100644 --- /dev/null +++ b/libc/test/src/math/differential_testing/floorf_perf.cpp @@ -0,0 +1,17 @@ +//===-- 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 + +SINGLE_INPUT_SINGLE_OUTPUT_PERF(float, __llvm_libc::floorf, ::floorf, + "floorf_perf.log") diff --git a/libc/test/src/math/differential_testing/logbf_diff.cpp b/libc/test/src/math/differential_testing/logbf_diff.cpp new file mode 100644 --- /dev/null +++ b/libc/test/src/math/differential_testing/logbf_diff.cpp @@ -0,0 +1,17 @@ +//===-- 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 + +SINGLE_INPUT_SINGLE_OUTPUT_DIFF(float, __llvm_libc::logbf, ::logbf, + "logbf_diff.log") diff --git a/libc/test/src/math/differential_testing/logbf_perf.cpp b/libc/test/src/math/differential_testing/logbf_perf.cpp new file mode 100644 --- /dev/null +++ b/libc/test/src/math/differential_testing/logbf_perf.cpp @@ -0,0 +1,17 @@ +//===-- 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 + +SINGLE_INPUT_SINGLE_OUTPUT_PERF(float, __llvm_libc::logbf, ::logbf, + "logbf_perf.log") diff --git a/libc/test/src/math/differential_testing/nearbyintf_diff.cpp b/libc/test/src/math/differential_testing/nearbyintf_diff.cpp new file mode 100644 --- /dev/null +++ b/libc/test/src/math/differential_testing/nearbyintf_diff.cpp @@ -0,0 +1,17 @@ +//===-- 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 + +SINGLE_INPUT_SINGLE_OUTPUT_DIFF(float, __llvm_libc::nearbyintf, ::nearbyintf, + "nearbyintf_diff.log") diff --git a/libc/test/src/math/differential_testing/nearbyintf_perf.cpp b/libc/test/src/math/differential_testing/nearbyintf_perf.cpp new file mode 100644 --- /dev/null +++ b/libc/test/src/math/differential_testing/nearbyintf_perf.cpp @@ -0,0 +1,17 @@ +//===-- 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 + +SINGLE_INPUT_SINGLE_OUTPUT_PERF(float, __llvm_libc::nearbyintf, ::nearbyintf, + "nearbyintf_perf.log") diff --git a/libc/test/src/math/differential_testing/rintf_diff.cpp b/libc/test/src/math/differential_testing/rintf_diff.cpp new file mode 100644 --- /dev/null +++ b/libc/test/src/math/differential_testing/rintf_diff.cpp @@ -0,0 +1,17 @@ +//===-- 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 + +SINGLE_INPUT_SINGLE_OUTPUT_DIFF(float, __llvm_libc::rintf, ::rintf, + "rintf_diff.log") diff --git a/libc/test/src/math/differential_testing/rintf_perf.cpp b/libc/test/src/math/differential_testing/rintf_perf.cpp new file mode 100644 --- /dev/null +++ b/libc/test/src/math/differential_testing/rintf_perf.cpp @@ -0,0 +1,17 @@ +//===-- 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 + +SINGLE_INPUT_SINGLE_OUTPUT_PERF(float, __llvm_libc::rintf, ::rintf, + "rintf_perf.log") diff --git a/libc/test/src/math/differential_testing/roundf_diff.cpp b/libc/test/src/math/differential_testing/roundf_diff.cpp new file mode 100644 --- /dev/null +++ b/libc/test/src/math/differential_testing/roundf_diff.cpp @@ -0,0 +1,17 @@ +//===-- 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 + +SINGLE_INPUT_SINGLE_OUTPUT_DIFF(float, __llvm_libc::roundf, ::roundf, + "roundf_diff.log") diff --git a/libc/test/src/math/differential_testing/roundf_perf.cpp b/libc/test/src/math/differential_testing/roundf_perf.cpp new file mode 100644 --- /dev/null +++ b/libc/test/src/math/differential_testing/roundf_perf.cpp @@ -0,0 +1,17 @@ +//===-- 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 + +SINGLE_INPUT_SINGLE_OUTPUT_PERF(float, __llvm_libc::roundf, ::roundf, + "roundf_perf.log") diff --git a/libc/test/src/math/differential_testing/truncf_diff.cpp b/libc/test/src/math/differential_testing/truncf_diff.cpp new file mode 100644 --- /dev/null +++ b/libc/test/src/math/differential_testing/truncf_diff.cpp @@ -0,0 +1,17 @@ +//===-- 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 + +SINGLE_INPUT_SINGLE_OUTPUT_DIFF(float, __llvm_libc::truncf, ::truncf, + "truncf_diff.log") diff --git a/libc/test/src/math/differential_testing/truncf_perf.cpp b/libc/test/src/math/differential_testing/truncf_perf.cpp new file mode 100644 --- /dev/null +++ b/libc/test/src/math/differential_testing/truncf_perf.cpp @@ -0,0 +1,17 @@ +//===-- 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 + +SINGLE_INPUT_SINGLE_OUTPUT_PERF(float, __llvm_libc::truncf, ::truncf, + "truncf_perf.log")