The configure script detects if the compiler has AVX2 support and
automatically sets avx2_opt="yes" which in turn defines CONFIG_AVX2_OPT.
There is no way of explicitly overriding this setting so this commit adds
two command-line options: --enable-avx2 and --disable-avx2.
The default behaviour, when no option is specified, is to maintain the
current behaviour and enable AVX2 if the compiler supports it.
Signed-off-by: Liam Merwick <Liam.Merwick@oracle.com>
Reviewed-by: Darren Kenny <Darren.Kenny@oracle.com>
Reviewed-by: Mark Kanda <Mark.Kanda@oracle.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
opengl=""
opengl_dmabuf="no"
cpuid_h="no"
opengl=""
opengl_dmabuf="no"
cpuid_h="no"
zlib="yes"
capstone=""
lzo=""
zlib="yes"
capstone=""
lzo=""
;;
--disable-glusterfs) glusterfs="no"
;;
;;
--disable-glusterfs) glusterfs="no"
;;
+ --disable-avx2) avx2_opt="no"
+ ;;
+ --enable-avx2) avx2_opt="yes"
+ ;;
--enable-glusterfs) glusterfs="yes"
;;
--disable-virtio-blk-data-plane|--enable-virtio-blk-data-plane)
--enable-glusterfs) glusterfs="yes"
;;
--disable-virtio-blk-data-plane|--enable-virtio-blk-data-plane)
libxml2 for Parallels image format
tcmalloc tcmalloc support
jemalloc jemalloc support
libxml2 for Parallels image format
tcmalloc tcmalloc support
jemalloc jemalloc support
+ avx2 AVX2 optimization support
replication replication support
vhost-vsock virtio sockets device support
opengl opengl support
replication replication support
vhost-vsock virtio sockets device support
opengl opengl support
# There is no point enabling this if cpuid.h is not usable,
# since we won't be able to select the new routines.
# There is no point enabling this if cpuid.h is not usable,
# since we won't be able to select the new routines.
-if test $cpuid_h = yes; then
+if test "$cpuid_h" = "yes" -a "$avx2_opt" != "no"; then
cat > $TMPC << EOF
#pragma GCC push_options
#pragma GCC target("avx2")
cat > $TMPC << EOF
#pragma GCC push_options
#pragma GCC target("avx2")
EOF
if compile_object "" ; then
avx2_opt="yes"
EOF
if compile_object "" ; then
avx2_opt="yes"