From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by sourceware.org (Postfix) with ESMTPS id 3B2303858D33 for ; Wed, 11 Jan 2023 02:25:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3B2303858D33 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-pj1-x1030.google.com with SMTP id c8-20020a17090a4d0800b00225c3614161so18463065pjg.5 for ; Tue, 10 Jan 2023 18:25:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=CoAtT8a+QhQof48dQxulJ6UMPJ3BzOHnuV81Y13FXnc=; b=aOaRD1GIkt5D8fAWc/hbnzDBt+bXTwVhPI0tWrDDBHQ+rR9WQAYQiDOTs1lLEBqdNG 6JH1HH46Arlh1+Thorilih/gbfhp2Z0Iek7rCFWxtwpaEMP6upajzbXUMtA9PWHkskUg M5OhGF3fMPtOFFz4Zen08/eR2MI83YB+uQQ8BjGFUqyk/NpZxSt6qbiqWD/DC6HWYmWz IYjfNY4tEYBlCM09ncB5BaVWrKzbFoAuT1P8NMlIdDs8dMdwRxMGo9m/R/+BV0R5T0E9 CRiPOzZVt+cZ0hd/GKtoNWraL0eQQTVKvr6IpqhTPd5ISv86fiMBeGu1Ii+UcJwoZ7V4 YVzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to: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=CoAtT8a+QhQof48dQxulJ6UMPJ3BzOHnuV81Y13FXnc=; b=bTPDb2PSjGbs5Hxd7BtxUIZR5OouRL0dcyIM7vAfhgpRS1OcRKF38nxyj2GXCVfvvZ MldQNNqLsc5OhOVwJbA04HAfPsSfye5iku11Wp8B3vNsySi7LU7Z4SGkvxpB5y0m672k qZ6Z/Itc2z2I2tHBD5c+gwjmVA8v+qM3KDyqeoiTVP4CwSBot2kH3mwRgI72qYGFs/jm iSv12LQ0ki+VZ1C39KELyhtHpbH6WLWxdncKxu0K+Z6we0d+JVZex/9NZOD8gzVzCU15 SPG65jDve8ukieAREteGSL4dJ8Bo6IqAOnaNVi7wdoKAPa8a7PtVJN8rAI95HgYQLQk3 Aofg== X-Gm-Message-State: AFqh2kqdHjpxloWBFKqr/0vilcuupvd49SDGwTSYIENQI6jf+z7kGRjc Dp/Fy29h0U+kXUvmj2Xqg9FmGqMVqvmphGta X-Google-Smtp-Source: AMrXdXvb+Zoj+o8RXReA7K9OCWGRWJeQWU3L/gFNKB3qVDsmVUEQEGXEXLsBxKCqOXjCwNghMvwkTQ== X-Received: by 2002:a05:6a20:a6a8:b0:b5:9d81:4171 with SMTP id ba40-20020a056a20a6a800b000b59d814171mr931164pzb.24.1673403958204; Tue, 10 Jan 2023 18:25:58 -0800 (PST) Received: from [192.168.0.115] (63-157-97-90.dia.static.qwest.net. [63.157.97.90]) by smtp.gmail.com with ESMTPSA id c15-20020a170903234f00b001885041d7b8sm8734736plh.293.2023.01.10.18.25.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Jan 2023 18:25:57 -0800 (PST) Message-ID: Date: Tue, 10 Jan 2023 18:25:55 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v6 04/17] Add string vectorized find and detection functions Content-Language: en-US To: Adhemerval Zanella , libc-alpha@sourceware.org, Noah Goldstein References: <20230110210106.1457686-1-adhemerval.zanella@linaro.org> <20230110210106.1457686-5-adhemerval.zanella@linaro.org> From: Richard Henderson In-Reply-To: <20230110210106.1457686-5-adhemerval.zanella@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no 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 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. > @@ -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. r~