From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18420 invoked by alias); 28 May 2015 17:08:17 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 18402 invoked by uid 89); 28 May 2015 17:08:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,SPF_NEUTRAL autolearn=no version=3.3.2 X-HELO: popelka.ms.mff.cuni.cz Date: Thu, 28 May 2015 17:48:00 -0000 From: =?utf-8?B?T25kxZllaiBCw61sa2E=?= To: Joseph Myers Cc: libc-alpha@sourceware.org Subject: Re: [PATCH 2/3] Optimize strchrnul with unrolling, better header and unaligned loads Message-ID: <20150528170808.GA7479@domone> References: <20150526173150.GA26817@domone> <20150526180007.GB26817@domone> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-SW-Source: 2015-05/txt/msg00794.txt.bz2 On Thu, May 28, 2015 at 05:02:32PM +0000, Joseph Myers wrote: > On Tue, 26 May 2015, Ondřej Bílka wrote: > > > +static always_inline > > +int > > +found_in_long_bytes(char *s, unsigned long int cmask, char **result) > > +{ > > + const unsigned long int *lptr = (const unsigned long int *) s; > > + unsigned long int mask = contains_zero (*lptr) | contains_zero (*lptr ^ cmask); > > + if (mask) > > + { > > + *result = s + ffsl (mask) / 8 - 1; > > If this gets used in strchr, note ffsl is in the user's namespace. Are > you sure this will always be inlined by all supported GCC versions on all > supported architectures (or converted to a call to a libgcc __clz* > function, which is just as good in namespace terms)? > No, i handle that problem of next iteration of this patch that uses skeleton. And you need different function for big endian.