public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Joseph Myers <joseph@codesourcery.com>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: <libc-alpha@sourceware.org>
Subject: Re: [PATCH v3 04/18] Add string vectorized find and detection functions
Date: Thu, 11 Jan 2018 13:34:00 -0000	[thread overview]
Message-ID: <alpine.DEB.2.20.1801111329400.27821@digraph.polyomino.org.uk> (raw)
In-Reply-To: <1515588482-15744-5-git-send-email-adhemerval.zanella@linaro.org>

On Wed, 10 Jan 2018, Adhemerval Zanella wrote:

> +
> +static inline unsigned char
> +extractbyte (op_t x, unsigned idx)

Missing comment on the semantics of this function.  "unsigned int".

> +/* For architecture which only provides __builtin_clz{l} (HAVE_BUILTIN_CLZ)
> +   and/or __builtin_ctz{l} (HAVE_BUILTIN_CTZ) which uses external libcalls
> +   (for intance __c{l,t}z{s,d}i2 from libgcc) the following wrapper provides
> +   inline implementation for both count leading zeros and count trailing
> +   zeros using branchless computation.  */

I think the comments need to say a bit more about the semantics of these 
functions.  In particular, do they follow the same rule as the built-in 
functions that behavior is undefined if the argument is zero?  If they do, 
then I'd expect the comments on the functions that call them to specify 
that they must not be called with a zero argument (zero arguments in this 
case generally corresponding to words that are not at the end of the 
string etc., so the functions indeed don't get called in that case).

-- 
Joseph S. Myers
joseph@codesourcery.com

  reply	other threads:[~2018-01-11 13:34 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-10 12:48 [PATCH v3 00/18] Improve generic string routines Adhemerval Zanella
2018-01-10 12:48 ` [PATCH v3 11/18] string: Improve generic strcmp Adhemerval Zanella
2018-01-10 12:48 ` [PATCH v3 07/18] string: Improve generic memrchr Adhemerval Zanella
2018-01-10 12:48 ` [PATCH v3 03/18] Add string-maskoff.h generic header Adhemerval Zanella
2018-01-10 23:25   ` Paul Eggert
2018-01-11 10:54     ` Adhemerval Zanella
2018-01-11 13:29   ` Joseph Myers
2018-01-11 17:57     ` Adhemerval Zanella
2018-01-10 12:48 ` [PATCH v3 09/18] string: Improve generic strchr Adhemerval Zanella
2018-01-10 12:48 ` [PATCH v3 16/18] arm: Add string-fza.h Adhemerval Zanella
2018-01-10 12:48 ` [PATCH v3 12/18] string: Improve generic strcpy Adhemerval Zanella
2018-01-10 12:48 ` [PATCH v3 13/18] hppa: Add memcopy.h Adhemerval Zanella
2018-01-11 13:36   ` Joseph Myers
2018-01-12 18:01     ` Adhemerval Zanella
2018-01-12 18:18       ` Joseph Myers
2018-01-12 18:37         ` Adhemerval Zanella
2018-01-10 12:48 ` [PATCH v3 04/18] Add string vectorized find and detection functions Adhemerval Zanella
2018-01-11 13:34   ` Joseph Myers [this message]
2018-01-11 18:25     ` Adhemerval Zanella
2018-01-11 13:44   ` Luis Machado
2018-01-11 18:25     ` Adhemerval Zanella
2018-01-11 16:47   ` Paul Eggert
2018-01-11 18:54     ` Adhemerval Zanella
2018-01-12  1:08       ` Paul Eggert
2018-01-12 17:08         ` Joseph Myers
2018-01-12 17:59           ` Adhemerval Zanella
2018-01-12 13:30       ` Adhemerval Zanella
2018-01-10 12:48 ` [PATCH v3 18/18] sh: Add string-fzb.h Adhemerval Zanella
2018-01-10 12:48 ` [PATCH v3 14/18] hppa: Add string-fzb.h and string-fzi.h Adhemerval Zanella
2018-01-10 12:48 ` [PATCH v3 02/18] Parameterize OP_T_THRES from memcopy.h Adhemerval Zanella
2018-01-10 12:48 ` [PATCH v3 05/18] string: Improve generic strlen Adhemerval Zanella
2018-01-11 17:21   ` Paul Eggert
2018-01-12 18:00     ` Adhemerval Zanella
2018-01-10 12:48 ` [PATCH v3 10/18] string: Improve generic strchrnul Adhemerval Zanella
2018-01-10 12:48 ` [PATCH v3 15/18] alpha: Add string-fzb.h and string-fzi.h Adhemerval Zanella
2018-01-10 12:48 ` [PATCH v3 01/18] Parameterize op_t from memcopy.h Adhemerval Zanella
2018-01-11 13:28   ` Joseph Myers
2018-01-11 18:04     ` Adhemerval Zanella
2018-01-10 12:48 ` [PATCH v3 08/18] string: Improve generic strnlen Adhemerval Zanella
2018-01-10 12:48 ` [PATCH v3 06/18] string: Improve generic memchr Adhemerval Zanella
2018-01-10 12:48 ` [PATCH v3 17/18] powerpc: Add string-fza.h Adhemerval Zanella
2018-01-10 12:56   ` Tulio Magno Quites Machado Filho
2018-01-10 22:30 ` [PATCH v3 00/18] Improve generic string routines Ondřej Bílka
2018-01-11 10:54   ` Adhemerval Zanella
2018-01-11 13:50     ` Joseph Myers
2018-01-11 19:36 [PATCH v3 04/18] Add string vectorized find and detection functions Wilco Dijkstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.20.1801111329400.27821@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).