Skip to content

Instantly share code, notes, and snippets.

@void-hoge
Created June 27, 2017 11:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save void-hoge/06a918a9ea81d7e0d23ae524ac759dab to your computer and use it in GitHub Desktop.
Save void-hoge/06a918a9ea81d7e0d23ae524ac759dab to your computer and use it in GitHub Desktop.
const base xMask = 0x000000000000ffff;
const base constant = 0x0001000100010001;
const base yMask = (constant << 192) | (constant << 128) | (constant << 64) | constant;
const base constantBlock = 0x000f000f000f000f;
const base blockMask[16] = { ((constantBlock << 0) << 0), ((constantBlock << 4) << 0), ((constantBlock << 8) << 0), ((constantBlock << 12) << 0),
((constantBlock << 0) << 64), ((constantBlock << 4) << 64), ((constantBlock << 8) << 64), ((constantBlock << 12) << 64),
((constantBlock << 0) << 128), ((constantBlock << 4) << 128), ((constantBlock << 8) << 128), ((constantBlock << 12) << 128),
((constantBlock << 0) << 192), ((constantBlock << 4) << 192), ((constantBlock << 8) << 192), ((constantBlock << 12) << 192)};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment