Why set zero in zero.c rather than use xor_n

Vincent Lefevre vincent at vinc17.net
Mon Feb 5 22:03:05 UTC 2018


On 2018-02-05 21:48:47 +0100, Torbjorn Granlund wrote:
> I suppose memset is not used as it might come with more overhead for
> checking alignment.  I haven't timed it, though.

The compiler knows the alignment from the types. This is where the
optimization should be. The GCC manual mentions a __builtin_memset
builtin, though I don't know what it does exactly.

-- 
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


More information about the gmp-devel mailing list