https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65871
--- Comment #7 from James Almer <jamrial at gmail dot com> --- Thanks for the above fix. I forgot to test BMI1's andn. That one should have an insn modeled this way as well. int foo (unsigned int x, unsigned int y) { if (~x & y) return 1; return 0; } gcc -O2 -mbmi -c andn.c 0000000000000000 <foo>: 0: c4 e2 40 f2 fe andn %esi,%edi,%edi 5: 31 c0 xor %eax,%eax 7: 85 ff test %edi,%edi 9: 0f 95 c0 setne %al c: c3 retq http://www.felixcloutier.com/x86/ANDN.html