blob: 5cb1e60398dad84ecb59f2c9cda31ab80d010bb6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
From 393f7856587d58292febb0a3e82edc405aab4498 Mon Sep 17 00:00:00 2001
From: Tom Finegan <tomfinegan@google.com>
Date: Thu, 7 Jun 2018 12:35:05 -0700
Subject: [PATCH] Add avx512 compile test.
Some compiler releases allow the -mavx512f arg without actually
implementing support. Test for this situation, and disable avx512
when it is detected by configure.
BUG=webm:1536
Change-Id: I63952153bb4b24aa9f25267ed47a0fe845d61f8b
---
build/make/configure.sh | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/build/make/configure.sh b/build/make/configure.sh
index 480b2d0eab..e0e9fd1a73 100644
--- a/build/make/configure.sh
+++ b/build/make/configure.sh
@@ -1333,6 +1333,15 @@ EOF
else
if [ "$ext" = "avx512" ]; then
check_gcc_machine_options $ext avx512f avx512cd avx512bw avx512dq avx512vl
+
+ # Confirm that the compiler really supports avx512.
+ check_cc -mavx512f <<EOF || RTCD_OPTIONS="${RTCD_OPTIONS}--disable-avx512 " && soft_disable avx512
+#include <immintrin.h>
+void f(void) {
+ __m512i x = _mm512_set1_epi16(0);
+ (void)x;
+}
+EOF
else
# use the shortened version for the flag: sse4_1 -> sse4
check_gcc_machine_option ${ext%_*} $ext
|