Skip to content

[libc][math] Add Generic Comparison Operations for floating point types #144983

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 38 commits into from
Jul 22, 2025

Conversation

krishna2803
Copy link
Contributor

@krishna2803 krishna2803 commented Jun 20, 2025

The PR implements the following generic comparison operation functions for floating point types along with unittests:

  • fputil::equals
  • fputil::less_than
  • fputil::less_than_or_equals
  • fputil::greater_than
  • fputil::greater_than_or_equals

cc @lntue @overmighty

@llvmbot llvmbot added the libc label Jun 20, 2025
@llvmbot
Copy link
Member

llvmbot commented Jun 20, 2025

@llvm/pr-subscribers-libc

Author: Krishna Pandey (krishna2803)

Changes

The PR implements the following generic comparison operation functions for floating point types along with unittests:

  • fputil::equals
  • fputil::not_equals
  • fputil::less_than
  • fputil::less_than_or_equals
  • fputil::greater_than
  • fputil::greater_than_or_equals

cc @lntue @overmighty


Patch is 23.44 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/144983.diff

4 Files Affected:

  • (modified) libc/src/__support/FPUtil/CMakeLists.txt (+11)
  • (added) libc/src/__support/FPUtil/ComparisonOperations.h (+122)
  • (modified) libc/test/src/__support/FPUtil/CMakeLists.txt (+12)
  • (added) libc/test/src/__support/FPUtil/comparison_operations_test.cpp (+254)
diff --git a/libc/src/__support/FPUtil/CMakeLists.txt b/libc/src/__support/FPUtil/CMakeLists.txt
index bfe0170f09fd9..ce068df8d4c03 100644
--- a/libc/src/__support/FPUtil/CMakeLists.txt
+++ b/libc/src/__support/FPUtil/CMakeLists.txt
@@ -209,6 +209,17 @@ add_header_library(
     libc.src.__support.macros.properties.types
 )
 
+add_header_library(
+  comparison_operations
+  HDRS
+    ComparisonOperations.h
+  DEPENDS
+    .fp_bits
+    .fenv_impl
+    libc.src.__support.CPP.type_traits
+    libc.src.__support.config
+)
+
 add_header_library(
   hypot
   HDRS
diff --git a/libc/src/__support/FPUtil/ComparisonOperations.h b/libc/src/__support/FPUtil/ComparisonOperations.h
new file mode 100644
index 0000000000000..cf71a14df0465
--- /dev/null
+++ b/libc/src/__support/FPUtil/ComparisonOperations.h
@@ -0,0 +1,122 @@
+//===-- Comparison operations on floating point numbers --------*- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SRC___SUPPORT_FPUTIL_COMPARISONOPERATIONS_H
+#define LLVM_LIBC_SRC___SUPPORT_FPUTIL_COMPARISONOPERATIONS_H
+
+#include "FEnvImpl.h"                      // raise_except_if_required
+#include "FPBits.h"                        // FPBits<T>
+#include "src/__support/CPP/type_traits.h" // enable_if, is_floating_point
+#include "src/__support/macros/config.h"   // LIBC_NAMESPACE_DECL
+
+namespace LIBC_NAMESPACE_DECL {
+namespace fputil {
+
+// IEEE Standard 754-2019. Section 5.11
+// Rules for comparison within the same floating point type
+// 1. +0 = −0
+// 2. (i)   +inf  = +inf
+//    (ii)  -inf  = -inf
+//    (iii) -inf != +inf
+// 3. Any comparison with NaN return false except (NaN != NaN => true)
+template <typename T>
+LIBC_INLINE cpp::enable_if_t<cpp::is_floating_point_v<T>, bool> equals(T x,
+                                                                       T y) {
+  using FPBits = FPBits<T>;
+  FPBits x_bits(x);
+  FPBits y_bits(y);
+
+  if (x_bits.is_signaling_nan() || y_bits.is_signaling_nan())
+    fputil::raise_except_if_required(FE_INVALID);
+
+  // NaN == x returns false for every x
+  if (x_bits.is_nan() || y_bits.is_nan())
+    return false;
+
+  // +/- 0 == +/- 0
+  if (x_bits.is_zero() && y_bits.is_zero())
+    return true;
+
+  // should also work for comparisons of different signs
+  return x_bits.uintval() == y_bits.uintval();
+}
+
+// !(x == y) => x != y
+template <typename T>
+LIBC_INLINE cpp::enable_if_t<cpp::is_floating_point_v<T>, bool>
+not_equals(T x, T y) {
+  return !equals(x, y);
+}
+
+// Rules:
+// 1. -inf < x (x != -inf)
+// 2. x < +inf (x != +inf)
+// 3. Any comparison with NaN return false
+template <typename T>
+LIBC_INLINE cpp::enable_if_t<cpp::is_floating_point_v<T>, bool> less_than(T x,
+                                                                          T y) {
+  using FPBits = FPBits<T>;
+  FPBits x_bits(x);
+  FPBits y_bits(y);
+
+  if (x_bits.is_signaling_nan() || y_bits.is_signaling_nan())
+    fputil::raise_except_if_required(FE_INVALID);
+
+  // Any comparison with NaN returns false
+  if (x_bits.is_nan() || y_bits.is_nan())
+    return false;
+
+  if (x_bits.is_zero() && y_bits.is_zero())
+    return false;
+
+  if (x_bits.is_neg() && y_bits.is_pos())
+    return true;
+
+  if (x_bits.is_pos() && y_bits.is_neg())
+    return false;
+
+  // since we store the float in the format: s | e | m
+  // the comparisons should work if we directly compare the uintval's
+
+  // TODO: verify if we should use FPBits.get_exponent and FPBits.get_mantissa
+  // instead of directly comparing uintval's
+
+  // both negative
+  if (x_bits.is_neg())
+    return x_bits.uintval() > y_bits.uintval();
+
+  // both positive
+  return x_bits.uintval() < y_bits.uintval();
+}
+
+// x < y => y > x
+template <typename T>
+LIBC_INLINE cpp::enable_if_t<cpp::is_floating_point_v<T>, bool>
+greater_than(T x, T y) {
+  return less_than(y, x);
+}
+
+// following is expression is correct, accounting for NaN case(s) as well
+// x <= y => (x < y) || (x == y)
+template <typename T>
+LIBC_INLINE cpp::enable_if_t<cpp::is_floating_point_v<T>, bool>
+less_than_or_equals(T x, T y) {
+  return less_than(x, y) || equals(x, y);
+}
+
+// x >= y => (x > y) || (x == y) => (y < x) || (x == y)
+template <typename T>
+LIBC_INLINE cpp::enable_if_t<cpp::is_floating_point_v<T>, bool>
+greater_than_or_equals(T x, T y) {
+  return less_than(y, x) || equals(x, y);
+}
+
+} // namespace fputil
+} // namespace LIBC_NAMESPACE_DECL
+
+#endif // LLVM_LIBC_SRC___SUPPORT_FPUTIL_COMPARISONOPERATIONS_H
diff --git a/libc/test/src/__support/FPUtil/CMakeLists.txt b/libc/test/src/__support/FPUtil/CMakeLists.txt
index 1e64e9ba425a5..1dcd666ec3d25 100644
--- a/libc/test/src/__support/FPUtil/CMakeLists.txt
+++ b/libc/test/src/__support/FPUtil/CMakeLists.txt
@@ -38,3 +38,15 @@ add_fp_unittest(
   DEPENDS
     libc.src.__support.FPUtil.rounding_mode
 )
+
+add_fp_unittest(
+  comparison_operations_test
+  SUITE
+    libc-fputil-tests
+  SRCS
+    comparison_operations_test.cpp
+  DEPENDS
+    libc.src.__support.FPUtil.fp_bits
+    # libc.src.__support.FPUtil.comparison_operations
+)
+
diff --git a/libc/test/src/__support/FPUtil/comparison_operations_test.cpp b/libc/test/src/__support/FPUtil/comparison_operations_test.cpp
new file mode 100644
index 0000000000000..94c234446ad8e
--- /dev/null
+++ b/libc/test/src/__support/FPUtil/comparison_operations_test.cpp
@@ -0,0 +1,254 @@
+//===-- Unittests for Comparison Operations for FPBits class -------------===//
+//
+// 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 "src/__support/FPUtil/ComparisonOperations.h"
+#include "src/__support/FPUtil/FPBits.h"
+#include "src/__support/macros/properties/types.h"
+#include "src/__support/sign.h"
+#include "test/UnitTest/FPMatcher.h"
+#include "test/UnitTest/Test.h"
+#include "utils/MPFRWrapper/MPFRUtils.h"
+
+using LIBC_NAMESPACE::fputil::equals;
+using LIBC_NAMESPACE::fputil::greater_than;
+using LIBC_NAMESPACE::fputil::greater_than_or_equals;
+using LIBC_NAMESPACE::fputil::less_than;
+using LIBC_NAMESPACE::fputil::less_than_or_equals;
+using LIBC_NAMESPACE::fputil::not_equals;
+
+// FIXME: currently i have used NAN here
+// need to find a better way to get a NAN floating point type
+// - need to see if FPRep could be used?
+
+#define TEST_EQUALS(Name, Type)                                                \
+  TEST(LlvmLibc##Name##ComparisionOperationsTest, Equals) {                                   \
+    using Bits = LIBC_NAMESPACE::fputil::FPBits<Type>;                         \
+    Type pos_zero = Bits::zero().get_val();                                    \
+    Type neg_zero = -pos_zero;                                                 \
+    Type pos_inf = Bits::inf().get_val();                                      \
+    Type neg_inf = Bits::inf(Sign::NEG).get_val();                             \
+    Type nan = NAN;                                                            \
+    Type pos_normal = Type(3.14);                                              \
+    Type neg_normal = Type(-2.71);                                             \
+    Type pos_large = Type(1000000.0);                                          \
+    Type neg_large = Type(-1000000.0);                                         \
+                                                                               \
+    EXPECT_TRUE(equals(pos_zero, pos_zero));                                   \
+    EXPECT_TRUE(equals(neg_zero, neg_zero));                                   \
+    EXPECT_TRUE(equals(pos_inf, pos_inf));                                     \
+    EXPECT_TRUE(equals(neg_inf, neg_inf));                                     \
+    EXPECT_TRUE(equals(pos_normal, pos_normal));                               \
+    EXPECT_TRUE(equals(neg_normal, neg_normal));                               \
+                                                                               \
+    EXPECT_TRUE(equals(pos_zero, neg_zero));                                   \
+    EXPECT_TRUE(equals(neg_zero, pos_zero));                                   \
+                                                                               \
+    EXPECT_FALSE(equals(pos_normal, neg_normal));                              \
+    EXPECT_FALSE(equals(pos_normal, pos_large));                               \
+    EXPECT_FALSE(equals(pos_inf, neg_inf));                                    \
+    EXPECT_FALSE(equals(pos_inf, pos_normal));                                 \
+    EXPECT_FALSE(equals(neg_inf, neg_normal));                                 \
+    EXPECT_FALSE(equals(pos_large, neg_large));                                \
+                                                                               \
+    EXPECT_FALSE(equals(nan, nan));                                            \
+    EXPECT_FALSE(equals(nan, pos_normal));                                     \
+    EXPECT_FALSE(equals(nan, pos_zero));                                       \
+    EXPECT_FALSE(equals(nan, pos_inf));                                        \
+    EXPECT_FALSE(equals(pos_normal, nan));                                     \
+  }
+
+#define TEST_NOT_EQUALS(Name, Type)                                            \
+  TEST(LlvmLibc##Name##ComparisionOperationsTest, NotEquals) {                                \
+    using Bits = LIBC_NAMESPACE::fputil::FPBits<Type>;                         \
+    Type pos_zero = Bits::zero().get_val();                                    \
+    Type neg_zero = Bits::zero(Sign::NEG).get_val();                           \
+    Type pos_inf = Bits::inf().get_val();                                      \
+    Type neg_inf = Bits::inf(Sign::NEG).get_val();                             \
+    Type nan = NAN;                                                            \
+    Type pos_normal = Type(3.14);                                              \
+    Type neg_normal = Type(-2.71);                                             \
+    Type pos_large = Type(1000000.0);                                          \
+    Type neg_large = Type(-1000000.0);                                         \
+                                                                               \
+    EXPECT_FALSE(not_equals(pos_zero, pos_zero));                              \
+    EXPECT_FALSE(not_equals(pos_zero, neg_zero));                              \
+    EXPECT_FALSE(not_equals(pos_inf, pos_inf));                                \
+    EXPECT_FALSE(not_equals(neg_inf, neg_inf));                                \
+    EXPECT_FALSE(not_equals(pos_normal, pos_normal));                          \
+                                                                               \
+    EXPECT_TRUE(not_equals(pos_normal, neg_normal));                           \
+    EXPECT_TRUE(not_equals(pos_inf, neg_inf));                                 \
+    EXPECT_TRUE(not_equals(pos_normal, pos_zero));                             \
+    EXPECT_TRUE(not_equals(pos_large, neg_large));                             \
+    EXPECT_TRUE(not_equals(pos_inf, pos_normal));                              \
+                                                                               \
+    EXPECT_TRUE(not_equals(nan, nan));                                         \
+    EXPECT_TRUE(not_equals(nan, pos_normal));                                  \
+    EXPECT_TRUE(not_equals(nan, pos_zero));                                    \
+    EXPECT_TRUE(not_equals(nan, pos_inf));                                     \
+    EXPECT_TRUE(not_equals(pos_normal, nan));                                  \
+  }
+
+#define TEST_LESS_THAN(Name, Type)                                             \
+  TEST(LlvmLibc##Name##ComparisionOperationsTest, LessThan) {                                 \
+    using Bits = LIBC_NAMESPACE::fputil::FPBits<Type>;                         \
+    Type pos_zero = Bits::zero().get_val();                                    \
+    Type neg_zero = -pos_zero;                                                 \
+    Type pos_inf = Bits::inf().get_val();                                      \
+    Type neg_inf = Bits::inf(Sign::NEG).get_val();                             \
+    Type nan = NAN;                                                            \
+    Type pos_small = Type(0.1);                                                \
+    Type neg_small = Type(-0.1);                                               \
+    Type pos_large = Type(1000000.0);                                          \
+    Type neg_large = Type(-1000000.0);                                         \
+                                                                               \
+    EXPECT_TRUE(less_than(neg_small, pos_small));                              \
+    EXPECT_TRUE(less_than(pos_small, pos_large));                              \
+    EXPECT_TRUE(less_than(neg_large, neg_small));                              \
+    EXPECT_FALSE(less_than(pos_large, pos_small));                             \
+    EXPECT_FALSE(less_than(pos_small, neg_small));                             \
+                                                                               \
+    EXPECT_FALSE(less_than(pos_zero, neg_zero));                               \
+    EXPECT_FALSE(less_than(neg_zero, pos_zero));                               \
+    EXPECT_FALSE(less_than(pos_zero, pos_zero));                               \
+                                                                               \
+    EXPECT_TRUE(less_than(neg_small, pos_zero));                               \
+    EXPECT_TRUE(less_than(neg_zero, pos_small));                               \
+    EXPECT_FALSE(less_than(pos_small, pos_zero));                              \
+                                                                               \
+    EXPECT_TRUE(less_than(neg_inf, pos_inf));                                  \
+    EXPECT_TRUE(less_than(neg_inf, neg_small));                                \
+    EXPECT_TRUE(less_than(pos_small, pos_inf));                                \
+    EXPECT_FALSE(less_than(pos_inf, pos_small));                               \
+                                                                               \
+    EXPECT_FALSE(less_than(pos_small, pos_small));                             \
+    EXPECT_FALSE(less_than(neg_inf, neg_inf));                                 \
+                                                                               \
+    EXPECT_FALSE(less_than(nan, pos_small));                                   \
+    EXPECT_FALSE(less_than(pos_small, nan));                                   \
+    EXPECT_FALSE(less_than(nan, nan));                                         \
+  }
+
+#define TEST_GREATER_THAN(Name, Type)                                          \
+  TEST(LlvmLibc##Name##ComparisionOperationsTest, GreaterThan) {                              \
+    using Bits = LIBC_NAMESPACE::fputil::FPBits<Type>;                         \
+    Type pos_zero = Bits::zero().get_val();                                    \
+    Type neg_zero = -pos_zero;                                                 \
+    Type pos_inf = Bits::inf().get_val();                                      \
+    Type neg_inf = Bits::inf(Sign::NEG).get_val();                             \
+    Type nan = NAN;                                                            \
+    Type pos_small = Type(0.1);                                                \
+    Type neg_small = Type(-0.1);                                               \
+    Type pos_large = Type(1000000.0);                                          \
+    Type neg_large = Type(-1000000.0);                                         \
+                                                                               \
+    EXPECT_TRUE(greater_than(pos_small, neg_small));                           \
+    EXPECT_TRUE(greater_than(pos_large, pos_small));                           \
+    EXPECT_TRUE(greater_than(neg_small, neg_large));                           \
+    EXPECT_FALSE(greater_than(pos_small, pos_large));                          \
+    EXPECT_FALSE(greater_than(neg_small, pos_small));                          \
+                                                                               \
+    EXPECT_FALSE(greater_than(pos_zero, neg_zero));                            \
+    EXPECT_FALSE(greater_than(neg_zero, pos_zero));                            \
+                                                                               \
+    EXPECT_TRUE(greater_than(pos_inf, neg_inf));                               \
+    EXPECT_TRUE(greater_than(pos_inf, pos_small));                             \
+    EXPECT_TRUE(greater_than(pos_small, neg_inf));                             \
+    EXPECT_FALSE(greater_than(neg_inf, pos_inf));                              \
+                                                                               \
+    EXPECT_FALSE(greater_than(pos_small, pos_small));                          \
+    EXPECT_FALSE(greater_than(pos_inf, pos_inf));                              \
+                                                                               \
+    EXPECT_FALSE(greater_than(nan, pos_small));                                \
+    EXPECT_FALSE(greater_than(pos_small, nan));                                \
+    EXPECT_FALSE(greater_than(nan, nan));                                      \
+  }
+
+#define TEST_LESS_THAN_OR_EQUALS(Name, Type)                                   \
+  TEST(LlvmLibc##Name##ComparisionOperationsTest, LessThanOrEquals) {                         \
+    using Bits = LIBC_NAMESPACE::fputil::FPBits<Type>;                         \
+    Type pos_zero = Bits::zero().get_val();                                    \
+    Type neg_zero = -pos_zero;                                                 \
+    Type pos_inf = Bits::inf().get_val();                                      \
+    Type neg_inf = Bits::inf(Sign::NEG).get_val();                             \
+    Type nan = NAN;                                                            \
+    Type pos_small = Type(0.1);                                                \
+    Type neg_small = Type(-0.1);                                               \
+    Type pos_large = Type(1000000.0);                                          \
+    Type neg_large = Type(-1000000.0);                                         \
+                                                                               \
+    EXPECT_TRUE(less_than_or_equals(neg_small, pos_small));                    \
+    EXPECT_TRUE(less_than_or_equals(pos_small, pos_large));                    \
+    EXPECT_TRUE(less_than_or_equals(neg_inf, pos_small));                      \
+                                                                               \
+    EXPECT_TRUE(less_than_or_equals(pos_small, pos_small));                    \
+    EXPECT_TRUE(less_than_or_equals(pos_zero, neg_zero));                      \
+    EXPECT_TRUE(less_than_or_equals(pos_inf, pos_inf));                        \
+                                                                               \
+    EXPECT_FALSE(less_than_or_equals(pos_small, neg_small));                   \
+    EXPECT_FALSE(less_than_or_equals(pos_large, pos_small));                   \
+    EXPECT_FALSE(less_than_or_equals(pos_inf, pos_small));                     \
+                                                                               \
+    EXPECT_TRUE(less_than_or_equals(neg_large, pos_small));                    \
+    EXPECT_FALSE(less_than_or_equals(pos_large, neg_small));                   \
+                                                                               \
+    EXPECT_FALSE(less_than_or_equals(nan, pos_small));                         \
+    EXPECT_FALSE(less_than_or_equals(pos_small, nan));                         \
+    EXPECT_FALSE(l...
[truncated]

@overmighty overmighty requested review from lntue and overmighty June 20, 2025 09:08
@krishna2803 krishna2803 requested a review from overmighty July 4, 2025 14:19
@@ -0,0 +1,331 @@
//===-- Unittests for Comparison Operations for FPBits class -------------===//
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: formatting.

Suggested change
//===-- Unittests for Comparison Operations for FPBits class -------------===//
//===-- Unittests for Comparison Operations for FPBits class --------------===//

Copy link
Member

@overmighty overmighty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had an extra review comment I thought I had sent but seemingly didn't.

Copy link
Member

@overmighty overmighty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM if you can confirm that the tests pass locally (I currently don't have access to my laptop.)

@krishna2803
Copy link
Contributor Author

All ninja check-libc checks are passing in overlay mode locally.
I'm not sure why full build mode is failing in the CI though. Might be because of some other bug.

@lntue
Copy link
Contributor

lntue commented Jul 21, 2025

All ninja check-libc checks are passing in overlay mode locally. I'm not sure why full build mode is failing in the CI though. Might be because of some other bug.

the full build CIs are having some issues. Can you manually test the full build config locally?

@lntue lntue merged commit e789f8b into llvm:main Jul 22, 2025
14 of 19 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 22, 2025

LLVM Buildbot has detected a new failure on builder premerge-monolithic-linux running on premerge-linux-1 while building libc at step 7 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/153/builds/38975

Here is the relevant piece of the build log for the reference
Step 7 (test-build-unified-tree-check-all) failure: test (failure)
...
PASS: lld :: COFF/dllexport-mingw.s (98789 of 101795)
PASS: lld :: COFF/dtlto/files.test (98790 of 101795)
PASS: lld :: COFF/duplicate-cv.s (98791 of 101795)
PASS: lld :: COFF/delayimports32.test (98792 of 101795)
PASS: lld :: COFF/dtlto/options.test (98793 of 101795)
PASS: lld :: COFF/duplicate.test (98794 of 101795)
PASS: lld :: COFF/arm64x-import.test (98795 of 101795)
PASS: lld :: COFF/dllexport.s (98796 of 101795)
PASS: lit :: shtest-external-shell-kill.py (98797 of 101795)
TIMEOUT: MLIR :: Examples/standalone/test.toy (98798 of 101795)
******************** TEST 'MLIR :: Examples/standalone/test.toy' FAILED ********************
Exit Code: 1
Timeout: Reached timeout of 60 seconds

Command Output (stdout):
--
# RUN: at line 1
"/etc/cmake/bin/cmake" "/build/buildbot/premerge-monolithic-linux/llvm-project/mlir/examples/standalone" -G "Ninja"  -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_C_COMPILER=/usr/bin/clang  -DLLVM_ENABLE_LIBCXX=OFF -DMLIR_DIR=/build/buildbot/premerge-monolithic-linux/build/lib/cmake/mlir  -DLLVM_USE_LINKER=lld  -DPython3_EXECUTABLE="/usr/bin/python3.10"
# executed command: /etc/cmake/bin/cmake /build/buildbot/premerge-monolithic-linux/llvm-project/mlir/examples/standalone -G Ninja -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_C_COMPILER=/usr/bin/clang -DLLVM_ENABLE_LIBCXX=OFF -DMLIR_DIR=/build/buildbot/premerge-monolithic-linux/build/lib/cmake/mlir -DLLVM_USE_LINKER=lld -DPython3_EXECUTABLE=/usr/bin/python3.10
# .---command stdout------------
# | -- The CXX compiler identification is Clang 16.0.6
# | -- The C compiler identification is Clang 16.0.6
# | -- Detecting CXX compiler ABI info
# | -- Detecting CXX compiler ABI info - done
# | -- Check for working CXX compiler: /usr/bin/clang++ - skipped
# | -- Detecting CXX compile features
# | -- Detecting CXX compile features - done
# | -- Detecting C compiler ABI info
# | -- Detecting C compiler ABI info - done
# | -- Check for working C compiler: /usr/bin/clang - skipped
# | -- Detecting C compile features
# | -- Detecting C compile features - done
# | -- Looking for histedit.h
# | -- Looking for histedit.h - found
# | -- Found LibEdit: /usr/include (found version "2.11") 
# | -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11") 
# | -- Found LibXml2: /usr/lib/x86_64-linux-gnu/libxml2.so (found version "2.9.13") 
# | -- Using MLIRConfig.cmake in: /build/buildbot/premerge-monolithic-linux/build/lib/cmake/mlir
# | -- Using LLVMConfig.cmake in: /build/buildbot/premerge-monolithic-linux/build/lib/cmake/llvm
# | -- Linker detection: unknown
# | -- Performing Test LLVM_LIBSTDCXX_MIN
# | -- Performing Test LLVM_LIBSTDCXX_MIN - Success
# | -- Performing Test LLVM_LIBSTDCXX_SOFT_ERROR
# | -- Performing Test LLVM_LIBSTDCXX_SOFT_ERROR - Success
# | -- Performing Test CXX_SUPPORTS_CUSTOM_LINKER
# | -- Performing Test CXX_SUPPORTS_CUSTOM_LINKER - Success
# | -- Performing Test C_SUPPORTS_FPIC
# | -- Performing Test C_SUPPORTS_FPIC - Success
# | -- Performing Test CXX_SUPPORTS_FPIC

@krishna2803 krishna2803 deleted the comp-ops branch July 23, 2025 04:03
rupprecht added a commit to rupprecht/llvm-project that referenced this pull request Jul 23, 2025
rupprecht added a commit that referenced this pull request Jul 23, 2025
rupprecht added a commit that referenced this pull request Jul 23, 2025
I believe this is from #150087 and #144983, but I didn't confirm
specific commits.
mahesh-attarde pushed a commit to mahesh-attarde/llvm-project that referenced this pull request Jul 28, 2025
…es (llvm#144983)

The PR implements the following generic comparison operation functions
for floating point types along with unittests:
- `fputil::equals`
- `fputil::less_than`
- `fputil::less_than_or_equals`
- `fputil::greater_than`
- `fputil::greater_than_or_equals`

---------

Signed-off-by: krishna2803 <[email protected]>
Signed-off-by: Krishna Pandey <[email protected]>
Co-authored-by: OverMighty <[email protected]>
mahesh-attarde pushed a commit to mahesh-attarde/llvm-project that referenced this pull request Jul 28, 2025
mahesh-attarde pushed a commit to mahesh-attarde/llvm-project that referenced this pull request Jul 28, 2025
I believe this is from llvm#150087 and llvm#144983, but I didn't confirm
specific commits.
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.

5 participants