summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonasZhou <JonasZhou@zhaoxin.com>2020-09-16 14:08:21 +0800
committerJonasZhou <JonasZhou@zhaoxin.com>2020-09-23 16:07:10 +0800
commit82d02f2928f2c7e6a829724a70c1b77721eae5b7 (patch)
tree6dde8e254a9f3b930cbfa71689d18c567ad69d69
parent7202e921db9da6faddcab8d2ac872508ee2281be (diff)
downloadgnutls-82d02f2928f2c7e6a829724a70c1b77721eae5b7.tar.gz
x86: fix avx detection
In the case of setting environment variables, AVX cannot be detected correctly. Because only MOVBE is added to variable _gnutls_x86_cpuid_s, there is no OSXSAVE. And according to the intel manual, using AVX does not need to detect FMA. Signed-off-by: JonasZhou <JonasZhou@zhaoxin.com>
-rw-r--r--lib/accelerated/x86/x86-common.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/accelerated/x86/x86-common.c b/lib/accelerated/x86/x86-common.c
index 29410e51fd..7688b0c778 100644
--- a/lib/accelerated/x86/x86-common.c
+++ b/lib/accelerated/x86/x86-common.c
@@ -82,8 +82,8 @@ unsigned int _gnutls_x86_cpuid_s[4];
#endif
#ifndef OSXSAVE_MASK
-/* OSXSAVE|FMA|MOVBE */
-# define OSXSAVE_MASK (0x8000000|0x1000|0x400000)
+/* OSXSAVE|MOVBE */
+# define OSXSAVE_MASK (0x8000000|0x400000)
#endif
#ifndef bit_MOVBE
@@ -188,7 +188,7 @@ static void capabilities_to_intel_cpuid(unsigned capabilities)
if (capabilities & INTEL_AVX) {
if ((a[1] & bit_AVX) && check_4th_gen_intel_features(a[1])) {
- _gnutls_x86_cpuid_s[1] |= bit_AVX|bit_MOVBE;
+ _gnutls_x86_cpuid_s[1] |= bit_AVX|OSXSAVE_MASK;
} else {
_gnutls_debug_log
("AVX acceleration requested but not available\n");