summaryrefslogtreecommitdiff
path: root/libitm/acinclude.m4
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2011-11-09 16:29:38 -0800
committerRichard Henderson <rth@gcc.gnu.org>2011-11-09 16:29:38 -0800
commit430616e7a7a321e216aeaeccc3da35aa23c0080f (patch)
treec7c77fdbc7b50f224cc4d0500b462b578274d47f /libitm/acinclude.m4
parent41582ffe43fa994c13d0e5225f96a02cb0995c99 (diff)
downloadgcc-430616e7a7a321e216aeaeccc3da35aa23c0080f.tar.gz
libitm: Work around assembler missing AVX insns.
From-SVN: r181246
Diffstat (limited to 'libitm/acinclude.m4')
-rw-r--r--libitm/acinclude.m414
1 files changed, 14 insertions, 0 deletions
diff --git a/libitm/acinclude.m4 b/libitm/acinclude.m4
index 8fcde4b57ad..58fbf424c60 100644
--- a/libitm/acinclude.m4
+++ b/libitm/acinclude.m4
@@ -95,6 +95,20 @@ AC_DEFUN([LIBITM_CHECK_SIZE_T_MANGLING], [
[Define to the letter to which size_t is mangled.])
])
+dnl Check if as supports AVX instructions.
+AC_DEFUN([LIBITM_CHECK_AS_AVX], [
+case "${target_cpu}" in
+i[3456]86 | x86_64)
+ AC_CACHE_CHECK([if the assembler supports AVX], libitm_cv_as_avx, [
+ AC_TRY_COMPILE([], [asm("vzeroupper");],
+ [libitm_cv_as_avx=yes], [libitm_cv_as_avx=no])
+ ])
+ if test x$libitm_cv_as_avx = xyes; then
+ AC_DEFINE(HAVE_AS_AVX, 1, [Define to 1 if the assembler supports AVX.])
+ fi
+ ;;
+esac])
+
sinclude(../libtool.m4)
dnl The lines below arrange for aclocal not to bring an installed
dnl libtool.m4 into aclocal.m4, while still arranging for automake to