divexact_1 and bdiv_q_1

bodrato at mail.dm.unipi.it bodrato at mail.dm.unipi.it
Wed Jan 19 08:12:36 CET 2011


Dear developers,

I spent some time trying to understand the difference between the two
functions: mpn_divexact_1 and mpn_bdiv_q_1 .
As far as I can see they should compute the same mpn, but the first one
does not return anything, while the second one returns an mp_limb_t. What
is that returned value supposed to be?
I did read the code in mpn/generic and I could not understand...

I took the code from mpn/x86/dive_1.asm and I adapted it to obtain
mpn/x86/bdiv_q_1.asm, then I committed it[*] to have it tested. It worked.
But I did not touch in any way the code to return a coherent value... I
simply assume that the returned value is not used anywhere in the code.

[*]The presence of a generic "mpn/x86/bdiv_q_1.asm" file does slow down
general performance of GMP on x86, because it gets used instead of the
various mpn/x86/*/dive_1.asm optimised for specific processors... I will
correct this...

Regards,
Marco

-- 
http://bodrato.it/






More information about the gmp-devel mailing list