From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by sourceware.org (Postfix) with ESMTPS id 0764E3858C5E for ; Fri, 3 Feb 2023 00:34:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0764E3858C5E 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-x102a.google.com with SMTP id mi9so3494977pjb.4 for ; Thu, 02 Feb 2023 16:34:26 -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=38g5rj/R4HEEg1CoZX2xVsacIbk25sjaabrTZmU73TQ=; b=rbQWnzR203MfzrGPPNSPlGyXf7OQmbo1dZmmbsSJwETx7P83kbeFYvE6qN4IzPQ1zb u5SEIheLKRXfe1xaX/qzCic3bvvCLxGLJ9i43GV3QmGbkxmpxar99VEMP7Ap79spBQZy wZPtWCAni03g7eyJnRsyr1twd8/qrLNsZKsefQabKtVvwNkIQlDANsqltXx1fSPXuKvz snieozo06hqYJG/TwHNfqYzJbtSFW7mFzscyp+IBcmaE48v+oPDWnoIUiJ3R8ZksjAOB pEryC50s41fqDlOl6k7G3V+R5F+YCQvf19ovnsPpGtuhoT5wiYnIq4F2KEefnltCfpMw G61Q== 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=38g5rj/R4HEEg1CoZX2xVsacIbk25sjaabrTZmU73TQ=; b=36/eJb0hO83zsNLugkzfrKECAtVD0mljrM5e3tjCiN5miVUNV26CyXXw6IbUI4A4cv 2vDDMwY/intruxPVjPT4epvSpNGATGjjT0YVB3Wc0saScSyJx4Mx2tcyHI8ohc0gUI8A wy4bjnweuW2UZU1L2DB7ArNVlxefzaMl+GUJl7oiucrlL+h8xjcO5UHQ8TZ//0J1f6+F NsYFVjsHxmtoRH7vGU5GERa0ogli6HEoZ7jEpxS9z+fINHawV1Eowry5YmBwyXMv4LmH NYzzs+c/xBZXwtRBKKE3Vn4vL9b6GMv2oHFtrcr+XINqyLGLCH6FWltKBBhOKEvRVUoS +h1A== X-Gm-Message-State: AO0yUKVu9RilfPGY4Ir7VNMz4291yzRJ3dug4Yyx+5G7Q5CEqtCGcMSb 5COT8m5aMd9oqx4v6HQEdXn4gLftZ0HAHTbL X-Google-Smtp-Source: AK7set9q2h1srIshc6+98FGTOXpAptE4FjJI7cHjvPEQVKBK5V600XiICODVGVtm1KiZFbth7jGQiQ== X-Received: by 2002:a17:90b:1a8e:b0:230:2b29:aa66 with SMTP id ng14-20020a17090b1a8e00b002302b29aa66mr8397941pjb.36.1675384466072; Thu, 02 Feb 2023 16:34:26 -0800 (PST) Received: from [192.168.50.194] (rrcs-173-197-98-118.west.biz.rr.com. [173.197.98.118]) by smtp.gmail.com with ESMTPSA id v15-20020a17090a0e0f00b002265ddfc13esm3742146pje.29.2023.02.02.16.34.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Feb 2023 16:34:25 -0800 (PST) Message-ID: <9679b684-575c-12f4-9322-f4c1fe3c0148@linaro.org> Date: Thu, 2 Feb 2023 14:34:22 -1000 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 v12 08/31] string: Improve generic strncmp Content-Language: en-US To: Adhemerval Zanella , libc-alpha@sourceware.org, Jeff Law , Xi Ruoyao , Noah Goldstein References: <20230202181149.2181553-1-adhemerval.zanella@linaro.org> <20230202181149.2181553-9-adhemerval.zanella@linaro.org> From: Richard Henderson In-Reply-To: <20230202181149.2181553-9-adhemerval.zanella@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,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 2/2/23 08:11, Adhemerval Zanella wrote: > It follows the strategy: > > - Align the first input to word boundary using byte operations. > > - If second input is also word aligned, read a word per time, check > for null (using has_zero), and check final words using byte > operation. > > - If second input is not word aligned, loop by aligning the source, > and merge the result of two reads. Similar to aligned case, check > for null with has_zero, and check final words using byte operation. > > Checked on x86_64-linux-gnu, i686-linux-gnu, powerpc64-linux-gnu, > and powerpc-linux-gnu by removing the arch-specific assembly > implementation and disabling multi-arch (it covers both LE and BE > for 64 and 32 bits). > --- > string/strncmp.c | 138 ++++++++++++++++++++++++++++++++++------------- > 1 file changed, 101 insertions(+), 37 deletions(-) Reviewed-by: Richard Henderson r~