HomeFreeBSD

Use __builtin for various mem* and b* (e.g. bzero) routines.

Description

Use __builtin for various mem* and b* (e.g. bzero) routines.

Some of the routines were using artificially limited builtin already,
drop the explicit limit.

The use of builtins allows quite often allows the compiler to elide the call
or most zeroing to begin with. For instance, if the target object is 32 bytes
in size and gets zeroed + has 16 bytes initialized, the compiler can just
add code to zero out the rest.

Note not all the primites have asm variants and some of the existing ones
are not optimized. Maintaines are strongly encourage to take a look
(regardless of this change).

Details

Provenance
mjgAuthored on Jun 2 2018, 6:03 PM
Parents
rG97e898489390: libkern: tidy up memset
Branches
Unknown
Tags
Unknown