From 9cc3e786e61fd9a3604beaf1b882e5c31a8592d1 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 25 Sep 2024 17:42:13 -0700 Subject: [PATCH] factor: tweak gcd_odd performance * src/factor.c (gcd_odd): Use stdc_trailing_zeros instead of counting zeros by hand. --- src/factor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/factor.c b/src/factor.c index 0e9e703df4..13fb92f8de 100644 --- a/src/factor.c +++ b/src/factor.c @@ -413,8 +413,8 @@ gcd_odd (uintmax_t a, uintmax_t b) uintmax_t t; uintmax_t bgta; - while ((a & 1) == 0) - a >>= 1; + assume (a); + a >>= stdc_trailing_zeros (a); a >>= 1; t = a - b; -- 2.47.2