KMOVW, KMOVB, KMOVQ, KMOVD
Move From and to Mask Registers
stableVMJITAOTinstruction
Encodings
| Opcode | Instruction | Op/En | 64-bit | Compat/Legacy | Description |
|---|---|---|---|---|---|
VEX.L0.0F.W0 90 /r | KMOVW k1, k2/m16 | RM | Valid | Valid | Move 16 bits mask from k2/m16 and store the result in k1. OR AVX10.1 |
VEX.L0.66.0F.W0 90 /r | KMOVB k1, k2/m8 | RM | Valid | Valid | Move 8 bits mask from k2/m8 and store the result in k1. OR AVX10.1 |
VEX.L0.0F.W1 90 /r | KMOVQ k1, k2/m64 | RM | Valid | Valid | Move 64 bits mask from k2/m64 and store the result in k1. OR AVX10.1 |
VEX.L0.66.0F.W1 90 /r | KMOVD k1, k2/m32 | RM | Valid | Valid | Move 32 bits mask from k2/m32 and store the result in k1. OR AVX10.1 |
VEX.L0.0F.W0 91 /r | KMOVW m16, k1 | MR | Valid | Valid | Move 16 bits mask from k1 and store the result in m16. OR AVX10.1 |
VEX.L0.66.0F.W0 91 /r | KMOVB m8, k1 | MR | Valid | Valid | Move 8 bits mask from k1 and store the result in m8. OR AVX10.1 |
VEX.L0.0F.W1 91 /r | KMOVQ m64, k1 | MR | Valid | Valid | Move 64 bits mask from k1 and store the result in m64. OR AVX10.1 |
VEX.L0.66.0F.W1 91 /r | KMOVD m32, k1 | MR | Valid | Valid | Move 32 bits mask from k1 and store the result in m32. OR AVX10.1 |
VEX.L0.0F.W0 92 /r | KMOVW k1, r32 | RR | Valid | Valid | Move 16 bits mask from r32 to k1. OR AVX10.1 |
VEX.L0.66.0F.W0 92 /r | KMOVB k1, r32 | RR | Valid | Valid | Move 8 bits mask from r32 to k1. OR AVX10.1 |
VEX.L0.F2.0F.W1 92 /r | KMOVQ k1, r64 | RR | Valid | Invalid | Move 64 bits mask from r64 to k1. OR AVX10.1 |
VEX.L0.F2.0F.W0 92 /r | KMOVD k1, r32 | RR | Valid | Valid | Move 32 bits mask from r32 to k1. OR AVX10.1 |
VEX.L0.0F.W0 93 /r | KMOVW r32, k1 | RR | Valid | Valid | Move 16 bits mask from k1 to r32. OR AVX10.1 |
VEX.L0.66.0F.W0 93 /r | KMOVB r32, k1 | RR | Valid | Valid | Move 8 bits mask from k1 to r32. OR AVX10.1 |
VEX.L0.F2.0F.W1 93 /r | KMOVQ r64, k1 | RR | Valid | Invalid | Move 64 bits mask from k1 to r64. OR AVX10.1 |
VEX.L0.F2.0F.W0 93 /r | KMOVD r32, k1 | RR | Valid | Valid | Move 32 bits mask from k1 to r32. OR AVX10.1 |
Operand encoding
Each mode is a value of the Op/En column above. It says which field of the encoded instruction carries each operand, in the order they are written, and whether the instruction reads it, writes it or both.
RM
modrm.regescrituraModRM byte, reg field (bits 5-3)modrm.rmlecturaModRM byte, r/m field (bits 2-0); with the SIB byte and the displacement when the mod field asks for them
MR
modrm.rmlectura y escrituraModRM byte, r/m field (bits 2-0); with the SIB byte and the displacement when the mod field asks for themmodrm.reglecturaModRM byte, reg field (bits 5-3)
RR
modrm.regescrituraModRM byte, reg field (bits 5-3)modrm.rmlecturaModRM byte, r/m field (bits 2-0); with the SIB byte and the displacement when the mod field asks for them
Measured cost
Loading measurements from arch-data...
Description
Copies values from the source operand (second operand) to the destination operand (first operand). The source and destination operands can be mask registers, memory location or general purpose. The instruction cannot be used to transfer data between general purpose registers and or memory locations.
When moving to a mask register, the result is zero extended to MAX_KL size (i.e., 64 bits currently). When moving to a general-purpose register (GPR), the result is zero-extended to the size of the destination. In 32-bit mode, the default GPR destination's size is 32 bits. In 64-bit mode, the default GPR destination's size is 64 bits. Note that VEX.W can only be used to modify the size of the GPR operand in 64b mode.
Operation
KMOVW
IF *destination is a memory location*
DEST[15:0] := SRC[15:0]
IF *destination is a mask register or a GPR *
DEST := ZeroExtension(SRC[15:0])
KMOVB
IF *destination is a memory location*
DEST[7:0] := SRC[7:0]
IF *destination is a mask register or a GPR *
DEST := ZeroExtension(SRC[7:0])
KMOVQ
IF *destination is a memory location or a GPR*
DEST[63:0] := SRC[63:0]
IF *destination is a mask register*
DEST := ZeroExtension(SRC[63:0])
KMOVD
IF *destination is a memory location*
DEST[31:0] := SRC[31:0]
IF *destination is a mask register or a GPR *
DEST := ZeroExtension(SRC[31:0])Intel C/C++ compiler intrinsics
KMOVW __mmask16 _mm512_kmov(__mmask16 a);Flags affected
None.
SIMD Floating-Point Exceptions
None.
Other Exceptions
Instructions with RR operand encoding, see Table 2-65, "TYPE K20 Exception Definition (VEX-Encoded OpMask Instructions w/o Memory Arg)." Instructions with RM or MR operand encoding, see Table 2-66, "TYPE K21 Exception Definition (VEX-Encoded OpMask Instructions Addressing Memory)."