tcheck

Transaction Check

tcheck BF

Checks transaction status and updates CR.

Encoding

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

Operands

  • BF
    CR Field

Example

tcheck cr0

Registers Altered

CR

Related

More in Transactional Memory

Reference

Not in Power ISA v3.1C

Description

Not in Power ISA v3.1C: Transactional Memory has been removed from the architecture (Appendix A), and its opcode map lists this opcode as reserved. The encoding shown is binutils' (opcodes/ppc-opc.c), not the manual's. 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.