Generates the
tbegin
machine instruction starting a non-constraint hardware transaction. If the parameter is non-NULL the memory area is used to store the transaction diagnostic buffer and will be passed as first operand totbegin
. This buffer can be defined using thestruct __htm_tdb
C struct defined inhtmintrin.h
and must reside on a double-word boundary. The second tbegin operand is set to0xff0c
. This enables save/restore of all GPRs and disables aborts for FPR and AR manipulations inside the transaction body. The condition code set by the tbegin instruction is returned as integer value. The tbegin instruction by definition overwrites the content of all FPRs. The compiler will generate code which saves and restores the FPRs. For soft-float code it is recommended to used the*_nofloat
variant. In order to prevent a TDB from being written it is required to pass an constant zero value as parameter. Passing the zero value through a variable is not sufficient. Although modifications of access registers inside the transaction will not trigger an transaction abort it is not supported to actually modify them. Access registers do not get saved when entering a transaction. They will have undefined state when reaching the abort code.
Macros for the possible return codes of tbegin are defined in the
htmintrin.h
header file:
_HTM_TBEGIN_STARTED
tbegin
has been executed as part of normal processing. The
transaction body is supposed to be executed.
_HTM_TBEGIN_INDETERMINATE
_HTM_TBEGIN_TRANSIENT
_HTM_TBEGIN_PERSISTENT
The
_HTM_FIRST_USER_ABORT_CODE
defined inhtmintrin.h
specifies the first abort code which can be used for__builtin_tabort
. Values below this threshold are reserved for machine use.
The
struct __htm_tdb
defined inhtmintrin.h
describes the structure of the transaction diagnostic block as specified in the Principles of Operation manual chapter 5-91.
Same as
__builtin_tbegin
but without FPR saves and restores. Using this variant in code making use of FPRs will leave the FPRs in undefined state when entering the transaction abort handler code.
In addition to
__builtin_tbegin
a loop for transient failures is generated. If tbegin returns a condition code of 2 the transaction will be retried as often as specified in the second argument. The perform processor assist instruction is used to tell the CPU about the number of fails so far.
Same as
__builtin_tbegin_retry
but without FPR saves and restores. Using this variant in code making use of FPRs will leave the FPRs in undefined state when entering the transaction abort handler code.
Generates the
tbeginc
machine instruction starting a constraint hardware transaction. The second operand is set to0xff08
.
Generates the
tend
machine instruction finishing a transaction and making the changes visible to other threads. The condition code generated by tend is returned as integer value.
Generates the
tabort
machine instruction with the specified abort code. Abort codes from 0 through 255 are reserved and will result in an error message.
Generates the
ppa rX,rY,1
machine instruction. Where the integer parameter is loaded into rX and a value of zero is loaded into rY. The integer parameter specifies the number of times the transaction repeatedly aborted.