[libc-commits] [PATCH] D107229: [libc] Add differential and performance targets for sqrtf

Hedin GarcĂ­a via Phabricator via libc-commits libc-commits at lists.llvm.org
Sat Jul 31 12:03:57 PDT 2021


hedingarcia created this revision.
hedingarcia added reviewers: sivachandra, aeubanks.
Herald added subscribers: libc-commits, ecnelises, tschuett, mgorny.
Herald added a project: libc-project.
hedingarcia requested review of this revision.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D107229

Files:
  libc/test/src/math/differential_testing/CMakeLists.txt
  libc/test/src/math/differential_testing/sqrtf_diff.cpp
  libc/test/src/math/differential_testing/sqrtf_perf.cpp


Index: libc/test/src/math/differential_testing/sqrtf_perf.cpp
===================================================================
--- /dev/null
+++ libc/test/src/math/differential_testing/sqrtf_perf.cpp
@@ -0,0 +1,17 @@
+//===-- 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_PERF(float, __llvm_libc::sqrtf, ::sqrtf,
+                                "sqrtf_perf.log")
Index: libc/test/src/math/differential_testing/sqrtf_diff.cpp
===================================================================
--- /dev/null
+++ libc/test/src/math/differential_testing/sqrtf_diff.cpp
@@ -0,0 +1,17 @@
+//===-- 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, __llvm_libc::sqrtf, ::sqrtf,
+                                "sqrtf_diff.log")
Index: libc/test/src/math/differential_testing/CMakeLists.txt
===================================================================
--- libc/test/src/math/differential_testing/CMakeLists.txt
+++ libc/test/src/math/differential_testing/CMakeLists.txt
@@ -126,3 +126,23 @@
   COMPILE_OPTIONS
     -fno-builtin
 )
+
+add_diff_binary(
+  sqrtf_diff
+  SRCS
+    sqrtf_diff.cpp
+  DEPENDS
+    .single_input_single_output_diff
+    libc.src.math.sqrtf
+)
+
+add_diff_binary(
+  sqrtf_perf
+  SRCS
+    sqrtf_perf.cpp
+  DEPENDS
+    .single_input_single_output_diff
+    libc.src.math.sqrtf
+  COMPILE_OPTIONS
+    -fno-builtin
+)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107229.363312.patch
Type: text/x-patch
Size: 2260 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20210731/841fba3a/attachment.bin>


More information about the libc-commits mailing list