isel
Integer Select
isel RT, RA, RB, BC
Conditionally copies RA or RB to RT based on a CR bit. (Equivalent to C ternary operator 'cond ? a : b').
Encoding
Binary Layout
31
0:5
RT
6:10
RA
11:15
RB
16:20
BC
21:25
15
26:30
/
31
Operands
-
RT
Target Register -
RA
Source (If True) - 0 means 0 -
RB
Source (If False) -
BC
CR Bit Index (Condition) -
CR
Condition Register Field
Example
isel r3, r4, r5, 2
// r3 = (CR.eq) ? r4 : r5
Registers Altered
CR0, CR1-CR7Related
Across architectures
Conditional Select (Branchless Move) : how x86, ARM, RISC-V, and PowerISA each do this.
More in Base
Reference
View in PowerISA v3.1C Specification ↗
OPF Power ISA v3.1C
Description
Conditionally selects between RA and RB based on the value of a single bit in the Condition Register, writing the result to RT. If the CR bit BC is 1, RT ← RA (or 0 if RA=0); otherwise RT ← RB. This provides a branch-free ternary operation.
Operation
BIT ← CR[BC]
if BIT = 1 then
RT ← (RA)
else
RT ← (RB)
Extended Mnemonics
| Extended Mnemonic | Equivalent Instruction |
|---|---|
| iselgt | |
| iseleq | |
| isellt |
Programming Note
isel is used for conditional moves based on the condition register.