From patchwork Thu Jul 8 08:13:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Noah Goldstein X-Patchwork-Id: 44214 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 029A23982419 for ; Thu, 8 Jul 2021 08:22:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 029A23982419 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1625732577; bh=/P46Q5IVdR0O2DphXZ6YTvVSIPmOm1FOUmveL+/gBLs=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=qRbEsEuj43/l5+PJMeoQmckJmVa2KFHYSHJYpqcGHhGDUxWI0LMXJyYLnTxHyzwRN 4jqECilFQzdTTYoaOx5RqYW/j8Sd26cdLik9G2fNxhFlFph3ryjmxGqPH/FUgSBzeQ EbpgerleaK3oM9ThNiY8cT5kUNl5ex2TIkB/BG3Y= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) by sourceware.org (Postfix) with ESMTPS id 528613982416 for ; Thu, 8 Jul 2021 08:22:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 528613982416 Received: by mail-qk1-x72a.google.com with SMTP id 77so3111014qkk.11 for ; Thu, 08 Jul 2021 01:22:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/P46Q5IVdR0O2DphXZ6YTvVSIPmOm1FOUmveL+/gBLs=; b=KoMCqrwgF8HdP8pYQvutKwLzFHG0UcbWZUQvOKLHt7dH/z66hVUkdMXwoeICuV+K7a lTeahS8HDSvMJJm8TsM/2US/xeeugjKK8SDZpx7QbYSzyYBNKDoedYWxr6u1M9X0uebi re1ytX8XZbpPPxkPKLxmOp/r5QSuLIG17QggDNPUXgBOXishsLB76rfMbbSph7Zba8w1 nmuitF3HIxD+wqRaQ/9Th/sDFI9MamEvr6Q5EyiiqCIcza/0afuaJWIpM2KPzSyks9Zo w9x5Ivi7G1MZ7rUl9bJ8T2kmqSTfGYw3V2zHK2CS2fzvSzrnbGt52DCxQO9w8vbnFKwz r0uQ== X-Gm-Message-State: AOAM531Az7uEgMSEMOcjQGx3c7rS1IP+Illq+IlH5rVXPiOPI0Yq3wf2 QhXZVMpVEDPT11h4uefIIoKOPz6q7gU= X-Google-Smtp-Source: ABdhPJzoFxgXKqBP89WYWuNgmIlanybHSkm/Fu5GtcFvsbK3YiTfbu8TiVWN2rdtq5C/UvyWKW0dSQ== X-Received: by 2002:ae9:eb90:: with SMTP id b138mr5254236qkg.405.1625732519811; Thu, 08 Jul 2021 01:21:59 -0700 (PDT) Received: from localhost.localdomain (pool-173-75-15-191.pitbpa.fios.verizon.net. [173.75.15.191]) by smtp.googlemail.com with ESMTPSA id s13sm698025qkm.87.2021.07.08.01.21.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jul 2021 01:21:59 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v1] x86: Remove wcsnlen-sse4_1 from wcslen ifunc-impl-list [BZ #28064] Date: Thu, 8 Jul 2021 04:13:10 -0400 Message-Id: <20210708081308.640036-1-goldstein.w.n@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Status: No, score=-12.4 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-Patchwork-Original-From: Noah Goldstein via Libc-alpha From: Noah Goldstein Reply-To: Noah Goldstein Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" 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 Reviewed-by: H.J. Lu --- 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? $> 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. */