• Herbert Valerio Riedel's avatar
    Wrap `gmpz_fdiv_{q,r,qr}_ui` to optimize `div`/`mod` · d075e1c2
    Herbert Valerio Riedel authored
    This is similiar to what has been done in [af2ba9c8/integer-gmp] for
    `gmpz_tdiv_{q,r,qr}_ui` (re #8647); However, the gain is more modest
    here, as performance-conscious code tends to use `quot`/`rem` rather
    than `div`/`mod`:
    
         Program    Size    Allocs   Runtime   Elapsed  TotalMem
     -------------------------------------------------------------
       primetest   +0.3%     -2.4%      0.06      0.06     +0.0%
             rsa   +0.2%     -3.3%      0.02      0.02     +0.0%
    Signed-off-by: Herbert Valerio Riedel's avatarHerbert Valerio Riedel <hvr@gnu.org>
    d075e1c2
Prim.hs 11.4 KB