Commit Graph

14 Commits

Author SHA1 Message Date
Richard Sandiford
f93608e6d4 Update copyright years in libitm/
From-SVN: r206298
2014-01-02 22:26:00 +00:00
Torvald Riegel
bec9ec3fc1 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.

From-SVN: r202101
2013-08-30 10:33:41 +00:00
Richard Sandiford
75f9527c9b Update copyright in libitm.
From-SVN: r195697
2013-02-03 17:46:11 +00:00
Torvald Riegel
64fbcc74a3 Add HTM fastpath and use Intel RTM for it on x86.
* 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-11-09 17:04:40 +00:00
Torvald Riegel
31772c9507 libitm: Add multi-lock, write-through TM method.
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-02-14 13:14:27 +00:00
Torvald Riegel
07b6642b93 libitm: Filter out undo writes that overlap with the libitm stack.
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-13 23:45:06 +00:00
Richard Henderson
8377e5e546 libitm_i.h (_Unwind_DeleteException): Declare weak.
* libitm_i.h (_Unwind_DeleteException): Declare weak.
	* eh_cpp.cc (_Unwind_DeleteException): Define for
	!HAVE_ELF_STYLE_WEAKREF.

From-SVN: r183049
2012-01-09 19:16:07 -08:00
Torvald Riegel
11f30bb0e4 libitm: Optimize undo log.
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
2012-01-08 14:13:49 +00:00
Torvald Riegel
610e390135 libitm: Fix privatization safety during upgrades to serial mode.
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-24 01:42:35 +00:00
Richard Henderson
36cfbee133 libitm: Conversion to c++11 atomics.
* 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-12-13 11:11:25 -08:00
Richard Henderson
062f93f255 Swap the action and jmpbuf arguments to GTM_longjmp
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-30 14:29:33 -08:00
Iain Sandoe
0b41ebef72 sjlj.S (CONCAT1, [...]): Respond to __USER_LABEL_PREFIX__ for targets that 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-22 09:57:19 +00:00
Richard Henderson
79b1edb6b5 libitm: Remove unused code.
In particular, unused code that's presenting portability problems.

From-SVN: r181241
2011-11-09 14:54:55 -08:00
Aldy Hernandez
0a35513e4e Merge from transactional-memory branch.
From-SVN: r181154
2011-11-08 11:13:41 +00:00