vextractwm

Vector Extract Word Mask

vextractwm RA, vB

Extracts the least significant bit of each word element from a vector register and places them into a general-purpose register.

Details

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

Pseudocode Operation

if MSR.VEC=0 then
    Vector_Unavailable()
do i = 0 to 3
    GPR[RT].bit[60+i] ← VSR[VRB+32].word[i].bit[0]
end
GPR[RT].bit[0:59] ← 0

Programming Note

This instruction is used to extract the least significant bit of each word from a vector register and pack them into the upper four bits 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 60 bits of the target GPR are always cleared, so be cautious if you need to preserve existing data in those positions.

Example

vextractwm r4, vb

Encoding

Binary Layout
4
0
RA
6
0
11
vB
16
1730
 
Format VX-form
Opcode 0x100006C2
Extension VMX (AltiVec)
Registers Altered MSR

Operands

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