sel

Select Bytes

SEL<c> <Rd>, <Rn>, <Rm>

Selects bytes from Rn or Rm based on GE flags.

Details

Selects bytes from Rn or Rm based on the GE (Greater-than-or-Equal) condition flags, placing the selected bytes into Rd. For each byte position i, if GE[i] is set, the byte from Rn[8*i+7:8*i] is selected; otherwise, the byte from Rm[8*i+7:8*i] is selected. Condition flags are not affected by this instruction.

Pseudocode Operation

for i = 0 to 3 do
  if GE[i] == 1 then
    Rd[8*i+7:8*i] ← Rn[8*i+7:8*i]
  else
    Rd[8*i+7:8*i] ← Rm[8*i+7:8*i]

Example

SEL r0, r1, r2

Encoding

Binary Layout
cond
01101000
Rn
Rd
1
1
1
1
1011
Rm
 
Format Data Proc
Opcode 0x06800FB0
Extension A32 (DSP)

Operands

  • Rd
    Destination general-purpose register
  • Rn
    First source / base general-purpose register
  • Rm
    Second source / offset general-purpose register

Reference (Arm AArch32 ISA)

Instruction Forms

Encoding Instruction ISA Bit pattern
0x06800FB0 SEL{<c>}{<q>} {<Rd>,} <Rn>, <Rm> A32 cond | 01101000 | Rn | Rd | 1 | 1 | 1 | 1 | 1011 | Rm
0xFAA0F080 SEL{<c>}{<q>} {<Rd>,} <Rn>, <Rm> T32 111110101 | 010 | Rn | 1111 | Rd | 10 | 00 | Rm

Description

Select Bytes selects each byte of its result from either its first operand or its second operand, according to the values of the PSTATE.GE flags.

Operation

if ConditionPassed() then
    EncodingSpecificOperations();
    R[d]<7:0>   = if PSTATE.GE<0> == '1' then R[n]<7:0>   else R[m]<7:0>;
    R[d]<15:8>  = if PSTATE.GE<1> == '1' then R[n]<15:8>  else R[m]<15:8>;
    R[d]<23:16> = if PSTATE.GE<2> == '1' then R[n]<23:16> else R[m]<23:16>;
    R[d]<31:24> = if PSTATE.GE<3> == '1' then R[n]<31:24> else R[m]<31:24>;