Why set zero in zero.c rather than use xor_n

Niels Möller nisse at lysator.liu.se
Mon Feb 5 20:32:21 UTC 2018


tg at gmplib.org (Torbjörn Granlund) writes:

> Now it is true that mpn_zero runs far from optimally, since it is
> written in C, although typically inlined.

It looks like internally we use the MPN_ZERO and MPN_FILL macros. The
mpn_zero function is not inlined, as far as I see.

> I am not sure it is important enough to write in asm, though.

Probably not. But it might make sense to rewrite as a wrapper for
memset, which I'd expect to be well optimized in gcc and libc.

Regards,
/Niels

-- 
Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677.
Internet email is subject to wholesale government surveillance.


More information about the gmp-devel mailing list