Created
September 28, 2020 20:37
-
-
Save bit-hack/928dfcd8919b320c393fdb4e458ecc8d to your computer and use it in GitHub Desktop.
Generate bit mask
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// generate a bitmask between lo and hi bits inclusive | |
#define BIT_MASK(hi, lo) ((~0u >> (31-(hi))) & (~0u << (lo))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment