Blame SOURCES/gcc7-htm-in-asm.patch

821dce
--- libitm/config/x86/target.h.jj	2013-06-23 20:43:50.000000000 +0200
821dce
+++ libitm/config/x86/target.h	2013-08-13 17:14:57.540012109 +0200
821dce
@@ -64,7 +64,7 @@ cpu_relax (void)
821dce
 
821dce
 // Use Intel RTM if supported by the assembler.
821dce
 // See gtm_thread::begin_transaction for how these functions are used.
821dce
-#ifdef HAVE_AS_RTM
821dce
+#if 1 /* def HAVE_AS_RTM */
821dce
 #define USE_HTM_FASTPATH
821dce
 #ifdef __x86_64__
821dce
 // Use the custom fastpath in ITM_beginTransaction.
821dce
@@ -97,7 +97,10 @@ htm_init ()
821dce
 static inline uint32_t
821dce
 htm_begin ()
821dce
 {
821dce
-  return _xbegin();
821dce
+//  return _xbegin();
821dce
+  uint32_t ret;
821dce
+  __asm volatile ("movl $-1, %%eax; .byte 0xc7, 0xf8, 0, 0, 0, 0" : "=a" (ret) : : "memory");
821dce
+  return ret;
821dce
 }
821dce
 
821dce
 static inline bool
821dce
@@ -109,7 +112,8 @@ htm_begin_success (uint32_t begin_ret)
821dce
 static inline void
821dce
 htm_commit ()
821dce
 {
821dce
-  _xend();
821dce
+//  _xend();
821dce
+  __asm volatile (".byte 0x0f, 0x01, 0xd5" : : : "memory");
821dce
 }
821dce
 
821dce
 static inline void
821dce
@@ -117,7 +121,8 @@ htm_abort ()
821dce
 {
821dce
   // ??? According to a yet unpublished ABI rule, 0xff is reserved and
821dce
   // supposed to signal a busy lock.  Source: andi.kleen@intel.com
821dce
-  _xabort(0xff);
821dce
+//  _xabort(0xff);
821dce
+  __asm volatile (".byte 0xc6, 0xf8, 0xff" : : : "memory");
821dce
 }
821dce
 
821dce
 static inline bool
821dce
@@ -130,7 +135,10 @@ htm_abort_should_retry (uint32_t begin_r
821dce
 static inline bool
821dce
 htm_transaction_active ()
821dce
 {
821dce
-  return _xtest() != 0;
821dce
+//  return _xtest() != 0;
821dce
+  bool ret;
821dce
+  __asm volatile (".byte 0x0f, 0x01, 0xd6; setne %%al" : "=a" (ret) : : "memory");
821dce
+  return ret;
821dce
 }
821dce
 #endif
821dce