summaryrefslogtreecommitdiff
path: root/mini-gmp
diff options
context:
space:
mode:
authorMarco Bodrato <bodrato@mail.dm.unipi.it>2019-11-19 15:47:07 +0100
committerMarco Bodrato <bodrato@mail.dm.unipi.it>2019-11-19 15:47:07 +0100
commit83db8ace04f95ec835a0445e933bba305b48406f (patch)
tree3b6db25dfcef3ea221415fc4503b0f6659145009 /mini-gmp
parent14509aa477876e818aa609ddd9c999bdd02b9bce (diff)
downloadgmp-83db8ace04f95ec835a0445e933bba305b48406f.tar.gz
mini-gmp/mini-gmp.c (mpn_invert_3by2): Move an assert earlier.
Diffstat (limited to 'mini-gmp')
-rw-r--r--mini-gmp/mini-gmp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mini-gmp/mini-gmp.c b/mini-gmp/mini-gmp.c
index c27235d44..a1e9047c7 100644
--- a/mini-gmp/mini-gmp.c
+++ b/mini-gmp/mini-gmp.c
@@ -771,6 +771,8 @@ mp_limb_t
mpn_invert_3by2 (mp_limb_t u1, mp_limb_t u0)
{
int GMP_LIMB_BITS_MUL_3 = GMP_LIMB_BITS * 3;
+ assert (u1 >= GMP_LIMB_HIGHBIT);
+
if (sizeof (unsigned) * CHAR_BIT > GMP_LIMB_BITS * 3)
{
return (((unsigned) 1 << GMP_LIMB_BITS_MUL_3) - 1) /
@@ -795,8 +797,6 @@ mpn_invert_3by2 (mp_limb_t u1, mp_limb_t u0)
mp_limb_t p, ql;
unsigned ul, uh, qh;
- assert (u1 >= GMP_LIMB_HIGHBIT);
-
/* For notation, let b denote the half-limb base, so that B = b^2.
Split u1 = b uh + ul. */
ul = u1 & GMP_LLIMB_MASK;