mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
CHG: Reversed @piwi 's changes to parity. I'm getting assembler compiler errors.
This commit is contained in:
parent
ce161f5633
commit
b351374ca8
1 changed files with 7 additions and 10 deletions
|
@ -13,20 +13,17 @@
|
||||||
|
|
||||||
extern const uint8_t OddByteParity[256];
|
extern const uint8_t OddByteParity[256];
|
||||||
|
|
||||||
#define oddparity8(x) (OddByteParity[(x)])
|
static inline uint8_t oddparity8(uint8_t bt)
|
||||||
|
{
|
||||||
|
return OddByteParity[bt];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
extern const uint8_t EvenByteParity[256];
|
extern const uint8_t EvenByteParity[256];
|
||||||
|
|
||||||
static inline bool /*__attribute__((always_inline))*/ evenparity8(const uint8_t x) {
|
static inline uint8_t evenparity8(const uint8_t bt)
|
||||||
#if !defined __i386__ || !defined __GNUC__
|
{
|
||||||
return EvenByteParity[x];
|
return EvenByteParity[bt];
|
||||||
#else
|
|
||||||
uint8_t y;
|
|
||||||
__asm( "testb $255, %1\n"
|
|
||||||
"setpo %0\n" : "=r"(y) : "r"(x): );
|
|
||||||
return y;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue