tbegin.
Transaction Begin
tbegin. R
Initiates a hardware transaction. If the transaction fails, execution rolls back to this point. Sets CR0 based on success/failure.
Encoding
Binary Layout
31
0:5
/
6:10
R
11:15
/
16:20
654
21:30
1
31
Operands
-
R
Rollback Handler (0=External, 1=Internal)
Example
tbegin. 0
// Start atomic hardware transaction.
Registers Altered
CR0Related
More in Transactional Memory
Reference
View in PowerISA v3.1C Specification ↗
OPF Power ISA v3.1C
Description
Initiates a hardware transaction, setting the transaction active state and recording checkpoint information. If execution completes successfully within the transaction, tbegin. sets CR0[EQ] = 1; if the transaction is aborted, execution rolls back to this instruction and CR0[EQ] = 0, with CR0[SO] indicating the abort cause. The R field determines whether a transaction failure causes an external rollback (R=0) or an internal retry (R=1). Requires Transactional Memory (TM) facility support.
Operation
if transaction initiated successfully then CR0[EQ] ← 1 else CR0[EQ] ← 0; CR0[LT,GT,SO] set based on abort cause; transaction state is active
Programming Note
In synthetic TM mode, transactions initiated by tbegin will fail immediately, invoking the failure handler. Ensure that your application logic correctly handles transaction failures to maintain data integrity.