vexpanddm

Vector Expand Doubleword Mask

vexpanddm vD, vB

Expands bits from a GPR mask into a doubleword-element vector.

Details

The Vector Expand Doubleword Mask instruction creates a field mask by replicating the contents of bit 0 of each doubleword element in the source VSR to all bits in the corresponding element in the target VSR.

Pseudocode Operation

if MSR.VEC=0 then
    Vector_Unavailable()
do i = 0 to 1
    if VSR[VRB+32].dword[i].bit[0]=1 then
        VSR[VRT+32].dword[i] ←0xFFFF_FFFF_FFFF_FFFF
    else
        VSR[VRT+32].dword[i] ←0x0000_0000_0000_0000
end

Programming Note

This instruction is useful for creating masks where each doubleword element in the target vector register is either all ones or all zeros based on the least significant bit of the corresponding source vector element. Ensure that the Vector Facility (VEC) bit in the Machine State Register (MSR) is set to 1; otherwise, a Vector Unavailable exception will be raised. The instruction operates on doubleword elements, so ensure proper alignment and indexing when using this instruction.

Example

vexpanddm vd, vb

Encoding

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

Operands

  • vD
    Target
  • vB
    Source