]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libitm: Introduce target macro TARGET_BEGIN_TRANSACTION_ATTRIBUTE.
authorDominik Vogt <vogt@linux.vnet.ibm.com>
Thu, 3 Mar 2016 09:31:57 +0000 (09:31 +0000)
committerAndreas Krebbel <krebbel@gcc.gnu.org>
Thu, 3 Mar 2016 09:31:57 +0000 (09:31 +0000)
The attached patch adds the a target specific attribute via the
new target macro TARGET_BEGIN_TRANSACTION_ATTRIBUTE to the
function begin_transaction().  S/390 uses this to set the
soft-float target attribute which is needed to fix a crash with
-m31.

As there seems to be no place in libitm to document internal macros like
USE_HTM_FASTPATH or the new macro, I've put the documentation in a
comment where the macro is used.

2016-03-03  Dominik Vogt  <vogt@linux.vnet.ibm.com>

* config/s390/target.h (TARGET_BEGIN_TRANSACTION_ATTRIBUTE): Define
function attribute to disable floating point in begin_transaction() on
S/390.
* beginend.cc (begin_transaction): Use
TARGET_BEGIN_TRANSACTION_ATTRIBUTE.

From-SVN: r233929

libitm/ChangeLog
libitm/beginend.cc
libitm/config/s390/target.h

index 2a3554fd6af1ec3f393cf980ba2fa8c91b8a4108..42b47762b9f766984813e9ba4f4208f9691d9258 100644 (file)
@@ -1,3 +1,11 @@
+2016-03-03  Dominik Vogt  <vogt@linux.vnet.ibm.com>
+
+       * config/s390/target.h (TARGET_BEGIN_TRANSACTION_ATTRIBUTE): Define
+       function attribute to disable floating point in begin_transaction() on
+       S/390.
+       * beginend.cc (begin_transaction): Use
+       TARGET_BEGIN_TRANSACTION_ATTRIBUTE.
+
 2016-01-22  Torvald Riegel  <triegel@redhat.com>
 
        * beginend.cc (GTM::gtm_thread::serial_lock): Put on cacheline
index 1a258ad7965ee23ac589f319a8ea1d8f1be35589..20b5547c30d861633243d6f3a3bb9de15fa4514e 100644 (file)
@@ -149,6 +149,12 @@ choose_code_path(uint32_t prop, abi_dispatch *disp)
     return a_runInstrumentedCode;
 }
 
+#ifdef TARGET_BEGIN_TRANSACTION_ATTRIBUTE
+/* This macro can be used to define target specific attributes for this
+   function.  For example, S/390 requires floating point to be disabled in
+   begin_transaction.  */
+TARGET_BEGIN_TRANSACTION_ATTRIBUTE
+#endif
 uint32_t
 GTM::gtm_thread::begin_transaction (uint32_t prop, const gtm_jmpbuf *jb)
 {
index 44819a4d244feda1eaa09f4d15e8e7264263ecfd..c9d52034d1aa02d157d0c4177431c8adcb97f55b 100644 (file)
@@ -69,6 +69,9 @@ cpu_relax (void)
 /* Number of retries for transient failures.  */
 #define _HTM_ITM_RETRIES 10
 #define USE_HTM_FASTPATH
+#define TARGET_BEGIN_TRANSACTION_ATTRIBUTE \
+  __attribute__ ((target("soft-float")))
+
 
 static inline bool
 htm_available ()