vextractbm

Vector Extract Byte Mask

vextractbm RA, vB

Extracts bit 0 of each byte element from a VSR into a GPR.

Details

The contents of bit 0 of each byte element of VSR[VRB+32] are concatenated and placed into bits 48:63 of GPR[RT]. Bits 0:47 of GPR[RT] are set to 0.

Pseudocode Operation

if MSR.VEC=0 then
    Vector_Unavailable()
do i = 0 to 15
    GPR[RT].bit[48+i] ← VSR[VRB+32].byte[i].bit[0]
end
GPR[RT].bit[0:47] ← 0

Programming Note

This instruction is used to extract the least significant bit from each byte of a vector register and pack them into the upper half of a general-purpose register. Ensure that the Vector Facility (MSR.VEC) is enabled before using this instruction; otherwise, it will raise an exception. The lower half of the target GPR is always zeroed out, so be cautious if you need to preserve existing data in that portion.

Example

vextractbm r4, vb

Encoding

Binary Layout
4
0
RT
6
8
11
VRB
16
1602
21
 
Format VX-form
Opcode 0x10000642
Extension VMX (AltiVec)
Registers Altered MSR

Operands

  • RA
    Target
  • vB
    Source
  • RT
    Target General Purpose Register
  • VRB
    Source Vector Register