setnbcr

Set Negative Boolean Condition Reverse

setnbcr RT, BI

Sets RT to -1 if CR bit is clear, else 0.

Details

The setnbcr instruction sets the contents of register RT to -1 if bit BI of the Condition Register (CR) is 0, and to 0 if bit BI of CR is 1.

Pseudocode Operation

RT ← (CRBI = 1) ? 0 : -1

Programming Note

Use setnbcr when you need to invert a condition bit in the Condition Register into a boolean value. Ensure that the target register RT is properly aligned and accessible. This instruction operates at user privilege level, so no special permissions are required. Be cautious of potential performance impacts if used in tight loops.

Example

setnbcr r3, 0

Encoding

Binary Layout
31
0
RT
6
BI
11
/
16
480
21
/
31
 
Format X-form
Opcode 0x7C0003C0
Extension Base
Registers Altered CR

Operands

  • RT
    Target
  • BI
    CR Bit