setnbc

Set Negative Boolean Condition

setnbc RT, BI

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

Encoding

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

Operands

  • RT
    Target
  • BI
    CR Bit

Example

setnbc r3, 0

Registers Altered

CR

Related

More in Base

Reference

Description

Sets the target GPR to -1 (all bits set) if the specified condition register bit is set, otherwise sets it to 0. This instruction operates entirely on the CR and target register, with no side effects on other status fields.

Operation

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

Programming Note

Use setnbc to conditionally set a register based on a specific bit in the Condition Register. Ensure CRBI is within valid range; otherwise, results are undefined. This instruction operates at user privilege level and does not generate exceptions under normal conditions.