diff options
author | torvald <torvald@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-08-30 10:33:41 +0000 |
---|---|---|
committer | torvald <torvald@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-08-30 10:33:41 +0000 |
commit | f20d0394eaddf7f3432584ceba1c0068c53edc29 (patch) | |
tree | c0b7c9260feea5365646627e5ddc4df6b74877de /libitm/libitm_i.h | |
parent | 5fc5fc38e108c82be4c462ddd72f2c8fdbb9e2c5 (diff) | |
download | gcc-f20d0394eaddf7f3432584ceba1c0068c53edc29.tar.gz |
Add custom HTM fast path for RTM on x86_64.
* libitm_i.h (gtm_thread): Assign an asm name to serial_lock.
(htm_fastpath): Assign an asm name.
* libitm.h (_ITM_codeProperties): Add non-ABI flags used by custom
HTM fast paths.
(_ITM_actions): Likewise.
* config/x86/target.h (HTM_CUSTOM_FASTPATH): Enable custom fastpath on
x86_64.
* config/x86/sjlj.S (_ITM_beginTransaction): Add custom HTM fast path.
* config/posix/rwlock.h (gtm_rwlock): Update comments. Move summary
field to the start of the structure.
* config/linux/rwlock.h (gtm_rwlock): Update comments.
* beginend.cc (gtm_thread::begin_transaction): Add retry policy
handling for custom HTM fast paths.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202101 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libitm/libitm_i.h')
-rw-r--r-- | libitm/libitm_i.h | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/libitm/libitm_i.h b/libitm/libitm_i.h index 421b349cfe5..e965caf839c 100644 --- a/libitm/libitm_i.h +++ b/libitm/libitm_i.h @@ -87,6 +87,14 @@ enum gtm_restart_reason #include "dispatch.h" #include "containers.h" +#ifdef __USER_LABEL_PREFIX__ +# define UPFX UPFX1(__USER_LABEL_PREFIX__) +# define UPFX1(t) UPFX2(t) +# define UPFX2(t) #t +#else +# define UPFX +#endif + namespace GTM HIDDEN { // This type is private to alloc.c, but needs to be defined so that @@ -230,6 +238,7 @@ struct gtm_thread // be used for the next iteration of the transaction. // Only restart_total is reset to zero when the transaction commits, the // other counters are total values for all previously executed transactions. + // restart_total is also used by the HTM fastpath in a different way. uint32_t restart_reason[NUM_RESTARTS]; uint32_t restart_total; @@ -247,7 +256,9 @@ struct gtm_thread // The lock that provides access to serial mode. Non-serialized // transactions acquire read locks; a serialized transaction aquires // a write lock. - static gtm_rwlock serial_lock; + // Accessed from assembly language, thus the "asm" specifier on + // the name, avoiding complex name mangling. + static gtm_rwlock serial_lock __asm__(UPFX "gtm_serial_lock"); // The head of the list of all threads' transactions. static gtm_thread *list_of_threads; @@ -277,15 +288,8 @@ struct gtm_thread // Invoked from assembly language, thus the "asm" specifier on // the name, avoiding complex name mangling. -#ifdef __USER_LABEL_PREFIX__ -#define UPFX1(t) UPFX(t) -#define UPFX(t) #t - static uint32_t begin_transaction(uint32_t, const gtm_jmpbuf *) - __asm__(UPFX1(__USER_LABEL_PREFIX__) "GTM_begin_transaction") ITM_REGPARM; -#else static uint32_t begin_transaction(uint32_t, const gtm_jmpbuf *) - __asm__("GTM_begin_transaction") ITM_REGPARM; -#endif + __asm__(UPFX "GTM_begin_transaction") ITM_REGPARM; // In eh_cpp.cc void revert_cpp_exceptions (gtm_transaction_cp *cp = 0); @@ -338,7 +342,9 @@ extern gtm_cacheline_mask gtm_mask_stack(gtm_cacheline *, gtm_cacheline_mask); // Control variable for the HTM fastpath that uses serial mode as fallback. // Non-zero if the HTM fastpath is enabled. See gtm_thread::begin_transaction. -extern uint32_t htm_fastpath; +// Accessed from assembly language, thus the "asm" specifier on +// the name, avoiding complex name mangling. +extern uint32_t htm_fastpath __asm__(UPFX "gtm_htm_fastpath"); } // namespace GTM |