Generates the
tbeginmachine instruction starting a non-constrained 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_tdbC struct defined inhtmintrin.hand 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*_nofloatvariant. In order to prevent a TDB from being written it is required to pass a constant zero value as parameter. Passing a 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_STARTEDtbegin has been executed as part of normal processing. The
transaction body is supposed to be executed.
_HTM_TBEGIN_INDETERMINATE_HTM_TBEGIN_TRANSIENT_HTM_TBEGIN_PERSISTENTThe
_HTM_FIRST_USER_ABORT_CODEdefined inhtmintrin.hspecifies the first abort code which can be used for__builtin_tabort. Values below this threshold are reserved for machine use.
The
struct __htm_tdbdefined inhtmintrin.hdescribes the structure of the transaction diagnostic block as specified in the Principles of Operation manual chapter 5-91.
Same as
__builtin_tbeginbut 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_tbegina 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_retrybut 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
tbegincmachine instruction starting a constrained hardware transaction. The second operand is set to0xff08.
Generates the
tendmachine 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
tabortmachine 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,1machine 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.