From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by sourceware.org (Postfix) with ESMTPS id 9E19F3857025 for ; Thu, 8 Jul 2021 20:15:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9E19F3857025 Received: by mail-pj1-x1030.google.com with SMTP id oj10-20020a17090b4d8ab0290172f77377ebso4725160pjb.0 for ; Thu, 08 Jul 2021 13:15:55 -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; bh=XNYUYlCW75Y6ObfMHohTprVLiw66ktR3hb/0LA1qyZc=; b=lQ7Iz5R8DvhG3gfrwlus/M0Yw3scZwncyegJAKp0D5t7dBBTQgZnaE5WMWhkZlNhiM /A8bmOgPfkvVm6F6as7Jeqi+fomuQYMJ4y5qF09Jx6IrVe1RPM6BZhsCg12mBMAT1Wqa 3hD0FpPAG1Pw3oAhkylacOznu9WgpDNolhnCzC5Tkw8Jztb2q3hbwDR0KNPnpmrAHDpI D/FBFjs6b7M7iYonSYJuCBcj5SJiQAf0CtVQl1CeKbuFvCcBbRCN8qdKNyEg/tssOpoE ys2C6OVzqG3kyvgT8CO9DmIcECQlhmtxjwnG+R1k36he/rU4BJHzr0K+VQw4CjlAAN2k LGkw== X-Gm-Message-State: AOAM530Vybv/BlXrOjpQ5S92uB12zdgfa8BGdKx36Y0IYxNaDxzGf7HD jmNLT5ndwAZ/IMwvr+fLAjgkmJKesiL3Eejf8qM= X-Google-Smtp-Source: ABdhPJy7s3FXu2oLgESMv/9FKvYRWg6B4gDYvYNmHH8+aPBAOoK7mBRX3FgfOyelI+vMt2WtJ1cL+XhlVOGmsxS+j3k= X-Received: by 2002:a17:90a:eb11:: with SMTP id j17mr35156109pjz.177.1625775354837; Thu, 08 Jul 2021 13:15:54 -0700 (PDT) MIME-Version: 1.0 References: <20210708081308.640036-1-goldstein.w.n@gmail.com> In-Reply-To: From: Noah Goldstein Date: Thu, 8 Jul 2021 16:15:43 -0400 Message-ID: Subject: Re: [PATCH v1] x86: Remove wcsnlen-sse4_1 from wcslen ifunc-impl-list [BZ #28064] To: "H.J. Lu" Cc: GNU C Library , "Carlos O'Donell" X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, HTML_MESSAGE, 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 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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 20:15:58 -0000 On Thu, Jul 8, 2021 at 11:08 AM H.J. Lu wrote: > On Thu, Jul 8, 2021 at 6:57 AM H.J. Lu wrote: > > > > On Thu, Jul 8, 2021 at 5:21 AM H.J. Lu wrote: > > > > > > On Thu, Jul 8, 2021 at 1:22 AM Noah Goldstein > wrote: > > > > > > > > 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 >= 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. > > > > Here is the patch with a testcase. Please include it in your fix and > > mention BZ #28064 in your commit log. > Done. > > Please use this patch passing a pointer to do_strlen for x32. > Done. Made it first patch in patchset. > > > > > $> rm -rf build; mkdir -p build/glibc; (cd build/glibc/; unset > LD_LIBRARY_PATH; /absolute/path/to/src/glibc/configure --prefix=/usr; make > --silent; make xcheck; make -r -C /absolute/path/to/src/glibc/string/ > objdir=`pwd` check; make -r -C /absolute/path/to/src/glibc/wcsmbs/ > objdir=`pwd` check); > > > > > > > > > > > > > > > > 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 > > > > > > -- > > > H.J. > > > > > > > > -- > > H.J. > > > > -- > H.J. >