vupkhsh

Vector Unpack High Signed Halfword

vupkhsh vD, vB

Unpacks the high signed halfwords from a vector register into a new vector register.

Details

The instruction unpacks the high signed halfwords from VSR[VRB+32] and places them into VSR[VRT+32]. Each halfword is sign-extended to form a word.

Pseudocode Operation

if MSR.VEC=0 then
    Vector_Unavailable()
for each integer value i from 0 to 3 do
    VSR[VRT+32].word[i] ←EXTS32(VSR[VRB+32].hword[i])

Programming Note

This instruction is used to extract the high signed halfwords from a vector register and sign-extend them into another vector register. Ensure that the Vector Facility (MSR.VEC) is enabled before using this instruction; otherwise, it will raise an exception. The operation processes each of the four halfwords in the source register, so ensure proper alignment if dealing with specific data structures.

Example

vupkhsh vd, vb

Encoding

Binary Layout
4
0
vD
6
0
11
vB
31
590
 
Format VX-form
Opcode 0x1000024E
Extension VMX (AltiVec)
Registers Altered MSR

Operands

  • vD
    Target
  • vB
    Source
  • VRT
    Target Vector Register
  • VRB
    Source Vector Register