From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com [IPv6:2607:f8b0:4864:20::b33]) by sourceware.org (Postfix) with ESMTPS id DE8F33858C51 for ; Fri, 1 Jul 2022 22:52:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DE8F33858C51 Received: by mail-yb1-xb33.google.com with SMTP id o19so6455005ybg.2 for ; Fri, 01 Jul 2022 15:52:58 -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=QPuf0bQc5ckWkgnT7g7BdVx7dDDAVwXRjq5vADYutvU=; b=IRpMCsG904hdC8+hGpA19+gcQKXwkFRGoxMCNmCwZHOP0ND5n5Lb1EXJUR0HxG1frb BIJGR/IufTcVAGdFSp4RVDIK3cZZ7ZDjeBuOAXdphSARphafAYpe0KWXR4QBFnoUKdxd qqI+7Ns08wAvZoLyBAsj57NNPR5U5JfC2vQ7GcPcGq3Lj0msugpbvKPUULBB3HAktYdr YgVHQoc5zy3NtsIHrhyUtN+QmwSynULVsuWB7NHN2/eABnwGLqZ1vCo88/GgZPe+KMjF L7sHwMJVkz5xpuhR1My6lBZkMi8SFrF9/9AFTaSNTPml+jGGdEL+xdeam4VSP4kVgxUm Z9mA== X-Gm-Message-State: AJIora+yK90dOHALokVBTrW0HX4Sfv/WbymU/0BQem9cEvEFTTfNukjW XjsyWg1qPN5at/5WX0H1xz5LZl7CR1W266O3ZXU= X-Google-Smtp-Source: AGRyM1t7kzsuDbZWXDXbodZNZveBjZBdaqbOES73wVO7ilry9oCbnSHWDeNvORRH4YEiQO0x7ubkCyf4cl9ikXrrvEM= X-Received: by 2002:a25:b9c3:0:b0:668:a418:13c with SMTP id y3-20020a25b9c3000000b00668a418013cmr18093518ybj.498.1656715978340; Fri, 01 Jul 2022 15:52: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: Fri, 1 Jul 2022 15:52:47 -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=-8.3 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: Fri, 01 Jul 2022 22:53:00 -0000 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... 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. > > > > > > 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.