Tuning framework

Kevin Ryde user42 at zip.com.au
Wed Nov 19 08:45:13 CET 2003


nisse at lysator.liu.se (Niels Möller) writes:
>
> The first threshold I want to
> tune i HGCD_SCHOENHAGE_THRESHOLD, so I added some magic to gmp-impl.h,
> just like the other tuned thresholds.

The key is to start with good measured results (speed.c) and then
automate the process of comparing them against other algorithms or
looking at the effect of parameters in the code (tuneup.c).

>     /* FIXME: Figure out if caller guarantees normalization. */

No, xp and yp data can be anything.

>     /* FIXME: It may happen (with low probability) that asize or bsize
>        are too small. What to do then? */

You're probably best off forcing the high limb to non-zero, to get an
operation of the intended s->size limbs.  Make a copy of s->xp,yp to
do that, don't just change them.

But if the size is still not to your liking you can return -1.0 to say
measurement not possible.


More information about the gmp-devel mailing list