1 //-----------------------------------------------------------------------------
2 // This code is licensed to you under the terms of the GNU GPL, version 2 or,
3 // at your option, any later version. See the LICENSE.txt file for the text of
5 //-----------------------------------------------------------------------------
7 //-----------------------------------------------------------------------------
9 // all functions defined in header file by purpose. Allows compiler optimizations.
16 extern const uint8_t OddByteParity
[256];
19 static inline bool oddparity8(const uint8_t x
) {
20 return OddByteParity
[x
];
24 static inline bool evenparity8(const uint8_t x
) {
25 return !OddByteParity
[x
];
29 static inline bool evenparity32(uint32_t x
) {
33 return evenparity8(x
);
35 return __builtin_parity(x
);
40 static inline bool oddparity32(uint32_t x
) {
46 return !__builtin_parity(x
);
50 #endif /* __PARITY_H */