From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by sourceware.org (Postfix) with ESMTPS id 91881386F0E6 for ; Sun, 3 Jul 2022 18:01:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 91881386F0E6 Received: by mail-pg1-x52b.google.com with SMTP id z14so7028777pgh.0 for ; Sun, 03 Jul 2022 11:01:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bojiWtBrbjC4dv3mYJ0FiJTWMHCGSOG6fYA/7VtyOL8=; b=frYdt11r025VVtfGL7XtkbP1f4FQYLLvBHSxa/zTZoKkcCKY9CENtvZeBrnwzt9pyW b39RvYXc/o7KeAW8s5pswFOClqhYX1U+2XmwyLrxugO8d/2hQ4xcRVQDzrZl6fE284aS PpmZX/PCK+lv0dwRwd0ZHaERvF6sYLnbcFqFD3UT/EKZ9s6hKSFtGUcoJbCznEfmQZzW 7vQYLMA7ey3fX1yKVwSCaIIKb0QDd+92sPDoUbucF3DQAAQpJ1YFDjaqs6UY74MveuGQ RwNcamwXAHRtQZY1fUIkYwcjDlr6esFFETEuDdw+HvaQha54DdBBqtcHigSDBTUgP9GM Wrcw== X-Gm-Message-State: AJIora+5WBLRlw/+FQJ74qsq9uKxOd1LT/hwRjJmkosxjBP1kndN+j04 bYCeUQtW+/v+84uU9T0ZcZKARm1kMttfo4/ENaA= X-Google-Smtp-Source: AGRyM1uh8Mk92PrpHCDCXzbPSf+Lg6wHdsHmamQtCdUwt2ltm6r/S4wjzyo+oaxXMuLiZbg9Ny/1NoYnE0dZvMFT5II= X-Received: by 2002:a63:b54c:0:b0:40c:7b84:4f7f with SMTP id u12-20020a63b54c000000b0040c7b844f7fmr21208665pgo.586.1656871262486; Sun, 03 Jul 2022 11:01:02 -0700 (PDT) MIME-Version: 1.0 References: <20220628152717.17838-1-goldstein.w.n@gmail.com> <20220630201319.3777218-1-goldstein.w.n@gmail.com> In-Reply-To: From: "H.J. Lu" Date: Sun, 3 Jul 2022 11:00:26 -0700 Message-ID: Subject: Re: [PATCH v6 1/2] x86: Add comment explaining no Slow_SSE4_2 check in ifunc-sse4_2 To: Noah Goldstein Cc: GNU C Library , "Carlos O'Donell" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3024.6 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: Sun, 03 Jul 2022 18:01:06 -0000 On Fri, Jul 1, 2022 at 3:52 PM Noah Goldstein wrote: > > On Fri, Jul 1, 2022 at 3:38 PM H.J. Lu wrote: > > > > On Thu, Jun 30, 2022 at 5:01 PM Noah Goldstein wrote: > > > > > > On Thu, Jun 30, 2022 at 5:01 PM Noah Goldstein wrote: > > > > > > > > On Thu, Jun 30, 2022 at 4:20 PM H.J. Lu wrote: > > > > > > > > > > On Thu, Jun 30, 2022 at 1:13 PM Noah Goldstein wrote: > > > > > > > > > > > > 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 | 4 ++++ > > > > > > 1 file changed, 4 insertions(+) > > > > > > > > > > > > diff --git a/sysdeps/x86_64/multiarch/ifunc-sse4_2.h b/sysdeps/x86_64/multiarch/ifunc-sse4_2.h > > > > > > index ee36525bcf..752798278c 100644 > > > > > > --- a/sysdeps/x86_64/multiarch/ifunc-sse4_2.h > > > > > > +++ b/sysdeps/x86_64/multiarch/ifunc-sse4_2.h > > > > > > @@ -27,6 +27,10 @@ IFUNC_SELECTOR (void) > > > > > > { > > > > > > const struct cpu_features* cpu_features = __get_cpu_features (); > > > > > > > > > > > > + /* This function uses slow sse4.2 instructions (pcmpstri) but since > > > > > > + there is no other optimized implementation keep using it. If an > > > > > > + optimized fallback is added add a X86_ISA_CPU_FEATURE_ARCH_P > > > > > > + (cpu_features, Slow_SSE4_2) check. */ > > > > > > > > > > This function always uses sse4.2 instructions (pcmpstri) since there > > > > > is no other optimized implementation. If an ... > > Then always uses slow sse4.2... SSE4.2 isn't always slow. > Also I think there needs to be a 'but' before since otherwise the sentence > sounds like it's saying the function uses sse4.2 because there are no > other implementations. because there are no other "optimized" implementations. > > > > > > > > Is it all sse4.2 instructions that count for Slow_SSE4.2 or other the > > > > microcode string ones? > > > other->only* > > > > No. Only the string instructions are slow. > > > > > > > > > > > > > if (CPU_FEATURE_USABLE_P (cpu_features, SSE4_2)) > > > > > > return OPTIMIZE (sse42); > > > > > > > > > > > > -- > > > > > > 2.34.1 > > > > > > > > > > > > > > > > > > > > > -- > > > > > H.J. > > > > > > > > -- > > H.J. -- H.J.