pkhtb

Pack Halfword Top Bottom

PKHTB<c> <Rd>, <Rn>, <Rm> {, ASR #<imm>}

Combines top half of Rn with bottom half of shifted Rm.

Pseudocode Operation

shifted_rm ← Rm >> shift_imm
Rd[15:0] ← shifted_rm[15:0]
Rd[31:16] ← Rn[31:16]

Example

PKHTB r0, r1, r2

Encoding

Binary Layout
cond
31:28
01101000
27:20
Rn
19:16
Rd
15:12
imm5
11:7
1
6
01
5:4
Rm
3:0
 
Format Data Proc
Opcode 0x06800050
Extension A32 (DSP)

Operands

  • Rd
    Destination general-purpose register
  • Rn
    Top Src
  • Rm
    Bottom Src

Related

More in A32 (DSP)

Reference

Instruction Forms

Encoding Instruction ISA Bit pattern
0x06800050 PKHTB{<c>}{<q>} {<Rd>,} <Rn>, <Rm> {, ASR #<imm>} A32 cond | 01101000 | Rn | Rd | imm5 | 1 | 01 | Rm
0xEAC00020 PKHTB{<c>}{<q>} {<Rd>,} <Rn>, <Rm> {, ASR #<imm>} T32 1110101 | 0110 | 0 | Rn | 0 | imm3 | Rd | imm2 | 1 | 0 | Rm

Description

Pack Halfword combines one halfword of its first operand with the other halfword of its shifted second operand.

Operation

if ConditionPassed() then
    EncodingSpecificOperations();
    operand2 = Shift(R[m], shift_t, shift_n, PSTATE.C);  // PSTATE.C ignored
    R[d]<15:0>  = if tbform then operand2<15:0> else R[n]<15:0>;
    R[d]<31:16> = if tbform then R[n]<31:16>    else operand2<31:16>;