vextractdm

Vector Extract Doubleword Mask

vextractdm RA, vB

Extracts MSB of each doubleword into a GPR mask.

Details

Extracts the most significant bit from each doubleword element in the source vector and packs these bits into a general-purpose register as a mask. This is a VMX instruction with no effect on condition registers or status fields.

Pseudocode Operation

result ← 0
for i in 0 to 3 do
  if vB[i*64] = 1 then
    result[i] ← 1
  else
    result[i] ← 0
  end if
end for
RA ← result

Programming Note

This instruction is useful for extracting the least significant bit of each doubleword in a vector register and placing it into a general-purpose register. Ensure that the Vector Facility (MSR.VEC) is enabled before using this instruction; otherwise, a Vector_Unavailable exception will be raised. The result is stored in bits 62:63 of the target GPR, with all other bits set to zero.

Example

vextractdm r4, vb

Encoding

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

Operands

  • RA
    Target
  • vB
    Source