vprtybd

Vector Parity Byte Doubleword

vprtybd vD, vB

Computes parity of bytes within doublewords.

Details

The Vector Parity Byte Doubleword instruction calculates the parity of the least significant bit (LSB) in each byte of a doubleword element. For each integer value i from 0 to 1, it checks if the sum of the LSBs in each byte sub-element of doubleword element i of VSR[VRB+32] is odd. If the sum is odd, it places the value 1 into doubleword element i of VSR[VRT+32]; otherwise, it places the value 0.

Pseudocode Operation

if MSR.VEC=0 then Vector_Unavailable()
do i = 0 to 1
    s ←0
    do j = 0 to 7
        s ←s ⊕VSR[VRB+32].dword[i].byte[j].bit[7]
    end
    VSR[VRT+32].dword[i] ←CHOP64(EXTZ(s))
end

Programming Note

This instruction is useful for calculating the parity of the least significant bit in each byte of a doubleword element. Ensure that the Vector Facility (MSR.VEC) is enabled before using this instruction; otherwise, it will raise an exception. The operation is performed on 64-bit elements, and the result is stored in the corresponding output vector register. There are no specific alignment requirements for the input data.

Example

vprtybd vd, vb

Encoding

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

Operands

  • vD
    Target
  • vB
    Source