From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by sourceware.org (Postfix) with ESMTPS id 052BC3861865 for ; Thu, 8 Jul 2021 12:22:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 052BC3861865 Received: by mail-pj1-x102e.google.com with SMTP id h1-20020a17090a3d01b0290172d33bb8bcso5766327pjc.0 for ; Thu, 08 Jul 2021 05:22:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=sepQoQANyxffP7l36bEIKIbXA6W+wS1ODd/lkhFVR34=; b=cu/Um+h/T4QWtQdz0s/qj+eoBLE63+Spu6pWwkWkfnFUMUAmQKNj4lLnO6KHr4DULX 67CT2SWqstmET7VyjeZJ5R2DlUS6olLF2VKn7hfbMd7hhHoREpSrc70IpagpvFN5hLTd fOMrzT2Hwtplr40MX0asNDO4ke/Q4KyseR9uB0j927Ed/fQTmi31SmRlD5Jg+1lvyYA/ kX8zFVPJTfXXk+BKA0xXV16gK4LYHtvovNIrAwouCfiyV0DJs7oSNSQa+5c7r/jE15Qb 50mn0/xNVOUnm37hCW99Bojrx4J3XB/2SEwcns/Wo7ABF8Dg+8zcltONSbUOSGXWwrxZ zMcg== X-Gm-Message-State: AOAM5336OlkHJ3cWGJDxAYVmGvSdalnnshPCSuOj9ZC2IUC7kFSNdW5S wp63CZS9UHlBZzcUnN4sgJQJwluQLVfD5tJEGFg= X-Google-Smtp-Source: ABdhPJy+BshMnB2nmXsTImshg5iWbRUp77bUjy4jjueXwz9Jy2A5FWen6yC76zKMZlRvB7nA8uHr9C5iSwv2xXoImak= X-Received: by 2002:a17:902:7b8c:b029:129:5733:2e3b with SMTP id w12-20020a1709027b8cb029012957332e3bmr25799811pll.4.1625746925157; Thu, 08 Jul 2021 05:22:05 -0700 (PDT) MIME-Version: 1.0 References: <20210708081308.640036-1-goldstein.w.n@gmail.com> In-Reply-To: <20210708081308.640036-1-goldstein.w.n@gmail.com> From: "H.J. Lu" Date: Thu, 8 Jul 2021 05:21:29 -0700 Message-ID: Subject: Re: [PATCH v1] x86: Remove wcsnlen-sse4_1 from wcslen ifunc-impl-list [BZ #28064] To: Noah Goldstein Cc: GNU C Library , "Carlos O'Donell" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3031.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2021 12:22:07 -0000 On Thu, Jul 8, 2021 at 1:22 AM Noah Goldstein wro= te: > > The following commit > > commit 6f573a27b6c8b4236445810a44660612323f5a73 > Author: Noah Goldstein > Date: Wed Jun 23 01:19:34 2021 -0400 > > x86-64: Add wcslen optimize for sse4.1 > > Added wcsnlen-sse4.1 to the wcslen ifunc implementation list and did > not add wcslen-sse4.1 to wcslen ifunc implementation list. This commit > fixes that by removing wcsnlen-sse4.1 from the wcslen ifunc > implementation list and adding wcslen-sse4.1 to the ifunc > implementation list. > > Testing: > test-wcslen.c is passing as well as all other tests in wcsmbs and > string. > > Signed-off-by: Noah Goldstein > --- > I was unable to actually reproduce the bug on my machine, even after > reordering ifunc-wcslen.h to prefer the sse4.1 > implementation. Although this most definetly is a bug. > > > I ran the following command. Is there an issue with the command? Or > does rdx happen to always have a len >=3D actual length of the string? That must be the case. We can do something similar to sysdeps/x86_64/x32/tst-size_t-strnlen.c to write a testcase. > $> rm -rf build; mkdir -p build/glibc; (cd build/glibc/; unset LD_LIBRARY= _PATH; /absolute/path/to/src/glibc/configure --prefix=3D/usr; make --silent= ; make xcheck; make -r -C /absolute/path/to/src/glibc/string/ objdir=3D`pwd= ` check; make -r -C /absolute/path/to/src/glibc/wcsmbs/ objdir=3D`pwd` chec= k); > > > > sysdeps/x86_64/multiarch/ifunc-impl-list.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/sysdeps/x86_64/multiarch/ifunc-impl-list.c b/sysdeps/x86_64/= multiarch/ifunc-impl-list.c > index dbd1ebf298..39ab10613b 100644 > --- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c > +++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c > @@ -684,9 +684,9 @@ __libc_ifunc_impl_list (const char *name, struct libc= _ifunc_impl *array, > && CPU_FEATURE_USABLE (AVX512BW) > && CPU_FEATURE_USABLE (BMI2)), > __wcslen_evex) > - IFUNC_IMPL_ADD (array, i, wcsnlen, > + IFUNC_IMPL_ADD (array, i, wcslen, > CPU_FEATURE_USABLE (SSE4_1), > - __wcsnlen_sse4_1) > + __wcslen_sse4_1) > IFUNC_IMPL_ADD (array, i, wcslen, 1, __wcslen_sse2)) > > /* Support sysdeps/x86_64/multiarch/wcsnlen.c. */ > -- > 2.25.1 > LGTM. Reviewed-by: H.J. Lu --=20 H.J.