about summary refs log tree commit diff
path: root/sysdeps/x86_64/fpu
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-08-18 06:18:55 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-08-18 06:19:07 -0700
commit098b9dd46814f7e624e42a8844c169f3edc67052 (patch)
tree04f0e8e4adc639c0788d8f9ae12e22e1ff9800f7 /sysdeps/x86_64/fpu
parent486afa6d27156665959e59b86e7aad18c3832cbe (diff)
downloadglibc-098b9dd46814f7e624e42a8844c169f3edc67052.tar.gz
glibc-098b9dd46814f7e624e42a8844c169f3edc67052.tar.xz
glibc-098b9dd46814f7e624e42a8844c169f3edc67052.zip
x86-64: Check FMA_Usable in ifunc-mathvec-avx2.h [BZ #21966]
Since the AVX2 version of mathvec functions uses FMA, it can only be
used when FMA is usable.

	[BZ #21966]
	* sysdeps/x86_64/fpu/multiarch/ifunc-mathvec-avx2.h
	(IFUNC_SELECTOR): Don't use the AVX2 version if FMA isn't
	usable.
Diffstat (limited to 'sysdeps/x86_64/fpu')
-rw-r--r--sysdeps/x86_64/fpu/multiarch/ifunc-mathvec-avx2.h3
1 files changed, 2 insertions, 1 deletions
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);