Logical AND NOT Packed Double-Precision Floating-Point Values

Encoding

EncodingOperand 1Operand 2Operand 3Operand 4
rmn/aModRM.reg[rw]ModRM.r/m[r]
rvmn/aModRM.reg[rw]VEX.vvvv[r]ModRM.r/m[r]
ervmfullModRM.reg[rw]EVEX.vvvvv[r]ModRM.r/m[r]

Description

The (V)ANDNPD instruction ANDs two, four, or eight double-precision floating-point values from 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.

All forms except the legacy SSE one will zero the upper (untouched) bits.

Operation

public void ANDNPD(SimdU64 dest, SimdU64 src)
{
    dest[0] = ~dest[0] & src[0];
    dest[1] = ~dest[1] & src[1];
    // dest[2..] is unmodified
}

void VANDNPD_Vex(SimdU64 dest, SimdU64 src1, SimdU64 src2, int kl)
{
    for (int n = 0; n < kl; n++)
        dest[n] = ~src1[n] & src2[n];
    dest[kl..] = 0;
}
public void VANDNPD_Vex128(SimdU64 dest, SimdU64 src1, SimdU64 src2) =>
    VANDNPD_Vex(dest, src1, src2, 2);
public void VANDNPD_Vex256(SimdU64 dest, SimdU64 src1, SimdU64 src2) =>
    VANDNPD_Vex(dest, src1, src2, 4);

void VANDNPD_EvexMemory(SimdU64 dest, SimdU64 src1, SimdU64 src2, KMask k, int kl)
{
    for (int n = 0; n < kl; n++)
    {
        if (k[n])
            dest[n] = ~src1[n] & (EVEX.b ? src2[0] : src2[n]);
        else if (EVEX.z)
            dest[n] = 0;
        // otherwise unchanged
    }
    dest[kl..] = 0;
}
public void VANDNPD_Evex128Memory(SimdU64 dest, SimdU64 src1, SimdU64 src2, KMask k) =>
    VANDNPD_EvexMemory(dest, src1, src2, k, 2);
public void VANDNPD_Evex256Memory(SimdU64 dest, SimdU64 src1, SimdU64 src2, KMask k) =>
    VANDNPD_EvexMemory(dest, src1, src2, k, 4);
public void VANDNPD_Evex512Memory(SimdU64 dest, SimdU64 src1, SimdU64 src2, KMask k) =>
    VANDNPD_EvexMemory(dest, src1, src2, k, 8);

void VANDNPD_EvexRegister(SimdU64 dest, SimdU64 src1, SimdU64 src2, KMask k, int kl)
{
    if (kl == 8 && EVEX.b)
        OverrideRoundingModeForThisInstruction(EVEX.rc);

    for (int n = 0; n < kl; n++)
    {
        if (k[n])
            dest[n] = ~src1[n] & src2[n];
        else if (EVEX.z)
            dest[n] = 0;
        // otherwise unchanged
    }
    dest[kl..] = 0;
}
public void VANDNPD_Evex128Register(SimdU64 dest, SimdU64 src1, SimdU64 src2, KMask k) =>
    VANDNPD_EvexRegister(dest, src1, src2, k, 2);
public void VANDNPD_Evex256Register(SimdU64 dest, SimdU64 src1, SimdU64 src2, KMask k) =>
    VANDNPD_EvexRegister(dest, src1, src2, k, 4);
public void VANDNPD_Evex512Register(SimdU64 dest, SimdU64 src1, SimdU64 src2, KMask k) =>
    VANDNPD_EvexRegister(dest, src1, src2, k, 8);

Intrinsics

Exceptions

SIMD Floating-Point

None.

Other Exceptions

VEX Encoded Form: See Type 4 Exception Conditions.
EVEX Encoded Form: See Type E4 Exception Conditions.