On Fri, Dec 31, 2021 at 3:02 PM Florian Weimer <f...@deneb.enyo.de> wrote:
>
> * H. J. Lu:
>
> > On Fri, Dec 31, 2021 at 12:43 PM Florian Weimer <f...@deneb.enyo.de> wrote:
> >>
> >> * H. J. Lu via Libc-alpha:
> >>
> >> > bzero is an alias of SSE2 memset in glibc.   Should we add __memsetzero
> >> > like __memcmpeq?  It should be almost free in glibc.  GCC can use
> >> > __memsetzero if it is available.

Think __memsetzero makes sense.
> >>
> >> bzero does not have the interface ambiguity that bcmp has.  So the
> >> only reason for not using it would be namespace cleanliness.
> >
> > bzero isn't a standard C function and it isn't optimized like memset
> > in glibc.

It could be an issue if the "optimization" was made and then the
binary was run with an older version of GCC that was still using
the aliasing bzero. Would end up being a deoptimization then.


>
> GCC already uses non-standard functions whose names are not
> implementation-defined for optimization purposes if a suitable
> prototype is available.  stpcpy is an example, for:
>
>   strcpy (a, b);
>   return a + strlen (a);

Reply via email to