From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x34.google.com (mail-oa1-x34.google.com [IPv6:2001:4860:4864:20::34]) by sourceware.org (Postfix) with ESMTPS id C7C2B3858D38 for ; Wed, 11 Jan 2023 13:42:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C7C2B3858D38 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-150b06cb1aeso15524736fac.11 for ; Wed, 11 Jan 2023 05:42:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=KbX8Ch3jgz0HPRNv0hFamB+8vrFe4tNym+h/YWfeRZw=; b=kG7PmrCguB3GYeicEGYKN6JwJGlESHkWctmVjdNFgYeqKbIE+uXuB390y+RWCJCOLx WQ2ZCU52Yu463kHsemDJPuw91xocimaXXCQTC5Iec64KTX/DBo2BM6xLMZs/Gy9je3Mq Gp+XObAAyNKyZHp5G5VZA/8DZfr2L5Izw01QZGmt1cGN3jdRF9JJ4nN4Ri+Z7wJHjWko HDEXoAc5zTpSml5Oos5CCubSsFkzvsuUqUTm8MYjL3zRWbyY4MhhygMPRjamuD6KLt/1 ayF3Gap8qG/wKIYlnT9+MWsOEjiolU8y81dGlj1fVuDq1nq6FQilw7i4c/oNCQ45864i z7kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=KbX8Ch3jgz0HPRNv0hFamB+8vrFe4tNym+h/YWfeRZw=; b=SbtlRA8vXDP/re1mZTc8pKHind8K05ANvdN6kWbND/suqd5lUBQ2HlIDpaH+zTlkK1 sis5h2HywX01e2FUuncOoN43FsHA7lOghfTa60cFLIXxHCdtEjhlbztJl/y5u4xvNsRo TS6wmCG3XqeyVYOGr3gCQDbTmslu7G+GzDy6KY5n/HkdMFFEUdNyuWkxLLN9syYz9WNO 2imST3eYXyPo5mW5+BbDYFwNabPfgPJxOlAGeOhe88s9o+ZIpHo8Ip6tZAzRj3/itqFj HMipqRJkHN5v4DEAdHUQaXmt5x+8lWfN/p3uF2D3Dl5A161iuh6QVLAagJAPwp1K2CXd +4RA== X-Gm-Message-State: AFqh2kpUNwjMMlKz98A9jP1G7zBHrVsUEr/aJClxWlq9p6Y2nwZEomr1 YRkgK+DEI0Eh6sBqgjxdHft48Q== X-Google-Smtp-Source: AMrXdXtEqSH0dz8XtCYybDWeibIoM4T6AB7rhqLplHKz7Bb/SRSmD/oTUXZh+J6Jt9aAvv61plRJdg== X-Received: by 2002:a05:6870:f71e:b0:15b:eb7:347 with SMTP id ej30-20020a056870f71e00b0015b0eb70347mr6879401oab.35.1673444555825; Wed, 11 Jan 2023 05:42:35 -0800 (PST) Received: from ?IPV6:2804:1b3:a7c0:a93a:9160:47f0:6805:e35d? ([2804:1b3:a7c0:a93a:9160:47f0:6805:e35d]) by smtp.gmail.com with ESMTPSA id y6-20020a056870418600b00144e18d8525sm7262315oac.25.2023.01.11.05.42.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Jan 2023 05:42:35 -0800 (PST) Message-ID: <7b60bc6b-9e33-4bb4-0a64-3b28ca1302fe@linaro.org> Date: Wed, 11 Jan 2023 10:42:32 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH v6 04/17] Add string vectorized find and detection functions Content-Language: en-US To: Richard Henderson , libc-alpha@sourceware.org, Noah Goldstein References: <20230110210106.1457686-1-adhemerval.zanella@linaro.org> <20230110210106.1457686-5-adhemerval.zanella@linaro.org> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 10/01/23 23:25, Richard Henderson wrote: > On 1/10/23 13:00, Adhemerval Zanella wrote: >> --- a/sysdeps/generic/string-maskoff.h >> +++ b/sysdeps/generic/string-maskoff.h >> @@ -23,7 +23,6 @@ >>   #include >>   #include >>   #include >> -#include >>     /* Provide a mask based on the pointer alignment that sets up non-zero >>      bytes before the beginning of the word.  It is used to mask off >> @@ -44,12 +43,12 @@ create_mask (uintptr_t i) >>   /* Return the mask WORD shifted based on S_INT address value, to ignore >>      values not presented in the aligned word read.  */ >>   static __always_inline op_t >> -check_mask (op_t word, uintptr_t s_int) >> +check_mask (op_t word, uintptr_t s) >>   { >>     if (__BYTE_ORDER == __LITTLE_ENDIAN) >> -    return word >> (CHAR_BIT * (s_int % sizeof (s_int))); >> +    return word >> (CHAR_BIT * (s % sizeof (op_t))); >>     else >> -    return word << (CHAR_BIT * (s_int % sizeof (s_int))); >> +    return word << (CHAR_BIT * (s % sizeof (op_t))); >>   } > > Fold this into patch 3, if you want it. Ack. > >> @@ -79,7 +78,7 @@ highbit_mask (op_t m) >>   static __always_inline op_t * >>   word_containing (char const *p) >>   { >> -  return (op_t *) ((uintptr_t) p & -sizeof(p)); >> +  return (op_t *) ((op_t) p & -sizeof(p)); > > Casting p to op_t is wrong. Indeed, I will revert to uintptr_t.