34#ifndef _UTIL_PARITY_H_
35#define _UTIL_PARITY_H_
40#ifndef __ATTR_ALWAYS_INLINE__
41#define __ATTR_ALWAYS_INLINE__ __inline__ __attribute__((__always_inline__))
56static __ATTR_ALWAYS_INLINE__
59 if (__builtin_constant_p (__builtin_parity (__val)))
60 return (
uint8_t) __builtin_parity (__val);
63 "mov __tmp_reg__, %0" "\n\t"
64 "swap __tmp_reg__" "\n\t"
65 "eor %0, __tmp_reg__" "\n\t"
74 :
"+d" (__val) ::
"r0");
unsigned char uint8_t
Definition: stdint.h:83
static uint8_t parity_even_bit(uint8_t __val)
Definition: parity.h:57