From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oo1-xc29.google.com (mail-oo1-xc29.google.com [IPv6:2607:f8b0:4864:20::c29]) by sourceware.org (Postfix) with ESMTPS id B0E893858C33 for ; Mon, 16 Oct 2023 16:56:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B0E893858C33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B0E893858C33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::c29 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697475373; cv=none; b=KgHTGERl74Jq1HHAS4gBwuA3rg1J0QU4p8j9vUIs4rgjrb59lEuqfifC7gBQ4t4YDGbJ6/Yj2cq6F8fNFb1qX8JK1ZR0mxfbbBgCzlx8+zmgj7NW7/JO5TChWEgXghOC1beGZLCxtzSfhrQ0sA3x9iCJHsj0aeTZeDTOOBTh0uM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697475373; c=relaxed/simple; bh=pMG9Lr5Z7UE6FQHTX4EVYgXSV25UyVkyQy0jCS0Em1w=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=lJUcyor5zv92U8jPLqaXFO+Sl26OVKLRAHpYYTJ4ooWdi4u7uRQtdWIjBfjGN7m6ny5KR3r/svxP7CqGhifsCq54g2MSeMa/wCBhcB1pAe3GSP0JDho/wxruJfVXBiIaDRttpUztRcdnd6ygLIDiOqvnuozeoydB8IGnxIfkcjQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oo1-xc29.google.com with SMTP id 006d021491bc7-5812eaed1eeso2401259eaf.0 for ; Mon, 16 Oct 2023 09:56:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697475371; x=1698080171; darn=sourceware.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=pMG9Lr5Z7UE6FQHTX4EVYgXSV25UyVkyQy0jCS0Em1w=; b=itzHtlXPzseoo12nSqNWylSmUC3HydoUxnJZL8CL8o++ikuPdg993idkLA6qqEXl/x zuRfIqhKz4lHhh5kDypxA/qsWrtMnaB8j9HehovCPTaClFQccBQT61vYTnVbMvImmh3z rjhtId4l6GCWfeTFKbyFVJDZiMWCdE1t142YINlrEW7HU4ENo+U4hFgGcfuzvknNsCd3 ktNUAdjNA4IituyFtgzbzbdnSftBCAYlboQe7A7lv0ciptpmPqpZBhCg28DVJe14gHAP uI1sEZ8fjPcO7tsOG0a4wleVUfzzrvRl0IsTHbtC1dQ/UkbJ0K/WgkQUlkTdVJDQk+ol QWaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697475371; x=1698080171; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pMG9Lr5Z7UE6FQHTX4EVYgXSV25UyVkyQy0jCS0Em1w=; b=OPJP83StQi5pGxvvWZZNTKdOlm2ahUFNFpKXT95i+0q1HR+xzPABMU7TAkemsAuoNe rf0DBtXuDSFL3Rv+BXNtuSQTuPFDCpRduSeDclp9TZRTjEvsgTMOlzV2trnJZA7vbw3j GusU0AzE6se5HfqrT/2hfCygQde8YZFg3szbXPAaig5AuOJUh3flsd9yiKSwcunFd6v6 EyV5URB4ZIbfS95u13838LGPUlaGLTwqcdeGRaRKwvwWUS6bUglCCurf19gtUo+BiJ/Q VN+PBgb0X8GXSPrBHJLt5O2Bp2cwjIYVYwGsYI7nSZ4w0OmldFs+bexXSW8YZF/MLmtS xRDw== X-Gm-Message-State: AOJu0YwAELvagXZJ6Jv8dZOWb5h2lWL14Uc5px5pohi9e8BoOGfCdWVO Dr8fqJXEg0G+QAl8C3GP9Tk3mT/O+6ikv6mMtMI= X-Google-Smtp-Source: AGHT+IHI46tTSAq1xkO26VpE+TmvJZOyokbHBOXG08do6p4qkmOiLV13WVMu3i6r5L2k7D7vAOyBDSRW9c/nBEreGIc= X-Received: by 2002:a05:6870:648d:b0:1ea:2447:5181 with SMTP id cz13-20020a056870648d00b001ea24475181mr4988140oab.9.1697475370793; Mon, 16 Oct 2023 09:56:10 -0700 (PDT) MIME-Version: 1.0 References: <20231014083253.138510-1-tirtajames45@gmail.com> <8deea669-21b6-442b-a58a-05be075290a8@linaro.org> In-Reply-To: From: Noah Goldstein Date: Mon, 16 Oct 2023 11:56:00 -0500 Message-ID: Subject: Re: [PATCH] strcasestr: check if ne[0] is in hs with strchr or strpbrk as does strstr To: Wilco Dijkstra Cc: Adhemerval Zanella Netto , James Tirta Halim , "libc-alpha@sourceware.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,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 Mon, Oct 16, 2023 at 8:52=E2=80=AFAM Wilco Dijkstra wrote: > > Hi Adhemerval/James, > > > We have the sysdep folder exactly to provide such macros if requires, f= or instance > > the file sysdeps/generic/string-fzi.h. > > > > So if this optimization is really worth, the best way to provide would = be through > > a generic implementation like: > > I ran it on my x86 machine (with proper AVX-512), and the "optimized" str= cspn is > slower than the simple byte loop on bench-strcasestr. "optimized" being the sse4 version? > While the benchmark could > likely be improved, it shows this target specific optimization isn't wort= h doing. > > Cheers, > Wilco