kxorq
XOR Mask Quadword
KXORQ k1, k2, k3
Bitwise XOR of 64-bit masks.
Details
Performs a bitwise XOR of two 64-bit AVX-512 opmask registers and stores the result in the destination opmask. This instruction operates on mask registers (k0–k7) treating them as 64-bit values and does not affect EFLAGS. It is part of the AVX-512BW extension and executes with minimal latency.
Pseudocode Operation
k1 ← k2 ^ k3;
Example
KXORQ k1, k2, k3
Encoding
Binary Layout
EVEX
+0
0F
+4
47
+5
Operands
-
dest
AVX-512 opmask register (k0-k7) -
src1
AVX-512 opmask register (k0-k7) -
src2
AVX-512 opmask register (k0-k7)
Reference (Intel® SDM)
Instruction Forms
| Opcode | Instruction | Op/En | 64/32-bit Mode | CPUID | Description |
|---|---|---|---|---|---|
| VEX.L1.0F.W0 47 /r | KXORW k1, k2, k3 | V/V | RVR AVX512F OR AVX10.1 | Bitwise XOR 16-bit masks k2 and k3 and place result in k1. | |
| VEX.L1.66.0F.W0 47 /r | KXORB k1, k2, k3 | V/V | RVR AVX512DQ OR AVX10.1 | Bitwise XOR 8-bit masks k2 and k3 and place result in k1. | |
| VEX.L1.0F.W1 47 /r | KXORQ k1, k2, k3 | V/V | RVR AVX512BW OR AVX10.1 | Bitwise XOR 64-bit masks k2 and k3 and place result in k1. | |
| VEX.L1.66.0F.W1 47 /r | KXORD k1, k2, k3 | V/V | RVR AVX512BW OR AVX10.1 | Bitwise XOR 32-bit masks k2 and k3 and place result in k1. |
Description
Performs a bitwise XOR between the vector mask k2 and the vector mask k3, and writes the result into vector mask k1 (three-operand form).
Operation
KXORW DEST[15:0] := SRC1[15:0] BITWISE XOR SRC2[15:0] DEST[MAX_KL-1:16] := 0 KXORB DEST[7:0] := SRC1[7:0] BITWISE XOR SRC2[7:0] DEST[MAX_KL-1:8] := 0 KXORQ DEST[63:0] := SRC1[63:0] BITWISE XOR SRC2[63:0] DEST[MAX_KL-1:64] := 0 KXORD DEST[31:0] := SRC1[31:0] BITWISE XOR SRC2[31:0] DEST[MAX_KL-1:32] := 0
Intel C/C++ Compiler Intrinsic Equivalent
KXORW __mmask16 _mm512_kxor(__mmask16 a, __mmask16 b);
Flags Affected
None.
Exceptions
SIMD Floating-Point Exceptions
None.
Other Exceptions
See Table 2-65, “TYPE K20 Exception Definition (VEX-Encoded OpMask Instructions w/o Memory Arg).”
KXORW/KXORB/KXORQ/KXORD—Bitwise Logical XOR Masks Vol. 2A 3-531