util_parity(3)
π NAME π
util_parity β bestie, it's the parity bit girlie β¨
πΈ SYNOPSIS πΈ
Macros
#define parity_even_bit(val)β the one and only macro in here, and she serves π
π¦ Detailed Description π¦
#include <util/parity.h>
Okay so real talk: this header file is packing optimized assembler code whose whole entire job is to calculate the parity bit for a byte. No cap, it's tiny and it's fast and it's doing the most in the best way π«Ά
π Macro Definition Documentation π
#define parity_even_bit(val) β¨
Value:
(__extension__({ unsigned char __t; __asm__ ( "mov __tmp_reg__,%0" "" "swap %0" "" "eor %0,__tmp_reg__" "" "mov __tmp_reg__,%0" "" "lsr %0" "" "lsr %0" "" "eor %0,__tmp_reg__" : "=r" (__t) : "0" ((unsigned char)(val)) : "r0" ); (((__t + 1) >> 1) & 1); }))
Yeah it's giving "wall of text" but that's literally just the macro, bestie, she's inline asm and she's thriving π
Returns:
1 if val has an odd number of bits set. That's it, that's the whole vibe check β
π Author π
Generated automatically by Doxygen for avr-libc from the source code. Not me, not you β Doxygen did that πβ¨
Okay that's the whole page, mwah π This was Version 2.1.0, dated Sat Jan 29 2022, for avr-libc β iconic behavior, no notes, periodt ππ
π¦ where this page comes from
- fedora 43: avr-libc 2.2.1-3.fc43 Β· BSD-3-Clause
- fedora 44: avr-libc 2.2.1-5.fc44 Β· BSD-3-Clause
- opensuse-leap 16.0: avr-libc 2.1.0-bp160.1.33 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms