vupkhpx

Vector Unpack High Pixel

vupkhpx vD, vB

Unpacks high 4 pixels to 4 words.

Details

The Vector Unpack High Pixel instruction (vupkhpx) unpacks the high halfwords of a vector register into bytes, sign-extending the most significant bit and zero-extending the remaining bits. The result is stored in another vector register.

Pseudocode Operation

if MSR.VEC=0 then Vector_Unavailable()
do i = 0 to 3
   src ←VSR[VRB+32].hword[i]
   VSR[VRT+32].word[i].byte[0] ←EXTS8(src.bit[0])
   VSR[VRT+32].word[i].byte[1] ←EXTZ8(src.bit[1:5])
   VSR[VRT+32].word[i].byte[2] ←EXTZ8(src.bit[6:10])
   VSR[VRT+32].word[i].byte[3] ←EXTZ8(src.bit[11:15])
end

Programming Note

The vupkhpx instruction is used to unpack the high halfwords of a vector register into bytes, sign-extending the most significant bit and zero-extending the remaining bits. Ensure that the Vector Facility (MSR.VEC) is enabled before using this instruction; otherwise, a Vector_Unavailable exception will be raised. This operation is useful for processing pixel data where each pixel requires byte-level manipulation.

Example

vupkhpx vd, vb

Encoding

Binary Layout
4
0
vD
6
0
11
vB
16
846
21
 
Format VX-form
Opcode 0x1000034E
Extension VMX (AltiVec)
Registers Altered MSR

Operands

  • vD
    Target
  • vB
    Source