gcc: S/390 System z Built-in Functions
1
1 6.59.26 S/390 System z Built-in Functions
1 -----------------------------------------
1
1 -- Built-in Function: int __builtin_tbegin (void*)
1 Generates the 'tbegin' machine instruction starting a
1 non-constrained hardware transaction. If the parameter is non-NULL
1 the memory area is used to store the transaction diagnostic buffer
1 and will be passed as first operand to 'tbegin'. This buffer can
1 be defined using the 'struct __htm_tdb' C struct defined in
1 'htmintrin.h' and must reside on a double-word boundary. The
1 second tbegin operand is set to '0xff0c'. This enables
1 save/restore of all GPRs and disables aborts for FPR and AR
1 manipulations inside the transaction body. The condition code set
1 by the tbegin instruction is returned as integer value. The tbegin
1 instruction by definition overwrites the content of all FPRs. The
1 compiler will generate code which saves and restores the FPRs. For
1 soft-float code it is recommended to used the '*_nofloat' variant.
1 In order to prevent a TDB from being written it is required to pass
1 a constant zero value as parameter. Passing a zero value through a
1 variable is not sufficient. Although modifications of access
1 registers inside the transaction will not trigger an transaction
1 abort it is not supported to actually modify them. Access
1 registers do not get saved when entering a transaction. They will
1 have undefined state when reaching the abort code.
1
1 Macros for the possible return codes of tbegin are defined in the
1 'htmintrin.h' header file:
1
1 '_HTM_TBEGIN_STARTED'
1 'tbegin' has been executed as part of normal processing. The
1 transaction body is supposed to be executed.
1 '_HTM_TBEGIN_INDETERMINATE'
1 The transaction was aborted due to an indeterminate condition which
1 might be persistent.
1 '_HTM_TBEGIN_TRANSIENT'
1 The transaction aborted due to a transient failure. The
1 transaction should be re-executed in that case.
1 '_HTM_TBEGIN_PERSISTENT'
1 The transaction aborted due to a persistent failure. Re-execution
1 under same circumstances will not be productive.
1
1 -- Macro: _HTM_FIRST_USER_ABORT_CODE
1 The '_HTM_FIRST_USER_ABORT_CODE' defined in 'htmintrin.h' specifies
1 the first abort code which can be used for '__builtin_tabort'.
1 Values below this threshold are reserved for machine use.
1
1 -- Data type: struct __htm_tdb
1 The 'struct __htm_tdb' defined in 'htmintrin.h' describes the
1 structure of the transaction diagnostic block as specified in the
1 Principles of Operation manual chapter 5-91.
1
1 -- Built-in Function: int __builtin_tbegin_nofloat (void*)
1 Same as '__builtin_tbegin' but without FPR saves and restores.
1 Using this variant in code making use of FPRs will leave the FPRs
1 in undefined state when entering the transaction abort handler
1 code.
1
1 -- Built-in Function: int __builtin_tbegin_retry (void*, int)
1 In addition to '__builtin_tbegin' a loop for transient failures is
1 generated. If tbegin returns a condition code of 2 the transaction
1 will be retried as often as specified in the second argument. The
1 perform processor assist instruction is used to tell the CPU about
1 the number of fails so far.
1
1 -- Built-in Function: int __builtin_tbegin_retry_nofloat (void*, int)
1 Same as '__builtin_tbegin_retry' but without FPR saves and
1 restores. Using this variant in code making use of FPRs will leave
1 the FPRs in undefined state when entering the transaction abort
1 handler code.
1
1 -- Built-in Function: void __builtin_tbeginc (void)
1 Generates the 'tbeginc' machine instruction starting a constrained
1 hardware transaction. The second operand is set to '0xff08'.
1
1 -- Built-in Function: int __builtin_tend (void)
1 Generates the 'tend' machine instruction finishing a transaction
1 and making the changes visible to other threads. The condition
1 code generated by tend is returned as integer value.
1
1 -- Built-in Function: void __builtin_tabort (int)
1 Generates the 'tabort' machine instruction with the specified abort
1 code. Abort codes from 0 through 255 are reserved and will result
1 in an error message.
1
1 -- Built-in Function: void __builtin_tx_assist (int)
1 Generates the 'ppa rX,rY,1' machine instruction. Where the integer
1 parameter is loaded into rX and a value of zero is loaded into rY.
1 The integer parameter specifies the number of times the transaction
1 repeatedly aborted.
1
1 -- Built-in Function: int __builtin_tx_nesting_depth (void)
1 Generates the 'etnd' machine instruction. The current nesting
1 depth is returned as integer value. For a nesting depth of 0 the
1 code is not executed as part of an transaction.
1
1 -- Built-in Function: void __builtin_non_tx_store (uint64_t *,
1 uint64_t)
1
1 Generates the 'ntstg' machine instruction. The second argument is
1 written to the first arguments location. The store operation will
1 not be rolled-back in case of an transaction abort.
1