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