[libc-commits] [libc] [libc][math] Remove constexpr from bfloat16 comparison operations (PR #150227)
Krishna Pandey via libc-commits
libc-commits at lists.llvm.org
Wed Jul 23 07:21:02 PDT 2025
https://github.com/krishna2803 created https://github.com/llvm/llvm-project/pull/150227
cc @lntue @overmighty
>From de4fa4ab66132fa85b3bd3dec395b001068786c0 Mon Sep 17 00:00:00 2001
From: Krishna Pandey <kpandey81930 at gmail.com>
Date: Wed, 23 Jul 2025 19:49:42 +0530
Subject: [PATCH] fix: remove constexpr from bfloat16 comparison operationsn
Signed-off-by: Krishna Pandey <kpandey81930 at gmail.com>
---
libc/src/__support/FPUtil/bfloat16.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
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
More information about the libc-commits
mailing list