setbc
Set Boolean Condition
Sets RT to 1 if CR bit is set, else 0. (Branchless logic).
Details
Set register RT to 1 if the condition register bit identified by BI is set, else set RT to 0. This instruction provides a branchless way to materialize a boolean value from a condition register bit, useful for conditional assignment without branching.
Pseudocode Operation
if CR[BI] = 1 then
RT ← 1
else
RT ← 0
Programming Note
The setbc instruction is useful for conditionally 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.
Example
Encoding
Operands
-
RT
Target -
BI
CR Bit