From: Paul Eggert Date: Wed, 2 Jul 2025 21:46:00 +0000 (-0700) Subject: factor: tune submod2 X-Git-Tag: v9.8~194 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=73bb62f7dfe25d9beac0cc5e8e55ad708f0dc5e5;p=thirdparty%2Fcoreutils.git factor: tune submod2 * src/factor.c (submod2): Use ckd_sub to subtract by hand rather than using sub_ddmmss plus a compare. This speeds things up a bit, on x86-64 with GCC 15 anyway. --- diff --git a/src/factor.c b/src/factor.c index cdb31dda0b..79eeabe829 100644 --- a/src/factor.c +++ b/src/factor.c @@ -428,8 +428,9 @@ gt2 (mp_limb_t ah, mp_limb_t al, mp_limb_t bh, mp_limb_t bl) } while (0) #define submod2(r1, r0, a1, a0, b1, b0, n1, n0) \ do { \ - sub_ddmmss (r1, r0, a1, a0, b1, b0); \ - if ((r1) >> (W_TYPE_SIZE - 1) != 0) \ + bool _v1 = ckd_sub (&(r1), a1, b1); \ + mp_limb_t _v0 = ckd_sub (&(r0), a0, b0); \ + if (_v1 | ckd_sub (&(r1), r1, _v0)) \ add_ssaaaa (r1, r0, r1, r0, n1, n0); \ } while (0)