summaryrefslogtreecommitdiff
path: root/libitm
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2016-01-13 17:03:42 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2016-01-13 17:03:42 +0000
commite5fee0fe3dd66acf83f093f69a3992a4b653fdf4 (patch)
treef728a754bf3a0dcace0dede256cd49817a1cc56e /libitm
parent3f0e9745bed1f9bcb4973163ff2ebe1e364a5962 (diff)
downloadgcc-e5fee0fe3dd66acf83f093f69a3992a4b653fdf4.tar.gz
PR 68964
gcc/ PR tree-opt/68964 * target.def (builtin_tm_load, builtin_tm_store): Remove. * config/i386/i386.c (ix86_builtin_tm_load): Remove. (ix86_builtin_tm_store): Remove. (TARGET_VECTORIZE_BUILTIN_TM_LOAD): Remove. (TARGET_VECTORIZE_BUILTIN_TM_STORE): Remove. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_TM_LOAD): Remove. (TARGET_VECTORIZE_BUILTIN_TM_STORE): Remove. * doc/tm.texi: Rebuild. * gtm-builtins.def (BUILT_IN_TM_MEMCPY_RNWT): New. (BUILT_IN_TM_MEMCPY_RTWN): New. * trans-mem.c (tm_log_emit_stmt): Rearrange code for better fallback from vector to integer helpers. (build_tm_load): Handle vector types directly, instead of via target hook. (build_tm_store): Likewise. (expand_assign_tm): Prepare for register types not handled by the above. Copy them to memory and use memcpy. * tree.c (tm_define_builtin): New. (find_tm_vector_type): New. (build_tm_vector_builtins): New. (build_common_builtin_nodes): Call it. libitm/ * Makefile.am (libitm_la_SOURCES) [ARCH_AARCH64]: Add vect128.cc (libitm_la_SOURCES) [ARCH_ARM]: Add neon.cc (libitm_la_SOURCES) [ARCH_PPC]: Add vect128.cc (libitm_la_SOURCES) [ARCH_S390]: Add vect128.cc * configure.ac (ARCH_AARCH64): New conditional. (ARCH_PPC, ARCH_S390): Likewise. * Makefile.in, configure: Rebuild. * libitm.h (_ITM_TYPE_M128): Always define. * vect64.cc: Split ... * vect128.cc: ... out of... * config/x86/x86_sse.cc: ... here. * config/arm/neon.cc: New file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232330 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libitm')
-rw-r--r--libitm/ChangeLog16
-rw-r--r--libitm/Makefile.am20
-rw-r--r--libitm/Makefile.in35
-rw-r--r--libitm/config/arm/neon.cc3
-rw-r--r--libitm/configure50
-rw-r--r--libitm/configure.ac3
-rw-r--r--libitm/libitm.h6
-rw-r--r--libitm/vect128.cc (renamed from libitm/config/x86/x86_sse.cc)7
-rw-r--r--libitm/vect64.cc36
9 files changed, 147 insertions, 29 deletions
diff --git a/libitm/ChangeLog b/libitm/ChangeLog
index 03624d4a4ed..7f7225a9b55 100644
--- a/libitm/ChangeLog
+++ b/libitm/ChangeLog
@@ -1,3 +1,19 @@
+2016-01-13 Richard Henderson <rth@redhat.com>
+
+ * Makefile.am (libitm_la_SOURCES) [ARCH_AARCH64]: Add vect128.cc
+ (libitm_la_SOURCES) [ARCH_ARM]: Add neon.cc
+ (libitm_la_SOURCES) [ARCH_PPC]: Add vect128.cc
+ (libitm_la_SOURCES) [ARCH_S390]: Add vect128.cc
+ * configure.ac (ARCH_AARCH64): New conditional.
+ (ARCH_PPC, ARCH_S390): Likewise.
+ * Makefile.in, configure: Rebuild.
+
+ * libitm.h (_ITM_TYPE_M128): Always define.
+ * vect64.cc: Split ...
+ * vect128.cc: ... out of...
+ * config/x86/x86_sse.cc: ... here.
+ * config/arm/neon.cc: New file.
+
2016-01-13 Torvald Riegel <triegel@redhat.com>
* beginend.cc (gtm_thread::trycommit): Fix privatization safety.
diff --git a/libitm/Makefile.am b/libitm/Makefile.am
index 1dce82d62f1..6e1438d6191 100644
--- a/libitm/Makefile.am
+++ b/libitm/Makefile.am
@@ -62,16 +62,26 @@ libitm_la_SOURCES = \
query.cc retry.cc rwlock.cc useraction.cc util.cc \
sjlj.S tls.cc method-serial.cc method-gl.cc method-ml.cc
+if ARCH_AARCH64
+libitm_la_SOURCES += vect128.cc
+endif
if ARCH_ARM
-libitm_la_SOURCES += hwcap.cc
+libitm_la_SOURCES += hwcap.cc neon.cc
+endif
+if ARCH_PPC
+libitm_la_SOURCES += vect128.cc
+vect128.lo : override CXXFLAGS += -maltivec
+endif
+if ARCH_S390
+libitm_la_SOURCES += vect128.cc
+vect128.lo : override CXXFLAGS += -march=z13
endif
if ARCH_X86
-libitm_la_SOURCES += x86_sse.cc x86_avx.cc
-# Make sure -msse is appended at the end.
-x86_sse.lo : override CXXFLAGS += -msse
+libitm_la_SOURCES += vect64.cc vect128.cc x86_avx.cc
+vect64.lo : override CXXFLAGS += -msse
+vect128.lo : override CXXFLAGS += -msse
endif
if ARCH_X86_AVX
-# Make sure -mavx is appended at the end.
x86_avx.lo : override CXXFLAGS += -mavx
endif
diff --git a/libitm/Makefile.in b/libitm/Makefile.in
index 138eeb1c9da..f2cbb5cb720 100644
--- a/libitm/Makefile.in
+++ b/libitm/Makefile.in
@@ -53,9 +53,12 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
-@ARCH_ARM_TRUE@am__append_1 = hwcap.cc
-@ARCH_X86_TRUE@am__append_2 = x86_sse.cc x86_avx.cc
-@ARCH_FUTEX_TRUE@am__append_3 = futex.cc
+@ARCH_AARCH64_TRUE@am__append_1 = vect128.cc
+@ARCH_ARM_TRUE@am__append_2 = hwcap.cc neon.cc
+@ARCH_PPC_TRUE@am__append_3 = vect128.cc
+@ARCH_S390_TRUE@am__append_4 = vect128.cc
+@ARCH_X86_TRUE@am__append_5 = vect64.cc vect128.cc x86_avx.cc
+@ARCH_FUTEX_TRUE@am__append_6 = futex.cc
subdir = .
DIST_COMMON = ChangeLog $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/configure $(am__configure_deps) \
@@ -117,14 +120,18 @@ am__installdirs = "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(infodir)" \
"$(DESTDIR)$(toolexeclibdir)"
LTLIBRARIES = $(toolexeclib_LTLIBRARIES)
libitm_la_LIBADD =
-@ARCH_ARM_TRUE@am__objects_1 = hwcap.lo
-@ARCH_X86_TRUE@am__objects_2 = x86_sse.lo x86_avx.lo
-@ARCH_FUTEX_TRUE@am__objects_3 = futex.lo
+@ARCH_AARCH64_TRUE@am__objects_1 = vect128.lo
+@ARCH_ARM_TRUE@am__objects_2 = hwcap.lo neon.lo
+@ARCH_PPC_TRUE@am__objects_3 = vect128.lo
+@ARCH_S390_TRUE@am__objects_4 = vect128.lo
+@ARCH_X86_TRUE@am__objects_5 = vect64.lo vect128.lo x86_avx.lo
+@ARCH_FUTEX_TRUE@am__objects_6 = futex.lo
am_libitm_la_OBJECTS = aatree.lo alloc.lo alloc_c.lo alloc_cpp.lo \
barrier.lo beginend.lo clone.lo eh_cpp.lo local.lo query.lo \
retry.lo rwlock.lo useraction.lo util.lo sjlj.lo tls.lo \
method-serial.lo method-gl.lo method-ml.lo $(am__objects_1) \
- $(am__objects_2) $(am__objects_3)
+ $(am__objects_2) $(am__objects_3) $(am__objects_4) \
+ $(am__objects_5) $(am__objects_6)
libitm_la_OBJECTS = $(am_libitm_la_OBJECTS)
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/../depcomp
@@ -362,7 +369,8 @@ libitm_la_SOURCES = aatree.cc alloc.cc alloc_c.cc alloc_cpp.cc \
barrier.cc beginend.cc clone.cc eh_cpp.cc local.cc query.cc \
retry.cc rwlock.cc useraction.cc util.cc sjlj.S tls.cc \
method-serial.cc method-gl.cc method-ml.cc $(am__append_1) \
- $(am__append_2) $(am__append_3)
+ $(am__append_2) $(am__append_3) $(am__append_4) \
+ $(am__append_5) $(am__append_6)
# Automake Documentation:
# If your package has Texinfo files in many directories, you can use the
@@ -495,6 +503,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/method-gl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/method-ml.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/method-serial.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/neon.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/query.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/retry.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rwlock.Plo@am__quote@
@@ -502,8 +511,9 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tls.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/useraction.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vect128.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vect64.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x86_avx.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x86_sse.Plo@am__quote@
.S.o:
@am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -1096,9 +1106,10 @@ vpath % $(strip $(search_path))
@LIBITM_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBITM_BUILD_VERSIONED_SHLIB_TRUE@ `echo $(libitm_la_LIBADD) | \
@LIBITM_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBITM_BUILD_VERSIONED_SHLIB_TRUE@ sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
@LIBITM_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBITM_BUILD_VERSIONED_SHLIB_TRUE@ > $@ || (rm -f $@ ; exit 1)
-# Make sure -msse is appended at the end.
-@ARCH_X86_TRUE@x86_sse.lo : override CXXFLAGS += -msse
-# Make sure -mavx is appended at the end.
+@ARCH_PPC_TRUE@vect128.lo : override CXXFLAGS += -maltivec
+@ARCH_S390_TRUE@vect128.lo : override CXXFLAGS += -march=z13
+@ARCH_X86_TRUE@vect64.lo : override CXXFLAGS += -msse
+@ARCH_X86_TRUE@vect128.lo : override CXXFLAGS += -msse
@ARCH_X86_AVX_TRUE@x86_avx.lo : override CXXFLAGS += -mavx
all-local: $(STAMP_GENINSRC)
diff --git a/libitm/config/arm/neon.cc b/libitm/config/arm/neon.cc
new file mode 100644
index 00000000000..a9c3074405e
--- /dev/null
+++ b/libitm/config/arm/neon.cc
@@ -0,0 +1,3 @@
+#ifdef __ARM_NEON
+#include <vect128.cc>
+#endif
diff --git a/libitm/configure b/libitm/configure
index 55332bb9de8..637fcd19669 100644
--- a/libitm/configure
+++ b/libitm/configure
@@ -607,8 +607,14 @@ ARCH_X86_AVX_FALSE
ARCH_X86_AVX_TRUE
ARCH_X86_FALSE
ARCH_X86_TRUE
+ARCH_S390_FALSE
+ARCH_S390_TRUE
+ARCH_PPC_FALSE
+ARCH_PPC_TRUE
ARCH_ARM_FALSE
ARCH_ARM_TRUE
+ARCH_AARCH64_FALSE
+ARCH_AARCH64_TRUE
link_itm
XLDFLAGS
XCFLAGS
@@ -9762,7 +9768,7 @@ _LT_EOF
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
else
- export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
fi
aix_use_runtimelinking=no
@@ -11790,7 +11796,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11793 "configure"
+#line 11799 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11896,7 +11902,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11899 "configure"
+#line 11905 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -14248,7 +14254,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
else
- export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
fi
;;
pw32*)
@@ -17603,6 +17609,14 @@ else
fi
+ if test "$ARCH" = aarch64; then
+ ARCH_AARCH64_TRUE=
+ ARCH_AARCH64_FALSE='#'
+else
+ ARCH_AARCH64_TRUE='#'
+ ARCH_AARCH64_FALSE=
+fi
+
if test "$ARCH" = arm; then
ARCH_ARM_TRUE=
ARCH_ARM_FALSE='#'
@@ -17611,6 +17625,22 @@ else
ARCH_ARM_FALSE=
fi
+ if test "$ARCH" = powerpc -o "$ARCH" = powerpc64; then
+ ARCH_PPC_TRUE=
+ ARCH_PPC_FALSE='#'
+else
+ ARCH_PPC_TRUE='#'
+ ARCH_PPC_FALSE=
+fi
+
+ if test "$ARCH" = s390 -o "$ARCH" = s390x; then
+ ARCH_S390_TRUE=
+ ARCH_S390_FALSE='#'
+else
+ ARCH_S390_TRUE='#'
+ ARCH_S390_FALSE=
+fi
+
if test "$ARCH" = x86; then
ARCH_X86_TRUE=
ARCH_X86_FALSE='#'
@@ -17788,10 +17818,22 @@ if test -z "${LIBITM_BUILD_VERSIONED_SHLIB_SUN_TRUE}" && test -z "${LIBITM_BUILD
as_fn_error "conditional \"LIBITM_BUILD_VERSIONED_SHLIB_SUN\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${ARCH_AARCH64_TRUE}" && test -z "${ARCH_AARCH64_FALSE}"; then
+ as_fn_error "conditional \"ARCH_AARCH64\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${ARCH_ARM_TRUE}" && test -z "${ARCH_ARM_FALSE}"; then
as_fn_error "conditional \"ARCH_ARM\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${ARCH_PPC_TRUE}" && test -z "${ARCH_PPC_FALSE}"; then
+ as_fn_error "conditional \"ARCH_PPC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${ARCH_S390_TRUE}" && test -z "${ARCH_S390_FALSE}"; then
+ as_fn_error "conditional \"ARCH_S390\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${ARCH_X86_TRUE}" && test -z "${ARCH_X86_FALSE}"; then
as_fn_error "conditional \"ARCH_X86\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/libitm/configure.ac b/libitm/configure.ac
index 3875aa0b47d..36e065140d8 100644
--- a/libitm/configure.ac
+++ b/libitm/configure.ac
@@ -281,7 +281,10 @@ else
fi
AC_SUBST(link_itm)
+AM_CONDITIONAL([ARCH_AARCH64], [test "$ARCH" = aarch64])
AM_CONDITIONAL([ARCH_ARM], [test "$ARCH" = arm])
+AM_CONDITIONAL([ARCH_PPC], [test "$ARCH" = powerpc -o "$ARCH" = powerpc64])
+AM_CONDITIONAL([ARCH_S390], [test "$ARCH" = s390 -o "$ARCH" = s390x])
AM_CONDITIONAL([ARCH_X86], [test "$ARCH" = x86])
AM_CONDITIONAL([ARCH_X86_AVX], [test "$libitm_cv_as_avx" = yes])
AM_CONDITIONAL([ARCH_FUTEX], [test $enable_linux_futex = yes])
diff --git a/libitm/libitm.h b/libitm/libitm.h
index d7bc166a93b..1a6738b9dd3 100644
--- a/libitm/libitm.h
+++ b/libitm/libitm.h
@@ -232,7 +232,11 @@ ITM_LOG(CE)
ITM_BARRIERS(M256)
ITM_LOG(M256)
# endif
-#endif /* i386 */
+#else
+ typedef int _ITM_TYPE_M128 __attribute__((vector_size(16), may_alias));
+ ITM_BARRIERS(M128)
+ ITM_LOG(M128)
+#endif
#undef ITM_BARRIERS
#undef ITM_LOG
diff --git a/libitm/config/x86/x86_sse.cc b/libitm/vect128.cc
index c3b7237f180..18453acf735 100644
--- a/libitm/config/x86/x86_sse.cc
+++ b/libitm/vect128.cc
@@ -27,16 +27,9 @@
// ??? Use memcpy for now, until we have figured out how to best instantiate
// these loads/stores.
-CREATE_DISPATCH_FUNCTIONS_T_MEMCPY(M64, GTM::abi_disp()->, )
CREATE_DISPATCH_FUNCTIONS_T_MEMCPY(M128, GTM::abi_disp()->, )
void ITM_REGPARM
-_ITM_LM64 (const _ITM_TYPE_M64 *ptr)
-{
- GTM::GTM_LB (ptr, sizeof (*ptr));
-}
-
-void ITM_REGPARM
_ITM_LM128 (const _ITM_TYPE_M128 *ptr)
{
GTM::GTM_LB (ptr, sizeof (*ptr));
diff --git a/libitm/vect64.cc b/libitm/vect64.cc
new file mode 100644
index 00000000000..c451c58717d
--- /dev/null
+++ b/libitm/vect64.cc
@@ -0,0 +1,36 @@
+/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ Contributed by Richard Henderson <rth@redhat.com>.
+
+ This file is part of the GNU Transactional Memory Library (libitm).
+
+ Libitm is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ Libitm is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "libitm_i.h"
+#include "dispatch.h"
+
+// ??? Use memcpy for now, until we have figured out how to best instantiate
+// these loads/stores.
+CREATE_DISPATCH_FUNCTIONS_T_MEMCPY(M64, GTM::abi_disp()->, )
+
+void ITM_REGPARM
+_ITM_LM64 (const _ITM_TYPE_M64 *ptr)
+{
+ GTM::GTM_LB (ptr, sizeof (*ptr));
+}