[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2] Update the avx2 configure test to be compatible
From: |
Rebecca Cran |
Subject: |
[Qemu-devel] [PATCH v2] Update the avx2 configure test to be compatible with clang |
Date: |
Thu, 8 Aug 2019 22:29:09 -0600 |
clang doesn't support the GCC pragma to enable AVX2, but instead
requires the command line option -mavx2. Since GCC also supports that,
remove the pragma lines and add the -mavx2 option when building the
test. If AVX2 is supported, update QEMU_CFLAGS to include -mavx2 .
Signed-off-by: Rebecca Cran <address@hidden>
---
configure | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/configure b/configure
index 714e7fb6a1..227fce6561 100755
--- a/configure
+++ b/configure
@@ -5392,8 +5392,6 @@ fi
if test "$cpuid_h" = "yes" && test "$avx2_opt" != "no"; then
cat > $TMPC << EOF
-#pragma GCC push_options
-#pragma GCC target("avx2")
#include <cpuid.h>
#include <immintrin.h>
static int bar(void *a) {
@@ -5402,7 +5400,8 @@ static int bar(void *a) {
}
int main(int argc, char *argv[]) { return bar(argv[0]); }
EOF
- if compile_object "" ; then
+ if compile_object "-mavx2" ; then
+ QEMU_CFLAGS="-mavx2 $QEMU_CFLAGS"
avx2_opt="yes"
else
avx2_opt="no"
--
2.22.0
- [Qemu-devel] [PATCH v2] Update the avx2 configure test to be compatible with clang,
Rebecca Cran <=