4 #include <math_private.h>
7 #if _GL_HAS_BUILTIN_ILOGB
9 M_DECL_FUNC (__llogb
) (FLOAT x
)
12 /* Check for exceptional cases. */
13 if (! M_SUF(__builtin_test_dc_ilogb
) (x
, 0x7f))
14 r
= M_SUF (__builtin_ilogb
) (x
);
16 /* Fallback to the generic ilogb if x is NaN, Inf or subnormal. */
17 r
= M_SUF (__ieee754_ilogb
) (x
);
19 if (__glibc_unlikely (r
== FP_ILOGB0
)
20 || __glibc_unlikely (r
== FP_ILOGBNAN
)
21 || __glibc_unlikely (r
== INT_MAX
))
23 #if LONG_MAX != INT_MAX
26 else if (r
== FP_ILOGBNAN
)
32 __feraiseexcept (FE_INVALID
);
36 declare_mgen_alias (__llogb
, llogb
)
38 #include <math/w_llogb_template.c>