tcheck

Transaction Check

tcheck BF

Checks transaction status and updates CR.

Encoding

Binary Layout
31
0:5
BF
6:10
/
11:15
/
16:20
716
21:30
/
31
 
Format X-form
Opcode 0x7C00059C

Operands

  • BF
    CR Field

Example

tcheck cr0

Registers Altered

CR

Related

More in Transactional Memory

Reference

Description

Transaction Check. Tests the state of the current transaction and sets CR field BF based on whether a transaction is active, suspended, or whether a failure has been recorded. No effect outside a transaction.

Operation

if Transactional_or_Suspended() then
  CR[4*BF:4*BF+3] ← transaction_state_bits()
else
  CR[4*BF:4*BF+3] ← 0b0000

Programming Note

The tcheck instruction is used to determine the state of the current transaction, setting the condition register field BF accordingly. It should be used within a transactional context; outside transactions, it will clear the specified CR field. Ensure proper alignment and ordering relative to other transactional instructions for accurate state checks.