prtyd

Parity Doubleword

prtyd RA, RS

Calculates parity of a doubleword (Scalar).

Details

Computes the parity of the entire 64-bit doubleword in register RS by XORing all 64 bits and stores the result (a single bit) in the low bit of register RA. All other bits of RA are cleared to zero. No condition registers or status fields are affected.

Pseudocode Operation

parity_bit ← 0
for i in 0 to 63 do
  parity_bit ← parity_bit XOR RS[i]
end
RA ← (0b0000000000000000000000000000000000000000000000000000000000000 || parity_bit)

Programming Note

The prtyd instruction is useful for parity checking on doubleword values. It sets the least significant bit of RA based on the parity of each byte in RS, which can be helpful for error detection. Ensure that RS and RA are properly aligned to avoid unexpected behavior. This instruction operates at user privilege level.

Example

prtyd r4, r3

Encoding

Binary Layout
31
0
RS
6
RA
11
/
16
186
21
/
31
 
Format X-form
Opcode 0x7C000174
Extension Base
Registers Altered CR0, XER

Operands

  • RA
    Target
  • RS
    Source
  • RT
    Target General Purpose Register
  • RB
    Source General Purpose Register