From e33bd4aaa2d6558fc1b008cd2e3bcc5c4f392be2 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 4 Feb 2026 19:41:41 +0100 Subject: libbb: use narrow isqrt() when 64-bit one is not needed (only "factor" uses it) function old new delta isqrt_ull - 84 +84 create_J 1809 1808 -1 isqrt 106 38 -68 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/2 up/down: 84/-69) Total: 15 bytes Signed-off-by: Denys Vlasenko --- include/libbb.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include/libbb.h') diff --git a/include/libbb.h b/include/libbb.h index aacff42ee..7cca925b9 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -408,7 +408,12 @@ unsigned FAST_FUNC bb_popcnt_long(unsigned long m); #define bb_popcnt_long(m) bb_popcnt_32(m) #endif -unsigned long FAST_FUNC isqrt(unsigned long long N); +unsigned FAST_FUNC isqrt(unsigned long N); +#if LLONG_MAX > LONG_MAX +unsigned long FAST_FUNC isqrt_ull(unsigned long long N); +#else +# define isqrt_ull(N) isqrt(N) +#endif unsigned long long monotonic_ns(void) FAST_FUNC; unsigned long long monotonic_us(void) FAST_FUNC; -- cgit v1.2.3-55-g6feb