[PATCH v2] x86-64: Optimize bzero

Adhemerval Zanella adhemerval.zanella@linaro.org
Thu Feb 10 13:22:08 GMT 2022



On 10/02/2022 10:17, Wilco Dijkstra wrote:
> Hi,
> 
>> We need to keep the symbols as-is afaiu, since callers might still target
>> old POSIX where the symbol is defined as supported.  We might add either
>> compiler or linker warning stating the symbols is deprecated, but imho it
>> would just be better if we stop trying to microoptimize it and just use
>> the generic interface (which call memset).
> 
> Compilers have been doing that forever - if you use bzero GCC and LLVM
> emit a call to memset. No new calls are emitted to these functions, so there
> is no point in having target-specific optimization at all.
> 
> However we could disallow use of these functions at all in future GLIBCs.

Unfortunately we can not stop providing such symbols unless we start to stop
being compatible to legacy POSIX.  And I think we already do not use these
internally.

Also we can start to remove to other bstring functions as well, bcmp and bcopy.


More information about the Libc-alpha mailing list