#include <util/parity.h> 

This header file contains optimized assembler code to calculate the parity bit for a byte.