GMP «Arithmetic without limitations»
symbol meaning
*   no estimate, but write!
( )   estimate, not tested
{ }   known speed, tested
[ ]   more or less ready to check in
15  slow code that is disabled by means of gmp-mparam.h
  eligible for replacement
a   anomaly; more general function is faster
m - n   m c/l to n c/l depending on operand properties (e.g., overlap)
m \ n   m c/l sometimes degenerating to n c/l
GMP assembly chart


This is a chart with performance numbers in cycles/limb for many mpn (i.e., low-level) functions of GMP. A straight number without any special annotations means that the mpn function of that line is implemented for the CPU of that column either in the official repository or in a local repository of a maintainer. For annotated numbers, please see the table above.

To compare these numbers fairly, 32-bit machines should only be compared to 32-bit machines, and 64-bit machines should only be compared to 64-bit machines. A 64-bit machine performs twice the amount of work for many functions, but 4 times the work for multiply primitives, compared to 32-bit machines.

AMD
K7
32
Intel
North
32
Intel
Presc
32
Intel
Copp
32
Intel
Doth
32
Intel
Atom
32
AMD
K8
64
AMD
K10
64
AMD
BD1
64
AMD
BD4
64
AMD
Zen
64
AMD
BT1
64
AMD
BT2
64
Intel
Nocona
64
Intel
PNR
64
Intel
NHM
64
Intel
SBR
64
Intel
IBR
64
Intel
HWL
64
Intel
BWL
64
Intel
SKY
64
Intel
Atom
64
Intel
SLM
64
Intel
GLM
64
add_n
1.64{1.5}
4 4.25
3.19[2.75]
2.14 3 1.5 1.5 1.5 1.6 1.5 2.28 2 4 2 2 1.55 1.5 1.21 1.04 1.21 3 3 2.17 add_n
sub_n
1.64{1.5}
4 4.25
3.19[2.75]
2.14 3 1.5 1.5 1.5 1.6 1.5 2.28 2 4 2 2 1.55 1.5 1.21 1.04 1.21 3 3 2.17 sub_n
addlsh1_n 2.5 4.25 5 6 2
2{1.69}
2.3 2.0 1.54 2.875
2.88[2.67]
5.8 3.1 2.75 1.95
1.89{1.67}
1.8{1.64}
1.53 1.51 4.875 4 3.15 addlsh1_n
sublsh1_n 2.87 6.667 2.18
2.18{2}
2.3 2.0 1.58 3.25 3.25 5.8 3
3.1{2.5}
2.47{2.17}
2.36{2}
2.11 1.67 1.65 5 4.8 sublsh1_n
rsblsh1_n 6 2
2{1.69}
2.3 2.0 1.54 2.875
2.88[2.67]
13.75 3.1 2.75 1.95
1.89{1.67}
1.8{1.64}
1.53 1.51 4.875 4 3.15 rsblsh1_n
addlsh2_n 6 2.1 2 2.7 2.25 a2.0 3.3 3 5.8 3.1 2.75 2 1.89 1.8 1.52 1.51 5.75 4 3.3 addlsh2_n
sublsh2_n 7 5.8 3 3.1 2.47 2.36 2.11 1.67 1.65 sublsh2_n
rsblsh2_n 6 2.1 2 2.7 2.25 a2.0 3.3 3 13 3.1 2.75 2 1.89 1.8 1.52 1.51 5.75 4 3.3 rsblsh2_n
addlsh_n a2.87 a2.75 4.2 2.33 1.69
5.46{4.3}
5-6.6
[4.67]
15 3 2.8 2.75 2.71 2.07 a1.78 a1.78
7.75{6}
7.17 4 addlsh_n
sublsh_n
{2.5-3.25}
{2.5-3.25}
{2.75}
{2.75}
{3}
sublsh_n
rsblsh_n a2.87 a2.75 4.2 2.33 1.69
5.46{4.3}
5-6.6
[4.67]
15 3 2.8 2.75 2.78 2.07 a1.78 a1.78
7.75{6}
7.17 4 rsblsh_n
lshsub_n lshsub_n
add_n_sub_n
[2.5]
[2.5]
add_n_sub_n
rsh1add_n 4.5 5.25 2
2{1.67}
2.75 2.21 1.91
3.25{2.7}
3 5.63
3.1{2.7}
3.3{2.77}
2.05 2.03 2.04 1.6 1.53 5.25 5.3 4.3 rsh1add_n
rsh1sub_n 2
2{1.67}
2.75 2.21 1.91
3.25{2.7}
3 5.63
3.1{2.7}
3.3{2.77}
2.05 2.03 2.04 1.6 1.53 5.25 5.3 4.3 rsh1sub_n
cnd_add_n 3.4 5 5.25
5.77{4.0}
4.67 4.58
2[1.9]
2[1.9]
2.32 1.95 1.67 3 3 13 2.9 2.8 1.93 1.89 1.78 1.5 1.5 4.58
4.3{3.25}
3 cnd_add_n
cnd_sub_n 3.4 5 5.25
5.77{4.0}
4.67 5.59 2 2 2.32 1.95 1.67 3 3 13 2.9 2.8 2.15 1.96 2.0 1.65 1.65 5.0 4.3 3 cnd_sub_n
mul_1 3.25 4 4.5
5.60{4.38}
4.16{3.75}
7.5 2.5 2.5 4.5 4.4 2 5 5.2-5.8 13.1 4 3.75 2.5
2.3{2}
1.57 1.51 1.52 17.3 7.8 3.78 mul_1
mul_1c Y Y Y N Y Y Y Y Y ? Y Y Y Y Y Y Y Y N N N Y Y mul_1c
addmul_1 3.75
5{4}
5
6.43{5.63}
5.21{4.75}
8 2.5 2.5 4.6-4.75
{4.95}
2 5 5.2 16 4.25 4.55 3.24
2.96{2.7}
2.31 1.65 1.62 19.37 7.6 4 addmul_1
addmul_1c N N N ? N N N Y N N N N N N N Y addmul_1c
submul_1 3.75 6 6.5
6.43{5.63}
5.5
8 2.5 2.5 4.6-4.75
{4.95}
2 5 5.2 16 4.25 4.55 3.24
2.96{2.7}
2.31 2.06 1.95 19.37 7.6 4 submul_1
mul_2 (4) (4) 2.25 2.25 4.36
{4.65}
2.46 5.62 5.97 13.3 4 3.83 2.57
2.29{2.0}
1.86 2.1 2.08 17.75 8.5 3.65 mul_2
mul_3 mul_3
mul_4 mul_4
mul_5 mul_5
mul_6 mul_6
addmul_2 (4) (4) 2.375 2.375 4.2 4.4 2.48 5.75 5.89 14.3
{4}
{4.06}
2.93
2.6{2.35}
2.15 2.33 2.2 18.8 8.5 3.85 addmul_2
addmul_3 addmul_3
addmul_4 (3) (3) addmul_4
addmul_6 addmul_6
addmul_8 addmul_8
mul_basecase
3.9[3.75]
4.6¹ 6.5 5.3¹ 8.9¹ 2.5¹ 2.5¹ 4.79¹ ? 2.13¹ 5.25¹ 5.36¹ 14.7¹ 4.28¹ 4.24¹ 3.1¹ 2.8¹ 2.31¹ 1.94¹ 1.79¹ 19.8¹ 10.1¹ 3.86¹ mul_basecase
mullo_basecase Y Y Y ? Y Y Y Y Y Y Y Y Y Y Y mullo_basecase
mulmid_basecase Y Y Y ? Y Y mulmid_basecase
mulhi_basecase mulhi_basecase
sqr_basecase
3.9[3.75]
5.3² 5.6² 8.56 6.0² 9.7²
3.0²
3.0²
5.24²
? 2.17² 5.65² 5.76² 15.5² 4.81² 4.54² 3.32² 3.05² 2.42² 2.06² 1.86² 22.9² 11.5² 4.31² sqr_basecase
sqrlo_basecase sqrlo_basecase
sqr_diag_addlsh1 2.5 2.5 3.6 ? 2.43 4 3.8 4 3.6 3.13 3.1 2.5 2.27 2.1 14 6 sqr_diag_addlsh1
redc_1 2.5 2.5 4.87 ?
 
5 ? 4.25 4.5 3.24 3.04 2.31 19.37 ? redc_1
redc_2
{2.375}
{2.375}
redc_2
lshift 1.2 1.75 2 1.8
1.75{1.46}
5 2.35
1.8{1.3}
1.3 1.09 1.5 3.16 1.65 3 1.32 1.30 1.3 1.3
1.17{0.7}
1.15[0.7]
1.15[0.58]
4.5 3 2 lshift
rshift 1.2 1.75 2 1.8
1.75{1.46}
5 2.35
1.8{1.3}
1.3 1.04 1.5 3.16 1.65 3.33 1.32 1.30\2.15 1.3 1.3
1.17{0.7}
1.15[0.7]
1.15[0.58]
4.5 3 2 rshift
lshiftc 6.0 5.5 2.75
2{1.5}
1.4 1.09 1.5 3.7 1.9 3.5 1.52 1.78 1.45 1.42 1.3 1.3 1.27 5 3.5 2.3 lshiftc
copyd 0.75-1
2
2
0.85
0.73{0.5}
1.75{0.5}
1
1[0.85]
0.7 0.53 0.5 1.48 0.64 2.8 0.52-0.8 0.52-0.64 0.52 0.51
0.5[0.25]
0.51[0.26]
0.5[0.25]
1.16-1.66 1
0.8[0.75]
copyd
copyi 0.75-1
1
1.5
0.85
0.73{0.5}
1.75{0.5}
1
1[0.85]
0.7 0.53 0.5 1.48 0.64 2.8 0.52-0.64 0.52-0.71 0.51-0.54 0.51
0.5[0.25]
0.51[0.26]
0.5[0.25]
1.16-1.61 1
0.8[0.75]
copyi
sec_tabselect 1.33 2.1-2.63 1.7-2.57 1.75-2.25 1.33-1.87 1.85-2.7 1.5 0.78-.85 0.8-1.25 ? 2.15 1.25 2.5-2.95 1.17-1.25 0.87-0.9 0.63-0.8 0.63-0.8 0.63-0.8 0.64 0.65 2.5 2.5 sec_tabselect
com 1 1.25
1.18[0.85]
0.9 0.63 0.5 1.75 0.91 2.8 0.64-0.87 0.52-0.65-1.14 0.51-0.65 0.50-0.64 0.51-0.58 0.52-0.64 0.51-0.63 2.75 1
1.06[1]
com
and_n
{1.5}
3 1.5 1.5\2 1.65 1.55 1.5 2.67 2 2.75 2 2 1.5 1.5 1.11 1.09 1.21 3.75 3 2.3 and_n
ior_n
{1.5}
3 1.5 1.5\2 1.65 1.55 1.5 2.67 2 2.75 2 2 1.5 1.5 1.11 1.09 1.21 3.75 3 2.3 ior_n
xor_n
{1.5}
3 1.5 1.5\2 1.65 1.55 1.5 2.67 2 2.75 2 2 1.5 1.5 1.11 1.09 1.21 3.75 3 2.3 xor_n
andn_n
{1.75}
3.5 1.5\2.5 1.5\2 1.9 ? 1.5 2.5-2.75 2.25 3.35 2 2 1.5 1.5 1.35 1.30 1.27 3.75 3 2.3 andn_n
iorn_n
{1.75}
3.5 1.5\2.5 1.5\2 1.9 1.71 1.5 2.5-2.75 2.25 3.35 2 2 1.5 1.5 1.35 1.30 1.27 3.75 3 2.3 iorn_n
xnor_n
{1.75}
3.5 1.5\2.5 1.5\2 1.9 1.71 1.5 2.5 2.25 3.35 2 2 1.5 1.5 1.35 1.30 1.27 3.75 3 2.3 xnor_n
nand_n
{1.75}
3.5 1.5\1.75 1.5\2 2 1.71 1.5 2.5 2.25 3.6 2 2 1.5 1.5 1.35 1.30 1.27 3.75 3 2.35 nand_n
nior_n
{1.75}
3.5 1.5\1.75 1.5\2 2 1.71 1.5 2.5 2.25 3.6 2 2 1.5 1.5 1.35 1.30 1.27 3.75 3 2.35 nior_n
divrem_1int
17[14]
32 34 25
24[19]
38[25-28]
13 13 20-20.7 ?
12[11.5]
17-18 17-18 44 24 19 14.2-14.4 13.7-14 13.7 11.9-12.25 12-12.25 46 22-25 19.5-20 divrem_1int
divrem_1frc
15[13]
30 32 17.3
17[15]
23[22]
12 12 18 ? 10.4 16 16 42 19 18 12.4 11.9 11.8 10.5 10.7 36 16.6 divrem_1frc
pre_divrem_1 Y Y Y Y Y Y Y ? Y Y Y Y Y Y Y Y Y Y Y Y pre_divrem_1
div_qr_1u_pi1 div_qr_1u_pi1
div_qr_1n_pi1 11 11 16 ? 16 15 ? 19.3 19
15
13.2 12 ? ?
52
26 div_qr_1n_pi1
div_qr_1u_pi2
{9}
{9}
{13}
?
{14}
{?}
{34}
{13.5}
{11.5}
{9.5}
div_qr_1u_pi2
div_qr_1n_pi2
{7.5}
{7.5}
{11}
?
{13}
{?}
{31}
{12.5}
{10.5}
{7.5}
div_qr_1n_pi2
divrem_2 22 63 70 30 29 44 18 18 26.8 25.0 15.4 27 27 68 34 30.25 21.3 21.4 20.6 17.4 17.2 73 33 25.5 divrem_2
div_qr_2n_pi2
{13.5}
{13.5}
{20}
?
{22}
{?}
{47}
{23}
{18}
{13.5}
? ? div_qr_2n_pi2
divexact_1 11 19 21 10.2-12 11 16-20 10 10 14 14-15 8.07 15 16 33 13.25 14 8.5 8.54 8 8.28 8.15 36
14
12.6 divexact_1
bdiv_q_1_pi1 11 19 21 10.6-12 11 16-20 10 10 14 14-15
15[14]
16
[14.5-15]
33 13.25 14 8.5 8.54 8 8.28 8.15 36
14
12.6 bdiv_q_1_pi1
bdiv_qr_1_pi2
[8]
[8]
{12}
?
{12.4}
{?}
[24.7]
[13.4]
[12.7]
[7]
[7]
[6.5]
[6]
[6]
bdiv_qr_1_pi2
mode1o 11 19 21 10.2 11 15 10 10 14 13.3 8 15 14 33 13 14.25 8.2 8.2 8 8 8 35 11 12 mode1o
diveby3 diveby3
bdiv_dbm1c 3.5 8.25 11.65 5.33 5 8 2.25 2.25 4.6 4.25 2.56 6.22 6.22 12.5 4 3.75 3.6 3.6 3.57 2.47 2.5 20 8 3.76 bdiv_dbm1c
mod_1_1p 7 16 18 14.2 10 17 6 6
10{8.25}
8 5.9 9 8 26
12.5{10.5}
11{10.5}
8.4[8]
7.4{7}
7.25 5.65 5.5 26 11.6 8.8 mod_1_1p
mod_1s_2p 4 4
7{6.3}
6.3 3 8.61 9.3 19 8
6.5{6}
4.5{4}
3.9{3.27}
3.55{3.33}
3.06
3{2.5}
28 11.6 5 mod_1s_2p
mod_1s_3p
{3}
{3}
{5.5}
? 2.7
{8}
{?}
{16}
{5.41}
{4.5}
{3}
{2.16}
mod_1s_3p
mod_1s_4p
4.75{4.25}
4 4.5 `7.1 3.4 8.75
3{2.75}
3{2.75}
5.7{5}
5.5 2.55 7.67 7 15.75 5
4[3.75]
3.25{2.5}
3.05{2.37}
2.6{2.125}
2.25{1.93}
2.15{1.87}
23 10 4.2 mod_1s_4p
mod_34lsub1
1
1.25 1.25 2.04
1.9
2.33 0.67 0.67 1 0.75 0.64 1.125 1 3.2 1.25 1.15 0.93 0.92
0.82[0.29]
0.64[0.29]
0.6[0.28]
2.45 1.59 1.25 mod_34lsub1
gcd_1 5.31/b
[10/b]
[10/b]
4.57 5.09/b
[8.9/b]
5.21/b 4.30/b 5/b ? 4.1 6.71/b 5.75/b 13.5/b 3.83/b 5.17/b 4.69/b 4.54/b 4/b 3.9/b 3.87/b 8.77/b 6.5/b gcd_1
invert_limb 41 48 48 63 ? 36 64 64 135 69 55 44 42 42 41 41 130 58 invert_limb
popcount 5(4) 3.9 4.25 6.45
4.6
5.5 6 1.125 1.24 1.22 0.72 6.1 1.15 8 2.61 1.04 1.02 1.0
1.0[0.68]
1.0[0.68]
1.0[0.63]
10.75 1.34 1.3 popcount
hamdist 6(5)
{5.4}
{5.4}
6.67 6.08 8 7
2{1.5}
1.51 1.5 1.15 7.5 2.5
14.3{10}
3.28 2.03 1.66 1.62 1.50 1.50 1.50 17.5(12) 2.55 2.37 hamdist
AMD
K7
32
Intel
North
32
Intel
Presc
32
Intel
Copp
32
Intel
Doth
32
Intel
Atom
32
AMD
K8
64
AMD
K10
64
AMD
BD1
64
AMD
BD4
64
AMD
Zen
64
AMD
BT1
64
AMD
BT2
64
Intel
Nocona
64
Intel
PNR
64
Intel
NHM
64
Intel
SBR
64
Intel
IBR
64
Intel
HWL
64
Intel
BWL
64
Intel
SKY
64
Intel
Atom
64
Intel
SLM
64
Intel
GLM
64


PPC
74x7
32
PPC
970
64
IBM
PWR5
64
IBM
PWR6
64
IBM
PWR7
64
IBM
PWR8
64
Sun
US3
64
Sun
T1
64
Sun
T4
64
Alpha
21264
64
Itanium
2
64
ARM
a5 neon
32
ARM
a7 neon
32
ARM
a8 neon
32
ARM
a9 neon
32
ARM
a15
32
ARM
a15 neon
32
ARM
a53
64
ARM
a57
64
ARM
X‑Gene
64
add_n 4 2 2.25 2.63 2.18 2.14 4.5 17 3 2.125 1.25 4.33 2.75-3.5 3.25 2.5 1.27 1.27 2.75-3.25 1.5 2 add_n
sub_n 4 2 2.25 2.63 2.18 2.14 4.5 17 3 2.125 1.25 4.33 2.75-3.5 3.25 2.5 1.27 1.27 2.75-3.25 1.5 2 sub_n
addlsh1_n 5 3 2.9 3.5 2.45 3.77 21 (3.25) 4 1.5 5.75 5 4.35 3.11 a3.36 a2.25 3.25-3.75 2.18 2.5 addlsh1_n
sublsh1_n 5 3 2.9 3.5 2.45 3.77 21 (3.75) 4 1.5 6.5 5.7 5 3.7 a3.69
2.25
3.25-3.75 2.18 2.5 sublsh1_n
rsblsh1_n
[5]
3 2.9 3.5 2.45 3.77 21 (3.75) 1.5
2.25
3.25-3.75 2.18 2.5 rsblsh1_n
addlsh2_n
[5]
3 2.9 3.5 2.45 3.77 21 3.75 1.5 a2.25 3.25-3.75 2.18 2.5 addlsh2_n
sublsh2_n
[5]
3 2.9 3.5 2.45 3.77 21 3.75 1.5
2.25
3.25-3.75 2.18 2.5 sublsh2_n
rsblsh2_n
[5]
3 2.9 3.5 2.45 3.77 21 1.5
2.25
3.25-3.75 2.18 2.5 rsblsh2_n
addlsh_n 4 (1.75) addlsh_n
sublsh_n 4 (1.75) sublsh_n
rsblsh_n (4.5) (1.75) rsblsh_n
lshsub_n lshsub_n
add_n_sub_n (3) (3) 2.25 add_n_sub_n
rsh1add_n (5) 2.9 ? 2.5 2.25 ? (4) (3.5) 1.5 6.75 5.35
6.4[4.75]
3.64-3.7 3.72
2.5[2]
3.25-3.75 2.15 2.75 rsh1add_n
rsh1sub_n (5) 2.9 ? 3.5 2.25 ? (4.5) (3.5) 1.5 6.75 5.35
6.4[4.75]
3.64-3.7 3.72
2.5[2]
3.25-3.75 2.15 2.75 rsh1sub_n
cnd_add_n 2.25 ? 3 2 2.84 3 1.5 5.5 3.86-4.5 3.75 3 1.78 1.78 3.5-4 1.75 2 cnd_add_n
cnd_sub_n 2.25 ? 3 2 2.84 3 1.5 5.5 3.86-4.5 3.75 3 1.78 1.78 3.5-4 1.75 2 cnd_sub_n
mul_1 6 7.25 7.25 13.5 2.9 3.53 18.25 68 3 2.25
2{1.5}
5
5.25[3.75]
7[5]
3.25
2.25[2]
2.25{1.35}
7.5-8 7 4 mul_1
mul_1c Y Y Y Y Y N N Y Y Y Y Y mul_1c
addmul_1 9.5 8 8 12.25 3.77 4.15 17.3 74 4.5(4.25) 3.5 2(1.75) 5 5.25 7 3.25 2
2{1.65}
9.3-9.8 7 5 addmul_1
addmul_1c addmul_1c
submul_1 10.5 8.3 8.25 12.8
4.9{4.3}
4.80 22.75 74 4.5 3.5 2.25(2) 6.25 6.5 7 3.75 2.32 2.32(1.8) 9.3-9.8 7 5 submul_1
mul_2 (4.75) (4.75) 3 3.85 3.25(3) (2.5) 1.5 3.5 3.13
5
2.25
2.5{2}
2.5{1}
mul_2
mul_3
[1.333]
mul_3
mul_4 2.625(2.5)
[1.25]
mul_4
mul_5
[1.2]
mul_5
mul_6
[1.167]
mul_6
addmul_2 (4.75) (4.75) 3 a4.27 10.25 3.75(3.5) (3) 1.625 3.5 3.62 4 2.25
2.5{2}
2.5{1.3}
addmul_2
addmul_3 (4) (4) (3)
{1.42}
3.15 3.23 3.18 2.1 2 a2 addmul_3
addmul_4 (2) 2.75 (2.31)
{1.3125}
addmul_4
addmul_6 (1.167) addmul_6
addmul_8 (2.25) (1) addmul_8
mul_basecase (2) 8.38¹ 8.3¹ 13.4¹
4.02¹
4.35 (8) (2.31) (1+ε) mul_basecase
mullo_basecase mullo_basecase
mulmid_basecase mulmid_basecase
mulhi_basecase mulhi_basecase
sqr_basecase 8.96² 8.67² 18.5²
4.35²
5.0 (8) (1+ε) 4.37² 4.96² 2.38
2.5
2.5
sqr_basecase
sqrlo_basecase sqrlo_basecase
sqr_diag_addlsh1 6 4.5? 4.5 2 5.65 3.5 3.38 sqr_diag_addlsh1
redc_1 redc_1
redc_2 redc_2
lshift 2.25(1) 2.33 2.25 4 2.15 1.67 2.5 17.5 3 1.75 1 3.5 2.75 2.5 3
2.92{1.9}
1.5{1.15}
3.5-4[2.46]
2[1.5]
2.67[1.5]
lshift
rshift 2.25(1) 2.33 2.25 3.5 2.15 1.67 2.5 17.5 3 1.75 1 3.5 2.75 2.5 3
2.92{1.9}
1.5{1.15}
3.5-4[2.46]
2[1.5]
2.67[1.5]
rshift
lshiftc 2.25 2.33 2.25 4 2.15 1.67 2.67 17 3.5 1.25 4 3.75 2.75 3.5 3.53(2.5) 1.75(1.4) 3.5-4 2 2.67 lshiftc
copyd 0.75
1
1.13 1.9 1.09 1 2.5 17 2 1 0.5 2.5 1.5-2
1.75[1]
1.25-1.5 1.25 0.52 2 1 1.25 copyd
copyi 0.75
1
1 2 1.09 1 2.5 17 2 1 0.5 2.5 1.5-2
1.75[1]
1.25-1.5 1.25 0.52 2 1 1.25 copyi
sec_tabselect 2 2 ? 5 1.37 1.37 3 17 2.25? 1.64
2.5
1.15 2.2 0.65 2.25 1.33 2 sec_tabselect
com (0.75) 1.25 ? 1.32 1.13 1.04 1.5 (0.5) 3.25 2.5-3
2.25[1.25]
1.75 1 0.65 2.25 1.25 1.75 com
and_n 1.14 2 2 2.5 1.75 1.75 (1.75) 1 4.25 3-3.75 3 2.1 1.27 1.27 2.75-3.25 1.5 2 and_n
ior_n 1.14 2 2 2.5 1.75 1.75 (1.75) 1 4.25 3-3.75 3 2.1 1.27 1.27 2.75-3.25 1.5 2 ior_n
xor_n 1.14 2 2 2.5 1.75 1.75 (1.75) 1 4.25 3-3.75 3 2.1 1.27 1.27 2.75-3.25 1.5 2 xor_n
andn_n 1.14 2 2 2.5 1.75 1.75 (1.75) 1 4.25 3-3.75 3 2.1 1.27 1.27 2.75-3.25 1.5 2 andn_n
iorn_n 1.39 2 2 2.5 1.75 1.75 (1.75) 1 5.25 4-4.75 3.5 2.1 1.64 1.64 2.75-3.25 1.5 2 iorn_n
xnor_n 1.39 2 2 2.5 1.75 1.75 (1.75) 1 5.25 4-4.75 3.5 2.6 1.64 1.64 2.75-3.25 1.5 2 xnor_n
nand_n 1.39 2 2 2.5 1.75 1.75 (2) 1 5.25 4-4.75 3.5 2.6 1.64 1.64 3.25-3.75 2 2.09 nand_n
nior_n 1.14 2 2 2.5 1.75 1.75 (2) 1 5.25 4-4.75 3.5 2.6 1.64 1.64 3.25-3.75 2 2.09 nior_n
divrem_1int
[21]
29 29 58 25 25-30
[22]
30[22]
13.5-14.5 12 18-19 13-14 11.4-11.8 11.4-11.8 divrem_1int
divrem_1frc
[7]
19 19 41 14 14.8
[18]
30[22]
12.75 11 18 13 11 11 divrem_1frc
pre_divrem_1 Y Y Y Y Y pre_divrem_1
div_qr_1u_pi1 div_qr_1u_pi1
div_qr_1n_pi1 div_qr_1n_pi1
div_qr_1u_pi2 div_qr_1u_pi2
div_qr_1n_pi2
{22}
{23.5}
[16]
div_qr_1n_pi2
divrem_2 29 40 37 62 30.5 31.3 29 29 divrem_2
div_qr_2n_pi2 div_qr_2n_pi2
divexact_1
[6-8]
16 16 46 12 12 26 15 8 8.5-12.5 8-12 13-14 9-10 7 7 divexact_1
bdiv_q_1_pi1
[6-8]
16 16 46 12 12 26 15 8 8.5-12.5 8-12 13-14 9-10 7 7 12-15 12 11 bdiv_q_1_pi1
bdiv_qr_1_pi2 bdiv_qr_1_pi2
mode1o
8-10
16 16 35 12 12 26 15 8 7.75 7 13 9 7 7 mode1o
diveby3 6 diveby3
bdiv_dbm1c 6.25 8.25 8.63 15 4.7 4.7 4 3 2 5 5.25 5.25 4.25 2.5 2.5 8 7 4.25 bdiv_dbm1c
mod_1_1p 17 16 30 10.2 10.1 (9) 10 8 9 7 6 6 mod_1_1p
mod_1s_2p (4.5) 4.75 4 9 4.25 3 3 mod_1s_2p
mod_1s_3p mod_1s_3p
mod_1s_4p
[6.5]
9 9 13 3.5 4 4 3 (2.25) mod_1s_4p
mod_34lsub1 0.87 1.5 1.32 2.35 1 1.67 1.67?
1.67
1 2.5 2.33 2
1.33{1}
1.33{0.92}
1.33{0.59}
2 1 1.45 mod_34lsub1
gcd_1 8.5/b ? 10.1/b 7.6/b 11.3/b 5/b 11.4/b 6/b 3.4/b 5.1/b 5.5/b 5.75/b 5/b 5.3/b 3.5/b 3.5/b 4/b 2.8/b 5/b gcd_1
invert_limb 32 86 86 170 66 ? ? 71 56 41 42 56 43 41 41 56 57 63 invert_limb
popcount 1.125 2.25
{2.16}
2 2.9 2.5
1.5
1 2.5 2.15-2.64 1 1.13 5.67 0.56 2.5 1.14 3 popcount
hamdist (1.5) (3) 2.87 3.1 3.5
2.4
1 4.25 3.15-4.15 1.5 1.89 6.44 0.95 4.5 1.9 4.36 hamdist
PPC
74x7
32
PPC
970
64
IBM
PWR5
64
IBM
PWR6
64
IBM
PWR7
64
IBM
PWR8
64
Sun
US3
64
Sun
T1
64
Sun
T4
64
Alpha
21264
64
Itanium
2
64
ARM
a5 neon
32
ARM
a7 neon
32
ARM
a8 neon
32
ARM
a9 neon
32
ARM
a15
32
ARM
a15 neon
32
ARM
a53
64
ARM
a57
64
ARM
X‑Gene
64

¹ This value is for sizes around MUL_TOOM22_THRESHOLD, since mpn_mul_basecase is in most cases not used above that.
² This value is for sizes around SQR_TOOM2_THRESHOLD, since mpn_sqr_basecase is never used above that.
† Obsolete function that will be replaced in a future GMP release.