[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:38:27 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:
ohh it makes sense now, i thought it is relying on "quick_get_round" this function and i thought it is using volatile keyword and it cant be constexpr so i added gaurds for that piece of code .
Actually it dont need any king of guards so sorry... i'll update the things and i'll make another commit
https://github.com/llvm/llvm-project/pull/194137
More information about the libc-commits
mailing list