From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by sourceware.org (Postfix) with ESMTPS id 969633858C2D for ; Wed, 1 Feb 2023 17:37:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 969633858C2D 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-pf1-x430.google.com with SMTP id ay1so13027410pfb.7 for ; Wed, 01 Feb 2023 09:37:52 -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=bwB1XIZeWSP3Q84JaiumbTRyPhlLMwTN5pSx4rU4GgM=; b=PGcueU0zatkJXWcCDkYi7HYm+cHA9VlU0UwBRGV0pl24HRwOHYUXHjsN4+VhTdZzFH DPiAn+6LCO7cOYOAOkiHtjBIKF5wvqDk/sLrC32XEUSs5YT/sgEjYf0qX7Q841tejrak gLii4lfASLKrz7nF1pFB+EhWRB8ChjUwP0506d9Y0Vn7IwkWbxR2Y/STiAmftAmPHeWf 4lAdLRpOxJEw/bB5NdGVv8MIPydPBBf2DFY4/Qfw5DGH5nAjSDg28rxv80RaXH9WLPJg PsjeKtum/XwCC0VsCbcO40+qcqJ5QddCVqqlttgpSL4oY/i/OaZLD0/TO5MEzaKEhXMi 0p5A== 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=bwB1XIZeWSP3Q84JaiumbTRyPhlLMwTN5pSx4rU4GgM=; b=Ncf0lXnxZLmkwFzA84CxVb0bBXJNUIR7O443/vejooqLC+SGyXdISr9X6ippEuUjoa qIienls66bgZms8qKU+8pWfUPTlaVl4Q8hyjTIw6TA0dFyMl5oD4Xi0h8Tzg5xL9tfIg gEa2hhiM4EKzF20p7H3ljrmj2cUfptFYQEJD0wbTD1c69GT4wtD+XueIU3syVs+ZEyV5 ZQ/u1XjYV9Fk9xoo1BN9KGG5EEBFPtPs3LImk7jbN5J5t72rZgoe4pWV7atpgk3pDHNL 0r6woyFDsPjINdSxvOFyoiRiLRTC2Z0nvy+uKIfyBYR+UZHdMK8xK+K4+rxQbH3/b67I Rd7A== X-Gm-Message-State: AO0yUKVDTaFD8D2QkCpC3+X537SZnIT7jGoqQGj1zfDMUTM9Dko5Zf3D 9HUTbrbHTekk63sFrnp9dcwwhw== X-Google-Smtp-Source: AK7set+tT0NJ3fNLCMLR//ZiuqFShutW/2jUg+f26mj3NH8C/caqrzRCONXYB+dCxeovb0Mt6wpVQw== X-Received: by 2002:a05:6a00:1491:b0:593:f41a:fc86 with SMTP id v17-20020a056a00149100b00593f41afc86mr4110147pfu.24.1675273071532; Wed, 01 Feb 2023 09:37:51 -0800 (PST) Received: from [192.168.50.50] (rrcs-173-197-98-118.west.biz.rr.com. [173.197.98.118]) by smtp.gmail.com with ESMTPSA id a15-20020a62d40f000000b0059275411af8sm10318523pfh.62.2023.02.01.09.37.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Feb 2023 09:37:51 -0800 (PST) Message-ID: Date: Wed, 1 Feb 2023 07:37:47 -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 v11 10/29] string: Improve generic stpcpy Content-Language: en-US To: Adhemerval Zanella , libc-alpha@sourceware.org, Noah Goldstein , Jeff Law , Xi Ruoyao References: <20230201170406.303978-1-adhemerval.zanella@linaro.org> <20230201170406.303978-11-adhemerval.zanella@linaro.org> From: Richard Henderson In-Reply-To: <20230201170406.303978-11-adhemerval.zanella@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.2 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/1/23 07:03, Adhemerval Zanella wrote: > It follows the strategy: > > - Align the destination on word boundary using byte operations. > > - If source is also word aligned, read a word per time, check for > null (using has_zero from string-fzb.h), and write the remaining > bytes. > > - If source is not word aligned, loop by aligning the source, and > merging the result of two reads. Similar to aligned case, > check for null with has_zero, and write the remaining bytes if > null is found. > > 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/stpcpy.c | 92 +++++++++++++++++++++++++++++++++++++++++++++---- > 1 file changed, 86 insertions(+), 6 deletions(-) Reviewed-by: Richard Henderson r~