From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by sourceware.org (Postfix) with ESMTPS id 0835C385735C for ; Mon, 4 Jul 2022 04:28:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0835C385735C Received: by mail-pj1-x1029.google.com with SMTP id g20-20020a17090a579400b001ed52939d72so8365312pji.4 for ; Sun, 03 Jul 2022 21:28:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Q202AflrMLxG76iDw0ynOLxvx4W+9NaU3YdjuMV3rgk=; b=Ny+H4wUoMVOc9kWhjoet0dvlt3Y8617MxkWZjbakezLMhHzPd7AHRTCx3bD7GJr7wC HqoSjfAqdaVp9+2m9C0E3Y1r17Cj0HOi+rz254ZCo/XQ0fk3ZBpQr2LKjXF8gW6cwr/y NVgabN2OiwZ+RU/KG67BIrqKjF8QBV71Obx/0pCbk/AyFWOz+i7c+VMEqetwDe4vD5c1 FfawigsS0s+VP/s8XBsmKHnIOMYNY3sz1wag+zDeb43VqQweGRuLJWzacWnJzhqkofW7 BDN+PStSgewPKNW2CkhYGRXHXKmBOiY5eGoMmJ+8Izc6hqOEgnHFAiZAuMTrf+ioiSS0 Bjxg== X-Gm-Message-State: AJIora/XV47E+oh7S77SK/i88Ac5eEzHtKrj8AQJ+2ke5V1escORlBfu +IaLIeKxzaap38xtk8rnjFfHoau84WE= X-Google-Smtp-Source: AGRyM1v0pCxTaczcPcKLXD4lOuWL6SQZfMSu1/aOEaFkF20hPyvZq6KkJUezkCf+bvOZXESiBIUG3Q== X-Received: by 2002:a17:90a:f48a:b0:1ed:5ec:f890 with SMTP id bx10-20020a17090af48a00b001ed05ecf890mr34323026pjb.40.1656908888957; Sun, 03 Jul 2022 21:28:08 -0700 (PDT) Received: from noah-tgl.hsd1.ca.comcast.net ([2601:642:c302:8c00:49fb:7665:e6a4:2078]) by smtp.gmail.com with ESMTPSA id i4-20020a17090332c400b0016a4db13435sm19999327plr.191.2022.07.03.21.28.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Jul 2022 21:28:08 -0700 (PDT) From: Noah Goldstein To: libc-alpha@sourceware.org Subject: [PATCH v7 1/2] x86: Add comment explaining no Slow_SSE4_2 check in ifunc-sse4_2 Date: Sun, 3 Jul 2022 21:28:06 -0700 Message-Id: <20220704042807.3863553-1-goldstein.w.n@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220628152717.17838-1-goldstein.w.n@gmail.com> References: <20220628152717.17838-1-goldstein.w.n@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.9 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, T_SCC_BODY_TEXT_LINE 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-List-Received-Date: Mon, 04 Jul 2022 04:28:11 -0000 Just for clarities sake and so that if a future implementation is added we remember to add the check. --- sysdeps/x86_64/multiarch/ifunc-sse4_2.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sysdeps/x86_64/multiarch/ifunc-sse4_2.h b/sysdeps/x86_64/multiarch/ifunc-sse4_2.h index ee36525bcf..f8b56936ec 100644 --- a/sysdeps/x86_64/multiarch/ifunc-sse4_2.h +++ b/sysdeps/x86_64/multiarch/ifunc-sse4_2.h @@ -27,6 +27,12 @@ IFUNC_SELECTOR (void) { const struct cpu_features* cpu_features = __get_cpu_features (); + /* This function uses the `pcmpstri` sse4.2 instruction which can be + slow on some CPUs. This normally would be guarded by a + Slow_SSE4_2 check, but since there is no other optimized + implementation its best to keep it regardless. If an optimized + fallback is added add a X86_ISA_CPU_FEATURE_ARCH_P (cpu_features, + Slow_SSE4_2) check. */ if (CPU_FEATURE_USABLE_P (cpu_features, SSE4_2)) return OPTIMIZE (sse42); -- 2.34.1