vupklsb

Vector Unpack Low Signed Byte

vupklsb vD, vB

Unpacks low 8 signed bytes to 8 signed halfwords.

Details

The Vector Unpack Low Signed Byte instruction (vupklsb) unpacks the low 8 bytes of a vector register into signed halfwords in another vector register. Each byte is sign-extended to form a 16-bit halfword.

Pseudocode Operation

if MSR.VEC=0 then Vector_Unavailable()
do i = 0 to 7
   VSR[VRT+32].hword[i] ←EXTS16(VSR[VRB+32].byte[i+8])
end

Programming Note

This instruction is useful for processing byte data by converting it into signed halfwords, which can be beneficial for operations requiring sign extension. Ensure that the vector facility (MSR.VEC) is enabled before using this instruction; otherwise, a Vector_Unavailable exception will occur. The input vector must be properly aligned to avoid unexpected results.

Example

vupklsb vd, vb

Encoding

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

Operands

  • vD
    Target
  • vB
    Source