setbcr

Set Boolean Condition Reverse

setbcr RT, BI

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

Encoding

Binary Layout
31
0:5
RT
6:10
BI
11:15
/
16:20
416
21:30
/
31
 
Format X-form
Opcode 0x7C000340
Extension Base

Operands

  • RT
    Target
  • BI
    CR Bit

Example

setbcr r3, 0

Registers Altered

CR

Related

More in Base

Reference

Description

Set register RT to 1 if the condition register bit identified by BI is clear (0), else set RT to 0. This is the logical inverse of setbc, allowing branchless negation of a condition register bit test.

Operation

if CR[BI] = 0 then
  RT ← 1
else
  RT ← 0

Programming Note

The setbcr instruction is useful for setting a register based on the state of a specific bit in the Condition Register. Ensure that the correct bit index BI is specified to avoid unintended behavior. This instruction operates at user privilege level and does not generate exceptions under normal conditions.