util_parity(3)

πŸ“¦ version 2.2.1, in fedora 43, fedora 44, opensuse-leap 16.0

πŸ’– 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