C code that gets executed when mpz_mul() is invoked

Tanushree Banerjee banerjee.tanushree10 at gmail.com
Tue May 15 00:24:21 UTC 2018

I had a general question about the multiplication techniques used by GNU
GMP implementation.
>From the documentation I understand it uses Karatsuba for smaller sized
inputs, for larger inputs Toom Cook 3/4 way and for very large ones FFT
based multiplication.
So, I am using Intel Skylake 6700, i7 64 bit processor and have installed
the latest version of GMP (6.1.2) on my ubuntu platform.
Now my question is ->
I want to see the C code which GMP uses for multiplication when I use
mpz_mul () function and compile my C code using -lgmp flag.
Is it the code in the folder    gmp-6.1.2\mpn\generic\mul_n.c ?
Or is it some other multiplication code in any other folder?
Can someone help me understand which code gets executed ?

Thanks and regards
Tanushree Banerjee,
Electrical and Computer Engineering, Graduate Student
University of Waterloo

More information about the gmp-discuss mailing list