Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Oct 11, 2024

No description provided.

@llvmbot llvmbot added the libc label Oct 11, 2024
@llvmbot
Copy link
Member

llvmbot commented Oct 11, 2024

@llvm/pr-subscribers-libc

Author: Job Henandez Lara (Jobhdez)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/112055.diff

2 Files Affected:

  • (modified) libc/test/src/math/performance_testing/CMakeLists.txt (+12)
  • (added) libc/test/src/math/performance_testing/fadd_perf.cpp (+22)
diff --git a/libc/test/src/math/performance_testing/CMakeLists.txt b/libc/test/src/math/performance_testing/CMakeLists.txt
index 60c074a248f72a..f1399663a6cf34 100644
--- a/libc/test/src/math/performance_testing/CMakeLists.txt
+++ b/libc/test/src/math/performance_testing/CMakeLists.txt
@@ -475,6 +475,18 @@ add_perf_binary(
     libc.src.math.fminimum_numf16
   COMPILE_OPTIONS
     -fno-builtin
+    )
+
+add_perf_binary(
+  fadd_perf
+  SRCS
+    fadd_perf.cpp
+  DEPENDS
+    .binary_op_single_output_diff
+    libc.src.math.fadd
+    libc.src.__support.FPUtil.fp_bits
+  COMPILE_OPTIONS
+    -fno-builtin
 )
 
 add_perf_binary(
diff --git a/libc/test/src/math/performance_testing/fadd_perf.cpp b/libc/test/src/math/performance_testing/fadd_perf.cpp
new file mode 100644
index 00000000000000..b903595d26c829
--- /dev/null
+++ b/libc/test/src/math/performance_testing/fadd_perf.cpp
@@ -0,0 +1,22 @@
+//===-- Performance test for the fadd function ----------------------------===//
+//
+// 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 "BinaryOpSingleOutputPerf.h"
+#include "src/math/fadd.h"
+
+static constexpr size_t DOUBLE_ROUNDS = 40;
+
+float fadd_placeholder_binary(double x, double y) {
+  return static_cast<float>(x + y);
+}
+
+int main() {
+  BINARY_OP_SINGLE_OUTPUT_PERF_EX(float, double, myFunc, fadd_placeholder_binary, DOUBLE_ROUNDS, "fadd_perf.log")
+    return 0;
+}
+    

@lntue lntue self-requested a review October 11, 2024 22:19
@github-actions
Copy link

github-actions bot commented Oct 11, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

@ghost ghost marked this pull request as draft October 11, 2024 22:23
Job Hernandez added 2 commits October 11, 2024 21:57
@ghost ghost closed this by deleting the head repository Nov 26, 2024
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant