Logical AND NOT

Encoding

EncodingOperand 1Operand 2Operand 3
rvmModRM.reg[w]VEX.vvvv[r]ModRM.r/m[r]

Description

The ANDN instruction ANDs the two source operands. The first source operand is inverted before being ANDed with the other source operand. The result is stored in the destination operand.

The operand size is always 32 bits if not in Long Mode. In other words, VEX.W1 is treated as VEX.W0 outside Long Mode.

Operation

public void ANDN(ref U32 dest, U32 src1, U32 src2)
{
    dest = ~src1 & src2;
}

public void ANDN(ref U64 dest, U64 src1, U64 src2)
{
    dest = ~src1 & src2;
}

Flags Affected

CF (carry flag)
Cleared.
PF (parity flag)
Undefined.
AF (auxiliary flag)
Undefined.
ZF (zero flag)
Set according to the result.
SF (sign flag)
Set according to the result.
OF (overflow flag)
Cleared.

Intrinsics

None. Auto-generated by compiler.

Exceptions

SIMD Floating-Point

None.

Other Exceptions

VEX Encoded Form: See Type 13 Exception Conditions.