# include <immintrin.h>
# if defined __GNUC__ && !defined __INTEL_COMPILER
-# define TRANSACTIONAL_TARGET __attribute__((target("rtm")))
-# define TRANSACTIONAL_INLINE __attribute__((target("rtm"),always_inline))
+# define TRANSACTIONAL_TARGET __attribute__((target("rtm"),hot))
+# define TRANSACTIONAL_INLINE __attribute__((target("rtm"),hot,always_inline))
# else
# define TRANSACTIONAL_TARGET /* nothing */
# define TRANSACTIONAL_INLINE /* nothing */
TRANSACTIONAL_INLINE static inline void xend() { _xend(); }
# elif defined __powerpc64__
-# include <htmxlintrin.h>
extern bool have_transactional_memory;
bool transactional_lock_enabled();
-# define TRANSACTIONAL_TARGET __attribute__((target("htm")))
-# define TRANSACTIONAL_INLINE __attribute__((target("htm"),always_inline))
-
-TRANSACTIONAL_INLINE static inline bool xbegin()
-{
- return have_transactional_memory &&
- __TM_simple_begin() == _HTM_TBEGIN_STARTED;
-}
-
+# define TRANSACTIONAL_TARGET __attribute__((hot))
+# define TRANSACTIONAL_INLINE __attribute__((hot,always_inline))
+
+/**
+ Newer gcc compilers only provide __builtin_{htm}
+ function when the -mhtm is actually provided. So
+ we've got the option of including it globally, or
+ pushing down to one file with that enabled and removing
+ the inline optimization.
+ file.
+ */
+TRANSACTIONAL_TARGET bool xbegin();
+TRANSACTIONAL_TARGET void xabort();
+TRANSACTIONAL_TARGET void xend();
# ifdef UNIV_DEBUG
bool xtest();
# endif
-TRANSACTIONAL_INLINE static inline void xabort() { __TM_abort(); }
-
-TRANSACTIONAL_INLINE static inline void xend() { __TM_end(); }
# endif
#endif
bool xtest() { return have_transactional_memory && _xtest(); }
# endif
#elif defined __powerpc64__
+# include <htmxlintrin.h>
+
+__attribute__((target("htm"),hot))
+bool xbegin()
+{
+ return have_transactional_memory &&
+ __TM_simple_begin() == _HTM_TBEGIN_STARTED;
+}
+
+__attribute__((target("htm"),hot))
+void xabort() { __TM_abort(); }
+
+__attribute__((target("htm"),hot))
+void xend() { __TM_end(); }
# ifdef __linux__
# include <sys/auxv.h>
}
# ifdef UNIV_DEBUG
-TRANSACTIONAL_TARGET bool xtest()
+__attribute__((target("htm"),hot))
+bool xtest()
{
return have_transactional_memory &&
_HTM_STATE (__builtin_ttest ()) == _HTM_TRANSACTIONAL;
TARGET_LINK_LIBRARIES(innodb_fts-t mysys mytap)
ADD_DEPENDENCIES(innodb_fts-t GenError)
MY_ADD_TEST(innodb_fts)
+IF(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64|powerpc64")
+ ADD_COMPILE_FLAGS(
+ ../sync/srw_lock.cc
+ COMPILE_FLAGS "-mhtm"
+ )
+ENDIF()
ADD_EXECUTABLE(innodb_sync-t innodb_sync-t.cc ../sync/srw_lock.cc)
TARGET_LINK_LIBRARIES(innodb_sync-t mysys mytap)
ADD_DEPENDENCIES(innodb_sync-t GenError)