From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 48975 invoked by alias); 11 Jan 2018 10:54:57 -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 48932 invoked by uid 89); 11 Jan 2018 10:54:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=HTo:D*ucla.edu, HContent-Transfer-Encoding:8bit X-HELO: mail-qk0-f193.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=WzCu/zIn1FXE7AJEuj2/CGGACFGVSbZgHwMjaYp5RiM=; b=ue0nVV2mrwBE8o4AyVqIdj1NEU1gj03FHlqJ84+Ggwkh/P/bzZF8lHa7lnn800VWOT jLiHGR+3DcNFLmumluFF6zhQL3stZbaVnGKUSLJzN0o90awIDn517D+EdMiqdspHYvCD TQAFg9K71aeblMfMSCXEImRN4jynIdmHKCLbnwplKMqUs/r6fRx6gkytpxkD+jNWgm3u nf58nI0DbXKvGLuURS9v0kWWrWn4LfHlxO6CTXzgO/gUHdd4P2WWLWmYK51Joggwoj82 LmpoeSos4ipB4ZUQLQzU1tLwvm0RfzKpCdLLM+LeEvBzRmHqXHqNj/mVlakFK7O9Ut2+ FXxg== X-Gm-Message-State: AKGB3mJ/bBupJpmp0q2VnGZ9klHJJLhPDeG0b5ihjgTiPoeydgmcaoOg Uiz3EEQ6ttTLhRACE9uf1deyH4vxBzc= X-Google-Smtp-Source: ACJfBosrhQ8LkujqnTrYisIqnIcFmyjQ7pnInC2gOM5T7C7ydp9zVEM+MwzLHZbWkXHdhHEgJPNp9g== X-Received: by 10.55.169.140 with SMTP id s134mr20896546qke.39.1515668093312; Thu, 11 Jan 2018 02:54:53 -0800 (PST) Subject: Re: [PATCH v3 03/18] Add string-maskoff.h generic header To: Paul Eggert , libc-alpha@sourceware.org References: <1515588482-15744-1-git-send-email-adhemerval.zanella@linaro.org> <1515588482-15744-4-git-send-email-adhemerval.zanella@linaro.org> From: Adhemerval Zanella Message-ID: <06309ead-8946-cec6-8c8f-c26f09be72c3@linaro.org> Date: Thu, 11 Jan 2018 10:54:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-SW-Source: 2018-01/txt/msg00369.txt.bz2 On 10/01/2018 21:24, Paul Eggert wrote: > On 01/10/2018 04:47 AM, Adhemerval Zanella wrote: >> +/* Create a mask with high bit of each byte being 1, and the low 7 bits >> +   being all the opposite of the input mask.  It is used to mask off >> +   undesirable bits from an aligned read from an unaligned pointer, >> +   and also taking care to avoid match possible bytes meant to be >> +   matched.  For instance, on a 64 bits machine with a pointer alignment >> +   of 3 the function returns 0x7f7f7f0000000000 (input meant to >> +   be 0xffffff0000000000) for BE and 0x00000000007f7f7f for LE (input >> +   meant to be 0x0000000000ffffff).  */ >> +static inline op_t >> +highbit_mask (op_t m) >> +{ >> +  return m & ~repeat_bytes (0x80); >> +} > > The first line of the comment does not match the implementation, which would have to be something like "return (m ^ repeat_bytes (0x7f)) | repeat_bytes (0x80);" to match the comment. Also, I suggest replacing "~repeat_bytes (0x80)" with "repeat_bytes (0x7f)" as the latter is a bit simpler. Thanks, I will change it locally.