From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24564 invoked by alias); 17 Aug 2017 23:01:16 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 24092 invoked by uid 89); 17 Aug 2017 23:00:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,NO_DNS_FOR_FROM,RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mga02.intel.com X-ExtLoop1: 1 Date: Thu, 17 Aug 2017 23:01:00 -0000 From: "H.J. Lu" To: GNU C Library Cc: Andrew Senkevich Subject: [PATCH] x86-64: Check FMA_Usable in ifunc-mathvec-avx2.h [BZ #21966] Message-ID: <20170817230044.GA22607@gmail.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.8.3 (2017-05-23) X-SW-Source: 2017-08/txt/msg00835.txt.bz2 Since the AVX2 version of mathvec functions uses FMA, it can only be used when FMA is usable. Any comments? Andrew, please take a look and check if it should be fixed on branches. Thanks. H.J. [BZ #21966] * sysdeps/x86_64/fpu/multiarch/ifunc-mathvec-avx2.h (IFUNC_SELECTOR): Don't use the AVX2 version if FMA isn't usable. --- sysdeps/x86_64/fpu/multiarch/ifunc-mathvec-avx2.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sysdeps/x86_64/fpu/multiarch/ifunc-mathvec-avx2.h b/sysdeps/x86_64/fpu/multiarch/ifunc-mathvec-avx2.h index a43d4c54fa..ccda2748c5 100644 --- a/sysdeps/x86_64/fpu/multiarch/ifunc-mathvec-avx2.h +++ b/sysdeps/x86_64/fpu/multiarch/ifunc-mathvec-avx2.h @@ -31,7 +31,8 @@ IFUNC_SELECTOR (void) { const struct cpu_features* cpu_features = __get_cpu_features (); - if (CPU_FEATURES_ARCH_P (cpu_features, AVX2_Usable)) + if (CPU_FEATURES_ARCH_P (cpu_features, FMA_Usable) + && CPU_FEATURES_ARCH_P (cpu_features, AVX2_Usable)) return OPTIMIZE (avx2); return OPTIMIZE (sse_wrapper); -- 2.13.5