This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Do not multiply by zero in bzero.
- From: Roland McGrath <roland at hack dot frob dot com>
- To: OndÅej BÃlka <neleai at seznam dot cz>
- Cc: libc-alpha at sourceware dot org
- Date: Fri, 22 Mar 2013 11:36:59 -0700 (PDT)
- Subject: Re: [PATCH] Do not multiply by zero in bzero.
- References: <20130321162026 dot GA16603 at domone dot kolej dot mff dot cuni dot cz> <20130322180850 dot 59D472C06C at topped-with-meat dot com> <20130322182418 dot GA8244 at domone dot kolej dot mff dot cuni dot cz>
> On my computer probability of memset doing zero fill is 97.016% .
Not surprising.
> We currently expand constant zero fill to bzero like in
> string/bits/string2.h which is roughtly
I wasn't thinking about this. You said bzero rather than __bzero,
so I had in mind the source interface rather than the underlying symbol.
I think it's entirely reasonable to have the optimization for the common
case of constant zero fill be done in the header file rather than in the
memset assembly code. Hence your optimization focus is indeed appropriate.
Thanks for the clarification. It would streamline the review process in
future if you always lay out such issues clearly when first proposing a
change.
Thanks,
Roland