My task is to check (>trillions checks), does two int contain any of predefined pairs of nibbles (first pair 0x2 0x7; second 0xd 0x8). For example:
bit offset:
You could possibly throw out some non-matching candidates earlier:
int nibble_check (uint32_t A, uint32_t B) { if ( !(A & B & 0x22222222) && !(A & B & 0x88888888)) return 0; //rest of checking here... }