23#define popcnt64(x) __popcnt64(x)
24#elif defined(__GNUC__) || defined(__clang__)
25#define popcnt64(x) __builtin_popcountll(x)
27static inline int popcnt64(uint64_t x) {
28 x = x - ((x >> 1) & 0x5555555555555555ULL);
29 x = (x & 0x3333333333333333ULL) + ((x >> 2) & 0x3333333333333333ULL);
30 x = (x + (x >> 4)) & 0x0F0F0F0F0F0F0F0FULL;
31 return (x * 0x0101010101010101ULL) >> 56;
57 "cannot toggle players with !");
71 result.
x = (int8_t)(left.
x + right.
x);
72 result.
y = (int8_t)(left.
y + right.
y);
86 result.
x = (int8_t)(left.
x - right.
x);
87 result.
y = (int8_t)(left.
y - right.
y);
Thin abstract layer for rsmc.
@ RsmcBoardCellBlack
Definition abstractions.h:28
@ RsmcBoardCellWhite
Definition abstractions.h:29
uint8_t RsmcBoardCell
Board cell (empty, black, white)
Definition abstractions.h:25
Types and constants for rsmc.
uint8_t RsmcPlayer
Player's color.
Definition core.h:70
@ RsmcPlayerWhite
Definition core.h:73
@ RsmcPlayerBlack
Definition core.h:72
Stores coords for the board. Coords might be invalid and negative.
Definition abstractions.h:55
int8_t x
Definition abstractions.h:56
int8_t y
Definition abstractions.h:57