This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v3 04/18] Add string vectorized find and detection functions
- From: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- To: "adhemerval dot zanella at linaro dot org" <adhemerval dot zanella at linaro dot org>
- Cc: nd <nd at arm dot com>, "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>
- Date: Thu, 11 Jan 2018 19:36:51 +0000
- Subject: Re: [PATCH v3 04/18] Add string vectorized find and detection functions
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Wilco dot Dijkstra at arm dot com;
- Nodisclaimer: True
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
Hi,
I haven't looked at it in detail, but this immediately stands out:
>> +static inline unsigned
>> +__clz (op_t x)
The point being that we're working on bytes so we're not interested in the first/last
set bit, but first/last non-zero byte. That simplifies the implementation for targets
that don't support clz/ctz as now we only have 4 or 8 possible values to return
instead of 32 or 64.
Wilco