https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117192
--- Comment #11 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Uroš Bizjak from comment #9) > (In reply to Andrew Pinski from comment #6) > > > The andn is swapped. > Indeed: > > +(define_expand "andn<mode>3" > + [(set (match_operand:MMXMODEI 0 "register_operand") > + (and:MMXMODEI > + (not:MMXMODEI (match_operand:MMXMODEI 1 "register_operand")) > + (match_operand:MMXMODEI 2 "register_operand")))] > + "TARGET_SSE2") > > +(define_expand "andn<mode>3" > + [(set (match_operand:VI 0 "register_operand") > + (and:VI > + (not:VI (match_operand:VI 2 "register_operand")) > + (match_operand:VI 1 "register_operand")))] > + "TARGET_SSE2") > > Which operand order is correct? The correct one is operand 2 with the not. >From https://gcc.gnu.org/onlinedocs/gccint/Standard-Names.html : ‘andnm3’ Like andm3, but it uses bitwise-complement of operand 2 rather than operand 2 itself.