sel

Select Bytes

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

Selects bytes from Rn or Rm based on GE flags.

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
31:28
01101000
27:20
Rn
19:16
Rd
15:12
1
11
1
10
1
9
1
8
1011
7:4
Rm
3:0
 
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

Related

Other forms of sel

  • sel SVE Select Elements

More in A32 (DSP)

Reference

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>;