[PATCH v3 6/6] powerpc: Use generic ilogb/ilogbf and refactor ilogbf128
Sachin Monga
smonga@linux.ibm.com
Mon Jun 9 13:01:15 GMT 2025
>+/* Use the double version of EDOM/invalid operation handling. */
>+#include "math_config.h"
>+
>+static RET_TYPE
>+llogb_nan_inf_subnormal (uint64_t hx, uint64_t lx)
>+{
>+ if (hx <= 0x0001000000000000ULL)
>+ {
>+ /* Zero or subnormal. */
>+ if ((hx | lx) == 0)
>+ return RET_INVALID (RET_LOGB0);
>+ /* Subnormal */
>+ if (hx == 0)
>+ return -16431L - stdc_leading_zeros (lx);
>+ else
>+ return -16382L - stdc_leading_zeros (hx << 15);
>+ }
>+ return RET_INVALID (RET_LOGBNAN);
>+}
Trivial but can we use macros for constants(16431 or 16382) for better
readability ?
Otherwise looks good to me.
I am yet to check test-results though.
PS: Peter's IBM mail id is inactive now as he is not part of IBM anymore.
Regards:
Sachin.
On 30/05/25 7:58 pm, Wilco Dijkstra wrote:
> Hi,
>
> I'll leave this part to Peter, but overall the results seem good.
>
> Cheers,
> Wilco
More information about the Libc-alpha
mailing list