From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by sourceware.org (Postfix) with ESMTPS id 60F253858C52 for ; Sat, 4 Feb 2023 02:54:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 60F253858C52 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-pl1-x62a.google.com with SMTP id z1so7097961plg.6 for ; Fri, 03 Feb 2023 18:54:31 -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=w4kqAP58kBLsqYGm9Kl8BYOQMT15ToK67TcRXaiyxAA=; b=u4KUqv+FkuWlW9eOT3C3RHoCRTAMZKtV4pdGukPBdVGMSULZmiLFU8dROb73WeYyVL gbGNJa12MQveH0/dSUcTiDPJnaGAtSDyNrKiYN9Aaa+URTkekbbLbiYg5xUx9GLqyU1V F6X/geG/RqPIX95fG+xMe3zM1B/ooszjAlJIiQ+dLF6gqAydI7s6L9Ta4PZP2kTk5r19 hmP2jXIwrZTaWo3UCCCCmhnYiUVDcjXUysZO/6+t/5A9dCBrc7uvz3tcRG8paXYA1m/5 cgzWDthGClvYcV6qwpL6A/lDd7nI18mon6ytWCfl+yIMOYegGO8Dr9DjNI94xpA4RsQQ nvEA== 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=w4kqAP58kBLsqYGm9Kl8BYOQMT15ToK67TcRXaiyxAA=; b=VINLFyxouOED7YUeOM6NQnQYvvozdhkc9EeW+fRdSqwY6al3udSFV6HIvBa3gbAP3V Wn6/Eix3r9sHdBvlOO1+yCnlH+j/UdsI+wWCCCQoxohIoZMZpH4Cy0L4XcY2OY9yVZ4Z 3oHwiCqjKpDPi/9J44ojSQpX11r6AfgdbDY+vIh8dl69Jh/aZz2WDXgDsWsgmc9/DE/s EPF137g+k2BqrHGXkziAr4rWHajWU4heygOeuLj/NnJjYpcZzyna4O4ZCL4esPHvhZgi qlRlQoKcxoYFaF6dV3vXQtsYRnaFeW9fftx2oIF1rTjdCr/9dbonont76CYyPoy3N2rD cGuQ== X-Gm-Message-State: AO0yUKUniV/9IEQNMX8rYyYFa5p9PfFQqg7aC7RHEWAzJXG34q0pwlSF 6diFbohC/kDfhmFt3iKexlx/eQ== X-Google-Smtp-Source: AK7set+B0WYAP8FOBRdRMtTNTJdy+eDeWzNBeLzazVAWWnYmqdPOMHoAE3AiIRsrxyazGpio+JfBhg== X-Received: by 2002:a17:902:f314:b0:198:ed2e:db64 with SMTP id c20-20020a170902f31400b00198ed2edb64mr1418478ple.39.1675479270197; Fri, 03 Feb 2023 18:54:30 -0800 (PST) Received: from [192.168.50.177] (rrcs-173-197-98-118.west.biz.rr.com. [173.197.98.118]) by smtp.gmail.com with ESMTPSA id p18-20020a170902a41200b00198d5c7cafasm2311482plq.156.2023.02.03.18.54.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 03 Feb 2023 18:54:29 -0800 (PST) Message-ID: Date: Fri, 3 Feb 2023 16:54:26 -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 03/31] Add string vectorized find and detection functions Content-Language: en-US To: Adhemerval Zanella Netto , libc-alpha@sourceware.org, Jeff Law , Xi Ruoyao , Noah Goldstein References: <20230202181149.2181553-1-adhemerval.zanella@linaro.org> <20230202181149.2181553-4-adhemerval.zanella@linaro.org> <0fcb2e73-6191-82bb-1dfd-19061ad16dea@linaro.org> From: Richard Henderson In-Reply-To: <0fcb2e73-6191-82bb-1dfd-19061ad16dea@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.6 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/3/23 03:40, Adhemerval Zanella Netto wrote: > I will send only this patch to avoid resend all the thread that is already > reviewed. > > --- > > [PATCH 03/31] Add string vectorized find and detection functions > > This patch adds generic string find and detection meant to be used in > generic vectorized string implementation. The idea is to decompose the > basic string operation so each architecture can reimplement if it > provides any specialized hardware instruction. Reviewed-by: Richard Henderson r~ > > The 'string-misc.h' provides miscellaneous functions: > > - extractbyte: extracts the byte from an specific index. > - repeat_bytes: setup an word by replicate the argument on each byte. > > The 'string-fza.h' provides zero byte detection functions: > > - find_zero_low, find_zero_all, find_eq_low, find_eq_all, > find_zero_eq_low, find_zero_eq_all, and find_zero_ne_all > > The 'string-fzb.h' provides boolean zero byte detection functions: > > - has_zero: determine if any byte within a word is zero. > - has_eq: determine byte equality between two words. > - has_zero_eq: determine if any byte within a word is zero along with > byte equality between two words. > > The 'string-fzi.h' provides positions for string-fza.h results: > > - index_first: return index of first zero byte within a word. > - index_last: return index of first byte different between two words. > > The 'string-fzc.h' provides a combined version of fza and fzi: > > - index_first_zero_eq: return index of first zero byte within a word or > first byte different between two words. > - index_first_zero_ne: return index of first zero byte within a word or > first byte equal between two words. > - index_last_zero: return index of last zero byte within a word. > - index_last_eq: return index of last byte different between two words. > > The 'string-shift.h' provides a way to mask off parts of a work based on > some alignmnet (to handle unaligned arguments): > > - shift_find, shift_find_last. > > Co-authored-by: Richard Henderson