prtyd

Parity Doubleword

prtyd RA, RS

Calculates parity of a doubleword (Scalar).

Details

The Parity Doubleword instruction examines the least significant bit in each byte of the contents of register RS. If there is an odd number of one bits, it places the value 1 into register RA; otherwise, it places the value 0.

Pseudocode Operation

s ← 0
do i = 0 to 7
   s ← s ⊕ (RS)i×8+7
RA ← 630 || s

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