Detect assembler support for RTM
authorRichard Henderson <rth@redhat.com>
Wed, 31 Oct 2012 04:46:20 +0000 (21:46 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Wed, 31 Oct 2012 04:46:20 +0000 (21:46 -0700)
* acinclude.m4 (LIBITM_CHECK_AS_RTM): New.
* configure.ac: Use it.
* config.h.in, configure: Rebuild.
* testsuite/Makefile.in: Rebuild.

From-SVN: r193017

libitm/ChangeLog
libitm/acinclude.m4
libitm/config.h.in
libitm/configure
libitm/configure.ac
libitm/testsuite/Makefile.in

index 8f55f4e..d98ce07 100644 (file)
@@ -1,3 +1,10 @@
+2012-10-31  Richard Henderson  <rth@redhat.com>
+
+       * acinclude.m4 (LIBITM_CHECK_AS_RTM): New.
+       * configure.ac: Use it.
+       * config.h.in, configure: Rebuild.
+       * testsuite/Makefile.in: Rebuild.
+
 2012-10-24  Torvald Riegel  <triegel@redhat.com>
 
        * libitm.texi: Clarify ABI requirements for data-logging functions.
index 1031f1f..fe32fe3 100644 (file)
@@ -109,6 +109,20 @@ i[[34567]]86 | x86_64)
   ;;
 esac])
 
+dnl Check if as supports RTM instructions.
+AC_DEFUN([LIBITM_CHECK_AS_RTM], [
+case "${target_cpu}" in
+i[[34567]]86 | x86_64)
+  AC_CACHE_CHECK([if the assembler supports RTM], libitm_cv_as_rtm, [
+    AC_TRY_COMPILE([], [asm("1: xbegin 1b; xend");],
+                  [libitm_cv_as_rtm=yes], [libitm_cv_as_rtm=no])
+  ])
+  if test x$libitm_cv_as_rtm = xyes; then
+    AC_DEFINE(HAVE_AS_RTM, 1, [Define to 1 if the assembler supports RTM.])
+  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
index 1c3469c..10de95b 100644 (file)
@@ -12,6 +12,9 @@
 /* Define if your assembler supports .cfi_* directives. */
 #undef HAVE_AS_CFI_PSEUDO_OP
 
+/* Define to 1 if the assembler supports RTM. */
+#undef HAVE_AS_RTM
+
 /* Define to 1 if the target supports __attribute__((alias(...))). */
 #undef HAVE_ATTRIBUTE_ALIAS
 
index 4b547ab..d985cf7 100644 (file)
@@ -667,6 +667,7 @@ CXX
 am__fastdepCC_FALSE
 am__fastdepCC_TRUE
 CCDEPMODE
+am__nodep
 AMDEPBACKSLASH
 AMDEP_FALSE
 AMDEP_TRUE
@@ -3318,11 +3319,11 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
 # We need awk for the "check" target.  The system "awk" is bad on
 # some platforms.
-# Always define AMTAR for backward compatibility.
+# Always define AMTAR for backward compatibility.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
 
-AMTAR=${AMTAR-"${am_missing_run}tar"}
-
-am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
 
 
 
@@ -4220,6 +4221,7 @@ fi
 if test "x$enable_dependency_tracking" != xno; then
   am_depcomp="$ac_aux_dir/depcomp"
   AMDEPBACKSLASH='\'
+  am__nodep='_no'
 fi
  if test "x$enable_dependency_tracking" != xno; then
   AMDEP_TRUE=
@@ -4244,6 +4246,7 @@ else
   # instance it was reported that on HP-UX the gcc test will end up
   # making a dummy file named `D' -- because `-MD' means `put the output
   # in D'.
+  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
@@ -4303,7 +4306,7 @@ else
        break
       fi
       ;;
-    msvisualcpp | msvcmsys)
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
       # This compiler won't grok `-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
@@ -4628,6 +4631,7 @@ else
   # instance it was reported that on HP-UX the gcc test will end up
   # making a dummy file named `D' -- because `-MD' means `put the output
   # in D'.
+  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
@@ -4687,7 +4691,7 @@ else
        break
       fi
       ;;
-    msvisualcpp | msvcmsys)
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
       # This compiler won't grok `-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
@@ -4762,6 +4766,7 @@ else
   # instance it was reported that on HP-UX the gcc test will end up
   # making a dummy file named `D' -- because `-MD' means `put the output
   # in D'.
+  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
@@ -4819,7 +4824,7 @@ else
        break
       fi
       ;;
-    msvisualcpp | msvcmsys)
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
       # This compiler won't grok `-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
@@ -11779,7 +11784,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11782 "configure"
+#line 11787 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11885,7 +11890,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11888 "configure"
+#line 11893 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -17327,6 +17332,43 @@ $as_echo "#define HAVE_AS_AVX 1" >>confdefs.h
   ;;
 esac
 
+case "${target_cpu}" in
+i[34567]86 | x86_64)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the assembler supports RTM" >&5
+$as_echo_n "checking if the assembler supports RTM... " >&6; }
+if test "${libitm_cv_as_rtm+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+asm("1: xbegin 1b; xend");
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  libitm_cv_as_rtm=yes
+else
+  libitm_cv_as_rtm=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libitm_cv_as_rtm" >&5
+$as_echo "$libitm_cv_as_rtm" >&6; }
+  if test x$libitm_cv_as_rtm = xyes; then
+
+$as_echo "#define HAVE_AS_RTM 1" >>confdefs.h
+
+  fi
+  ;;
+esac
+
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether weak refs work like ELF" >&5
 $as_echo_n "checking whether weak refs work like ELF... " >&6; }
index 198ca32..8544686 100644 (file)
@@ -244,6 +244,7 @@ CFLAGS="$save_CFLAGS $XCFLAGS"
 LIBITM_CHECK_SYNC_BUILTINS
 LIBITM_CHECK_64BIT_SYNC_BUILTINS
 LIBITM_CHECK_AS_AVX
+LIBITM_CHECK_AS_RTM
 
 GCC_CHECK_ELF_STYLE_WEAKREF
 
index 094e44d..a6db6aa 100644 (file)
@@ -35,7 +35,7 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 subdir = testsuite
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
        $(top_srcdir)/../config/asmcfi.m4 \
@@ -60,10 +60,8 @@ CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
 SOURCES =
-DIST_SOURCES =
 DEJATOOL = $(PACKAGE)
 RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AR = @AR@
@@ -295,37 +293,6 @@ distclean-DEJAGNU:
        -l='$(DEJATOOL)'; for tool in $$l; do \
          rm -f $$tool.sum $$tool.log; \
        done
-
-distdir: $(DISTFILES)
-       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-       list='$(DISTFILES)'; \
-         dist_files=`for file in $$list; do echo $$file; done | \
-         sed -e "s|^$$srcdirstrip/||;t" \
-             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-       case $$dist_files in \
-         */*) $(MKDIR_P) `echo "$$dist_files" | \
-                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-                          sort -u` ;; \
-       esac; \
-       for file in $$dist_files; do \
-         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-         if test -d $$d/$$file; then \
-           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-           if test -d "$(distdir)/$$file"; then \
-             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-           fi; \
-           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-           fi; \
-           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-         else \
-           test -f "$(distdir)/$$file" \
-           || cp -p $$d/$$file "$(distdir)/$$file" \
-           || exit 1; \
-         fi; \
-       done
 check-am: all-am
        $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU
 check: check-am
@@ -426,8 +393,8 @@ uninstall-am:
 
 .PHONY: all all-am check check-DEJAGNU check-am clean clean-generic \
        clean-libtool distclean distclean-DEJAGNU distclean-generic \
-       distclean-libtool distdir dvi dvi-am html html-am info info-am \
-       install install-am install-data install-data-am install-dvi \
+       distclean-libtool dvi dvi-am html html-am info info-am install \
+       install-am install-data install-data-am install-dvi \
        install-dvi-am install-exec install-exec-am install-html \
        install-html-am install-info install-info-am install-man \
        install-pdf install-pdf-am install-ps install-ps-am \