MOVDIR64B

Move 64 Bytes as Direct Store

stableVMJITAOTinstruction

Encodings

OpcodeInstructionOp/En64-bitCompat/LegacyDescription
66 0F 38 F8 /rMOVDIR64B r16/r32/r64, m512 Op/En Tuple Operand 1 A N/A ModRM:reg (w)AValidValidMove 64-bytes as direct-store with guaranteed 64- byte write atomicity from the source memory operand address to destination memory address specified as offset to ES segment in the register operand. Instruction Operand Enc oding1 Ope rand 2 Operand 3 Operand 4 Mod RM:r/m (r) N/A N/A

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.

A

  1. modrm.reg escrituraModRM byte, reg field (bits 5-3)
  2. modrm.rm lecturaModRM 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

Moves 64-bytes as direct-store with 64-byte write atomicity from source memory address to destination memory address. The source operand is a normal memory operand. The destination operand is a memory location specified in a general-purpose register. The register content is interpreted as an offset into ES segment without any segment override. In 64-bit mode, the register operand width is 64-bits (32-bits with 67H prefix). Outside of 64-bit mode, the register width is 32-bits when CS.D=1 (16-bits with 67H prefix), and 16-bits when CS.D=0 (32-bits with 67H prefix). MOVDIR64B requires the destination address to be 64-byte aligned. No alignment restriction is enforced for source operand.

MOVDIR64B first reads 64-bytes from the source memory address. It then performs a 64-byte direct-store operation to the destination address. The load operation follows normal read ordering based on source address memorytype. The direct-store is implemented by using the write combining (WC) memory type protocol for writing data. Using this protocol, the processor does not write the data into the cache hierarchy, nor does it fetch the corresponding cache line from memory into the cache hierarchy. If the destination address is cached, the line is writtenback (if modified) and invalidated from the cache, before the direct-store.

Unlike stores with non-temporal hint which allow UC/WP memory-type for destination to override the non-temporal hint, direct-stores always follow WC memory type protocol irrespective of destination address memory type (including UC/WP types). Unlike WC stores and stores with non-temporal hint, direct-stores are eligible for immediate eviction from the write-combining buffer, and thus not combined with younger stores (including direct-stores) to the same address. Older WC and non-temporal stores held in the write-combing buffer may be combined with younger direct stores to the same address. Direct stores are weakly ordered relative to other stores. Software that desires stronger ordering should use a fencing instruction (MFENCE or SFENCE) before or after a direct store to enforce the ordering desired.

There is no atomicity guarantee provided for the 64-byte load operation from source address, and processor implementations may use multiple load operations to read the 64-bytes. The 64-byte direct-store issued by MOVDIR64B guarantees 64-byte write-completion atomicity. This means that the data arrives at the destination in a single undivided 64-byte write transaction.

Availability of the MOVDIR64B instruction is indicated by the presence of the CPUID feature flag MOVDIR64B (bit 28 of the ECX register in leaf 07H, see "CPUID--CPU Identification" in the Intel(R) 64 and IA-32 Architectures Software Developer's Manual, Volume 2A).

Operation

DEST := SRC;

Intel C/C++ compiler intrinsics

MOVDIR64B void _movdir64b(void *dst, const void* src);

Exceptions

Protected mode
#GP(0)For an illegal memory operand effective address in the CS, DS, ES, FS or GS segments. If address in destination (register) operand is not aligned to a 64-byte boundary.
#SS(0)For an illegal address in the SS segment. #PF (fault-code) For a page fault.
#UDIf CPUID.07H.00H:ECX.MOVDIR64B[28] = 0. If LOCK prefix is used.
Real address mode
#GPIf any part of the operand lies outside the effective address space from 0 to FFFFH. If address in destination (register) operand is not aligned to a 64-byte boundary.
#UDIf CPUID.07H.00H:ECX.MOVDIR64B[28] = 0. If LOCK prefix is used.
Virtual-8086 mode
Same exceptions as in real address mode.
Compatibility mode
Same exceptions as in protected mode.
64-bit mode
#SS(0)If memory address referencing the SS segment is in non-canonical form.
#GP(0)If the memory address is in non-canonical form. If address in destination (register) operand is not aligned to a 64-byte boundary. #PF (fault-code) For a page fault.
#UDIf CPUID.07H.00H:ECX.MOVDIR64B[28] = 0. If LOCK prefix is used.

Sources