| |||
| Home > ARM and Thumb Instructions > General data processing instructions > SEL | |||
Select bytes from each operand according to the state of the CPSR GE flags.
SEL{cond}Rd,Rn,Rm
where:
condis an optional condition code (see Conditional execution).
Rdis the destination register.
Rnis the register holding the first operand.
Rmis the register holding the second operand.
The SEL instruction selects bytes from or Rn according
to the CPSR GE flags:Rm
if
GE[0] is set, Rd[7:0] come from Rn[7:0],
otherwise from Rm[7:0]
if GE[1] is set, Rd[15:8] come
from Rn[15:8], otherwise from Rm[15:8]
if GE[2] is set, Rd[23:16] come
from Rn[23:16], otherwise from Rm[23:16]
if GE[3] is set, Rd[31:24] come
from Rn[31:24], otherwise from Rm[31:24].
Do not use r15 for , Rd,
or Rn.Rm
Use the SEL instruction after one of the signed
parallel instructions, see Parallel add and subtract. You can use this to select maximum or
minimum values in multiple byte or halfword data.
This ARM instruction is available in ARMv6 and above.
This 32-bit Thumb-2 instruction is available in T2 variants of ARMv6 and above.
There is no 16-bit Thumb version of this instruction.