YoushouldhavereceivedcopiesoftheGNUGeneralPublicLicenseandthe GNULesserGeneralPublicLicensealongwiththeGNUMPLibrary.Ifnot,
see https://www.gnu.org/licenses/. */
Itmightbepossiblytousefloatingpoint.Theloopisdominatedby multiplylatency,sonotsureiffloatswouldimprovethat.One possibilitywouldbetotaketwolimbsatatime,witha128bitinverse, ifthere'senoughregisters,whichcouldeffectivelyusefloatthroughput
to reduce total latency across two limbs. */
#define ASSERT_RETVAL(r) \
ASSERT (orig_c < d ? r < d : r <= d)
/* udivx is faster than 10 or 12 mulx's for one limb via an inverse */ if (size == 1)
{
s = src[0]; if (s > c)
{
l = s-c;
h = l % d; if (h != 0)
h = d - h;
} else
{
l = c-s;
h = l % d;
} return h;
}
binvert_limb (inverse, d);
if (d <= 0xFFFFFFFF)
{
s = *src++;
size--; do
{
SUBC_LIMB (c, l, s, c);
s = *src++;
q = l * inverse;
umul_ppmm_half_lowequal (h, q, d, l);
c += h;
size--;
} while (size != 0);
if (s <= d)
{ /* With high s <= d the final step can be a subtract and addback. Ifc==0thentheaddbackwillrestoretol>=0.Ifc==dthen willgetl==difs==0,butthat'sokperthefunction
definition. */
l = c - s;
l += (l > c ? d : 0);
ASSERT_RETVAL (l); return l;
} else
{ /* Can't skip a divide, just do the loop code once more. */
SUBC_LIMB (c, l, s, c);
q = l * inverse;
umul_ppmm_half_lowequal (h, q, d, l);
c += h;
s = *src++;
size--; do
{
SUBC_LIMB (c, l, s, c);
s = *src++;
q = l * inverse;
umul_ppmm_lowequal (h, q, d, dh, dl, l);
c += h;
size--;
} while (size != 0);
if (s <= d)
{ /* With high s <= d the final step can be a subtract and addback. Ifc==0thentheaddbackwillrestoretol>=0.Ifc==dthen willgetl==difs==0,butthat'sokperthefunction
definition. */
l = c - s;
l += (l > c ? d : 0);
ASSERT_RETVAL (l); return l;
} else
{ /* Can't skip a divide, just do the loop code once more. */
SUBC_LIMB (c, l, s, c);
q = l * inverse;
umul_ppmm_lowequal (h, q, d, dh, dl, l);
c += h;
ASSERT_RETVAL (c); return c;
}
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-09-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.