s390.c: (s390_expand_builtin): Allow -mhtm to be enabled without -march=zEC12.
[gcc.git] / libitm / acinclude.m4
index eacf8d4538310c70e3291b948c72619eb7026039..ca7e0a92118029e69e8746d0852e7f91312556a4 100644 (file)
@@ -135,6 +135,17 @@ powerpc*)
     AC_DEFINE(HAVE_AS_HTM, 1, [Define to 1 if the assembler supports HTM.])
   fi
   ;;
+s390*)
+  AC_CACHE_CHECK([if the assembler supports HTM], libitm_cv_as_htm, [
+    save_CFLAGS="$CFLAGS"
+    CFLAGS="$CFLAGS -march=zEC12"
+    AC_TRY_COMPILE([], [asm("tbegin 0,0; tend");],
+                  [libitm_cv_as_htm=yes], [libitm_cv_as_htm=no])
+    CFLAGS="$save_CFLAGS"])
+  if test x$libitm_cv_as_htm = xyes; then
+    AC_DEFINE(HAVE_AS_HTM, 1, [Define to 1 if the assembler supports HTM.])
+  fi
+  ;;
 esac])
 
 sinclude(../libtool.m4)