prtyd
Parity Doubleword
prtyd RA, RS
Calculates parity of a doubleword (Scalar).
Encoding
Binary Layout
31
0:5
RS
6:10
RA
11:15
/
16:20
186
21:30
/
31
Operands
-
RA
Target -
RS
Source -
RT
Target General Purpose Register -
RB
Source General Purpose Register
Reference
View in PowerISA v3.1C Specification ↗
OPF Power ISA v3.1C
Description
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.
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.