[libc-commits] [libc] [libc][math] Remove constexpr from bfloat16 comparison operations (PR #150227)

via libc-commits libc-commits at lists.llvm.org
Wed Jul 23 07:21:37 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Krishna Pandey (krishna2803)

<details>
<summary>Changes</summary>

cc @<!-- -->lntue @<!-- -->overmighty 

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


1 Files Affected:

- (modified) libc/src/__support/FPUtil/bfloat16.h (+6-6) 


``````````diff
diff --git a/libc/src/__support/FPUtil/bfloat16.h b/libc/src/__support/FPUtil/bfloat16.h
index 05edbba048cb7..84a0dca911691 100644
--- a/libc/src/__support/FPUtil/bfloat16.h
+++ b/libc/src/__support/FPUtil/bfloat16.h
@@ -59,27 +59,27 @@ struct BFloat16 {
     return cpp::bit_cast<float>(x_bits);
   }
 
-  LIBC_INLINE constexpr bool operator==(BFloat16 other) const {
+  LIBC_INLINE bool operator==(BFloat16 other) const {
     return fputil::equals(*this, other);
   }
 
-  LIBC_INLINE constexpr bool operator!=(BFloat16 other) const {
+  LIBC_INLINE bool operator!=(BFloat16 other) const {
     return !fputil::equals(*this, other);
   }
 
-  LIBC_INLINE constexpr bool operator<(BFloat16 other) const {
+  LIBC_INLINE bool operator<(BFloat16 other) const {
     return fputil::less_than(*this, other);
   }
 
-  LIBC_INLINE constexpr bool operator<=(BFloat16 other) const {
+  LIBC_INLINE bool operator<=(BFloat16 other) const {
     return fputil::less_than_or_equals(*this, other);
   }
 
-  LIBC_INLINE constexpr bool operator>(BFloat16 other) const {
+  LIBC_INLINE bool operator>(BFloat16 other) const {
     return fputil::greater_than(*this, other);
   }
 
-  LIBC_INLINE constexpr bool operator>=(BFloat16 other) const {
+  LIBC_INLINE bool operator>=(BFloat16 other) const {
     return fputil::greater_than_or_equals(*this, other);
   }
 }; // struct BFloat16

``````````

</details>


https://github.com/llvm/llvm-project/pull/150227


More information about the libc-commits mailing list