From patchwork Thu Oct 20 02:13:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Noah Goldstein X-Patchwork-Id: 1692233 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=IWjszO1R; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MtB4h1CkVz23kh for ; Thu, 20 Oct 2022 13:14:44 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3665A385DC14 for ; Thu, 20 Oct 2022 02:14:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3665A385DC14 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666232080; bh=/mDzgaQwq9FtAixrRDEKzArDqUzd5boHVZEXoUWrMr8=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=IWjszO1RDOvQNC/piu2UIeWXfaBf7sQAkIbCLVvFK/tyR//a8NJdsUqBSeiKg7mzp MlCMB36NgYsNHxrSwMyAza9rT5WylwF9GwZP6wzMQQiGa5bJm9kQdZerQPN6EUD1N/ MtWU/ffBkGq2PCSqTZZIRqsvOHxxoEtK48JWPaAM= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oa1-x31.google.com (mail-oa1-x31.google.com [IPv6:2001:4860:4864:20::31]) by sourceware.org (Postfix) with ESMTPS id 207703857360 for ; Thu, 20 Oct 2022 02:14:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 207703857360 Received: by mail-oa1-x31.google.com with SMTP id 586e51a60fabf-13af5b6263eso111768fac.8 for ; Wed, 19 Oct 2022 19:14:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/mDzgaQwq9FtAixrRDEKzArDqUzd5boHVZEXoUWrMr8=; b=oLpTJ2eB1RSRcHjM0ho/4JGl7U8piTvNCDfKlmUfGSC8fyO8kzcXHWMMxPWb4WXgmx nLcQ9N23ohaH6teqNyw8Ogm7cAayQLUS8mZvcKoaXvp6JRRQ+DDGSDmTeCeK8Z9c9yBe AWaCGYO9HXAiG3eYNyPT2dYPevRZNBQneSA2e14eiTgeqIpaavprqWn3JEPBfZTimUeb 4J5rcn9/BGLC0pcZojONj/CVqFAy2AbjvzUlrQxL9sI+SRc9fDVm2ojW7fyH77YpcI0L qAqZ8U1EB6xZX4pPjKG+JE9Q7AwjuxS1x4rP3jIRpBS22qh5x+OTElUo0dnwGtp2KEYG 9fHw== X-Gm-Message-State: ACrzQf2/88tIa6047CP38RsirRGMbqR+bY7vZJSmDY8ha7/Wkec6XD+5 7gHD+IhB3YPUzDWhhf6TRkhfGfU+/NzdVw== X-Google-Smtp-Source: AMsMyM7pELJoWRT4varKOa+LDsyjRdTBhLt3i3KdEnbTzbsZi3YRIc/cV9fHtWXH8iP5RX6PYPhvwA== X-Received: by 2002:a05:6870:4601:b0:133:22c9:abc6 with SMTP id z1-20020a056870460100b0013322c9abc6mr6961887oao.232.1666232060105; Wed, 19 Oct 2022 19:14:20 -0700 (PDT) Received: from noah-tgl.lan (2603-8080-1301-76c6-bfae-083c-6dae-542c.res6.spectrum.com. [2603:8080:1301:76c6:bfae:83c:6dae:542c]) by smtp.gmail.com with ESMTPSA id q10-20020a056830440a00b00661a5ef58a0sm7843243otv.23.2022.10.19.19.14.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 19:14:19 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v1 1/4] x86: Use `testb` for case-locale check in str{n}casecmp-avx2 Date: Wed, 19 Oct 2022 19:13:35 -0700 Message-Id: <20221020021338.3394281-1-goldstein.w.n@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_NUMSUBJECT, 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 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+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" `testb` saves a bit of code size is the imm-operand can be encoded 1-bytes. Tested on x86-64. --- sysdeps/x86_64/multiarch/strcmp-avx2.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysdeps/x86_64/multiarch/strcmp-avx2.S b/sysdeps/x86_64/multiarch/strcmp-avx2.S index 4c01d664e8..a24f886a27 100644 --- a/sysdeps/x86_64/multiarch/strcmp-avx2.S +++ b/sysdeps/x86_64/multiarch/strcmp-avx2.S @@ -214,7 +214,7 @@ STRCMP: # else mov (%LOCALE_REG), %RAX_LP # endif - testl $1, LOCALE_DATA_VALUES + _NL_CTYPE_NONASCII_CASE * SIZEOF_VALUES(%rax) + testb $1, LOCALE_DATA_VALUES + _NL_CTYPE_NONASCII_CASE * SIZEOF_VALUES(%rax) jne STRCASECMP_L_NONASCII leaq _nl_C_LC_CTYPE_tolower + 128 * 4(%rip), TOLOWER_BASE # endif