aboutsummaryrefslogtreecommitdiff
path: root/libitm/libitm_i.h
AgeCommit message (Collapse)AuthorFilesLines
2013-02-03Update copyright in libitm.Richard Sandiford1-1/+1
From-SVN: r195697
2012-11-09Add HTM fastpath and use Intel RTM for it on x86.Torvald Riegel1-0/+5
* beginend.cc (htm_fastpath): New. (gtm_thread::begin_transaction, _ITM_commitTransaction, _ITM_commitTransactionEH): Add HTM fastpath handling. * config/linux/rwlock.h (gtm_rwlock.is_write_locked): New. * config/posix/rwlock.h (gtm_rwlock.is_write_locked): New. * config/x86/target.h (htm_available, htm_init, htm_begin_success, htm_begin, htm_commit, htm_abort, htm_abort_should_retry): New. * configure.tgt: Add -mrtm to XCFLAGS. * method-serial.cc (htm_mg, o_htm_mg, htm_dispatch, dispatch_htm): New. (gtm_thread::serialirr_mode): Add HTM fastpath handling. * libitm_i.h (htm_fastpath, dispatch_htm): Declare. * retry.cc (parse_default_method): Add HTM method parsing. (gtm_thread::number_of_threads_changed): Use HTM by default if available. From-SVN: r193369
2012-02-14libitm: Add multi-lock, write-through TM method.Torvald Riegel1-0/+12
libitm/ * libitm_i.h (GTM::gtm_rwlog_entry): New. (GTM::gtm_thread): Add read and write logs. (GTM::dispatch_ml_wt): Declare. * retry.cc (parse_default_method): Support ml_wt. * method-ml.cc: New file. * Makefile.am: Add method-ml.cc. * Makefile.in: Regenerate. From-SVN: r184212
2012-01-13libitm: Filter out undo writes that overlap with the libitm stack.Torvald Riegel1-1/+1
PR libitm/51855 * config/generic/tls.h (GTM::mask_stack_top): New. (GTM::mask_stack_bottom): Declare. * config/generic/tls.c (GTM::mask_stack_bottom): New. * local.cc (gtm_undolog::rollback): Filter out any updates that overlap the libitm stack. Add current transaction as parameter. * libitm_i.h (GTM::gtm_undolog::rollback): Adapt. * beginend.cc (GTM::gtm_thread::rollback): Adapt. * testsuite/libitm.c/stackundo.c: New test. From-SVN: r183172
2012-01-09libitm_i.h (_Unwind_DeleteException): Declare weak.Richard Henderson1-0/+4
* libitm_i.h (_Unwind_DeleteException): Declare weak. * eh_cpp.cc (_Unwind_DeleteException): Define for !HAVE_ELF_STYLE_WEAKREF. From-SVN: r183049
2012-01-08libitm: Optimize undo log.Torvald Riegel1-10/+25
libitm/ * local.cc (GTM_LB): Use GTM::gtm_undolog. (GTM::gtm_thread::drop_references_undolog): Remove. (GTM::gtm_thread::commit_undolog, GTM::gtm_thread::rollback_undolog): Move to ... * libitm_i.h (GTM::gtm_undolog): ...here. New. (GTM::gtm_undolog_entry): Remove. (GTM::gtm_thread): Adapt. * beginend.cc (GTM::gtm_thread::rollback): Adapt. (GTM::gtm_thread::trycommit): Adapt. * method-serial.cc (serial_dispatch::log): Adapt. * method-gl.cc (gl_wt_dispatch::pre_write): Adapt. (gl_wt_dispatch::store): Fix likely/unlikely. * containers.h (GTM::vector::resize): Add additional_capacity parameter and handle it. (GTM::vector::resize_noinline): New/adapt. (GTM::vector::push): New. From-SVN: r182992
2011-12-24libitm: Fix privatization safety during upgrades to serial mode.Torvald Riegel1-1/+2
libitm/ * beginend.cc (GTM::gtm_thread::restart): Add and handle finish_serial_upgrade parameter. * libitm.h (GTM::gtm_thread::restart): Adapt declaration. * config/linux/rwlock.cc (GTM::gtm_rwlock::write_lock_generic): Don't unset reader flag. (GTM::gtm_rwlock::write_upgrade_finish): New. * config/posix/rwlock.cc: Same. * config/linux/rwlock.h (GTM::gtm_rwlock::write_upgrade_finish): Declare. * config/posix/rwlock.h: Same. * method-serial.cc (GTM::gtm_thread::serialirr_mode): Unset reader flag after commit or after rollback when restarting. From-SVN: r182675
2011-12-13libitm: Conversion to c++11 atomics.Richard Henderson1-1/+2
* local_atomic: New file. * libitm_i.h: Include it. (gtm_thread::shared_state): Use atomic template. * beginend.cc (GTM::gtm_clock): Use atomic template. (global_tid): Use atomic template if 64-bit atomics available. (gtm_thread::gtm_thread): Update shared_state access. (gtm_thread::trycommit): Likewise. (choose_code_path): Update global_tid access. * method-gl.cc (gl_mg::orec): Use atomic template. Update all users. * stmlock.h (GTM::gtm_clock): Use atomic template. (gtm_get_clock, gtm_inc_clock): Update accesses. * config/linux/rwlock.cc (gtm_rwlock::read_lock): Remove redundant __sync_synchronize after atomic shared_state access. * config/posix/rwlock.cc (gtm_rwlock::read_lock): Likewise. (gtm_rwlock::write_lock_generic): Likewise. (gtm_rwlock::read_unlock): Likewise. * config/alpha/target.h (atomic_read_barrier): Remove. (atomic_write_barrier): Remove. * config/x86/target.h (atomic_read_barrier): Remove. (atomic_write_barrier): Remove. From-SVN: r182294
2011-11-30Swap the action and jmpbuf arguments to GTM_longjmpRichard Henderson1-1/+1
On several ABIs, the first register parameter is the same as the return value register. Moving the action parameter first avoids the need for register shuffling on these targets. * libitm_i.h (GTM_longjmp): Swap first and second arguments. * beginend.c (_ITM_abortTransaction): Update to match. (GTM::gtm_thread::restart): Likewise. * config/alpha/sjlj.S (GTM_longjmp): Likewise. * config/x86/sjlj.S (GTM_longjmp): Likewise. From-SVN: r181863
2011-11-22sjlj.S (CONCAT1, [...]): Respond to __USER_LABEL_PREFIX__ for targets that ↵Iain Sandoe1-1/+7
use it. libitm: * config/x86/sjlj.S (CONCAT1, CONCAT2, SYM): Respond to __USER_LABEL_PREFIX__ for targets that use it. TYPE, SIZE, HIDDEN): New macros to assist on non-elf targets. (_ITM_beginTransaction): Use SYM, TYPE, SIZE macros to assist in portability to non-elf targets. (GTM_longjmp): LIkewise. * libitm_i.h (begin_transaction): Apply __USER_LABEL_PREFIX__ where required. From-SVN: r181612
2011-11-09libitm: Remove unused code.Richard Henderson1-1/+0
In particular, unused code that's presenting portability problems. From-SVN: r181241
2011-11-08Merge from transactional-memory branch.Aldy Hernandez1-0/+302
From-SVN: r181154