[libc-commits] [libc] [libc][math] Qualify fdim funtions to constexpr (PR #194137)
Kiriti Ponduri via libc-commits
libc-commits at lists.llvm.org
Sat Apr 25 14:32:49 PDT 2026
================
@@ -132,11 +148,15 @@ add_or_sub(InType x, InType y) {
InType y_abs = y_bits.abs().get_val();
if (x_abs == y_abs && !is_effectively_add) {
- switch (fputil::quick_get_round()) {
- case FE_DOWNWARD:
- return OutFPBits::zero(Sign::NEG).get_val();
- default:
+ if (__builtin_is_constant_evaluated()) {
return OutFPBits::zero(Sign::POS).get_val();
----------------
udaykiriti wrote:
> What is the problem with the `switch` statement?
wait wait i'll update the update.. after i've completed this.
https://github.com/llvm/llvm-project/pull/194137
More information about the libc-commits
mailing list