From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0:4864:20::32a]) by sourceware.org (Postfix) with ESMTPS id 665043857366 for ; Mon, 4 Jul 2022 04:28:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 665043857366 Received: by mail-ot1-x32a.google.com with SMTP id 7-20020a9d0107000000b00616935dd045so6823951otu.6 for ; Sun, 03 Jul 2022 21:28:59 -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=/nSiHt1AfYGOe560b76WI7M7KtN0CQhDuvDmw3OHZWU=; b=hlI6G6wOJF52ogSoqQDic3rX3yk8xWEmLXAbcXWztFUSl5ue6FaF0q3Is6iriNRoKx CoMK6Vx/5d/FO1ztdM0wHxYHS2SaUxhykF+6aiTX5lUEb/Cw4+nMbAwDURBAlYRr0kFM ycTYrZfws7lHln4D2+l1wkxYf6vyVR/hJ4Ln+X30ICMsWIpdQP2vvgKdT90puQ9Q8AVn 4qgmiZI1RA3EzAZNookVBo8Pfmn9e22dabcDelFwPPp57/WhX2IHUIpzDyP6NPuKL9gd CRcvBjbU/+76vjR7dJ0l5ZH3smFxZfpYvpRz4c77/GKou0Sp1zE4Ye3PpvZkzLBvkgyM tZAQ== X-Gm-Message-State: AJIora9ya+UGlj49IZkbaEKONPWRpcneoiEq7l34fgoIcCJEhSgX8FM3 00HJ00uiMNiU8N2MaRoyzVXfXpMH0nZtggpwvaI= X-Google-Smtp-Source: AGRyM1uIJwu2wwWEFnO+FEjYFYfETFNR2ZoobHBdUAyYura4zg17aDf2AQ9x6JKt/5W/orutjJnkN5FeTb80kACg0n4= X-Received: by 2002:a9d:6291:0:b0:616:d7b2:5832 with SMTP id x17-20020a9d6291000000b00616d7b25832mr11075296otk.103.1656908938671; Sun, 03 Jul 2022 21:28:58 -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: Noah Goldstein Date: Sun, 3 Jul 2022 21:28:48 -0700 Message-ID: Subject: Re: [PATCH v6 1/2] x86: Add comment explaining no Slow_SSE4_2 check in ifunc-sse4_2 To: "H.J. Lu" Cc: GNU C Library , "Carlos O'Donell" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.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, 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:29:00 -0000 On Sun, Jul 3, 2022 at 11:01 AM H.J. Lu wrote: > > 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. > Think made the comment reflect that in V7. > > 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. > Made clearer in V7. > > > > > > > > > > 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.